Skip to content

Stat of an empty resource does not generate proper Exception. #2048

@enebo

Description

@enebo
jruby -Xnative.enabled=false -e 'File.atime("file:")'
SystemCallError: Unknown error - Unknown Error (0) - __UNKNOWN_CONSTANT__

The reason for this is we assume the FileResource generated will hit jnr-posix and when the stat fails it then asks jnr-posix for the errno(). EmptyFileResource will be generated in this case and it does not hit jnr-posix at all. One possible solution is to manually set errno from EmptyFileResource so that this pattern of depending on jnr-posix for error is valid?

Extra note that it is amazing this case works for me with enabled=true since it is still using EmptyFilerResource. The last errno set must just happen to be an enoent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions