New FFI::IO.for_fd fails on Linux (and possibly other platforms) #390

Closed
headius opened this Issue Nov 13, 2012 · 1 comment

Projects

None yet

1 participant

@headius
Member
headius commented Nov 13, 2012

Here's the output. I'm going to disable the spec for now.

headius@headius-Server:~/jruby$ jruby -Xbacktrace.style=raw -S rspec spec/ffi/io_spec.rb 
F

Failures:

  1) FFI::IO.for_fd produces an IO wrapping the specified file descriptor
     Failure/Error: Unable to find matching line from backtrace
       expected no Exception, got java.lang.UnsatisfiedLinkError: unknown
     # java/lang/Thread.java:1495:in `getStackTrace'

Finished in 0.084 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/ffi/io_spec.rb:4 # FFI::IO.for_fd produces an IO wrapping the specified file descriptor
headius@headius-Server:~/jruby$ jruby -rffi -e "FFI::IO.for_fd(2)"
AsmRuntime.java:488:in `newUnsatisifiedLinkError': java.lang.UnsatisfiedLinkError: unknown
    from null:-1:in `fstat'
    from BaseNativePOSIX.java:101:in `fstat'
    from BaseNativePOSIX.java:90:in `fstat'
    from LazyPOSIX.java:95:in `fstat'
    from FileDescriptorIO.java:69:in `<init>'
    from FileDescriptorIO.java:100:in `newInstance'
    from FileDescriptorIO$INVOKER$s$1$0$newInstance.gen:-1:in `call'
    from CachingCallSite.java:326:in `cacheAndCall'
    from CachingCallSite.java:170:in `call'
    from CallOneArgNode.java:57:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from ASTInterpreter.java:75:in `INTERPRET_METHOD'
    from InterpretedMethod.java:182:in `call'
    from DefaultMethod.java:188:in `call'
    from CachingCallSite.java:326:in `cacheAndCall'
    from CachingCallSite.java:170:in `call'
    from -e:1:in `__file__'
    from -e:-1:in `load'
    from Ruby.java:777:in `runScript'
    from Ruby.java:770:in `runScript'
    from Ruby.java:647:in `runNormally'
    from Ruby.java:496:in `runFromMain'
    from Main.java:375:in `doRunFromMain'
    from Main.java:264:in `internalRun'
    from Main.java:230:in `run'
    from Main.java:214:in `run'
    from Main.java:194:in `main'
@ghost ghost was assigned Nov 13, 2012
@ghost
ghost commented Nov 14, 2012

Looks like fstat(int fd) on linux is broken in jnr-posix.

@ghost Unknown added a commit to jnr/jnr-posix that referenced this issue Nov 14, 2012
Wayne Meissner Ensure fstat(int fd) uses __fxstat64() on linux. Fixes jruby/jruby#390 c561e7a
@ghost Unknown added a commit that closed this issue Nov 14, 2012
Wayne Meissner Upgrade to jnr-posix 2.3.2. Fixes #390 7aa1bc2
@ghost ghost closed this in 7aa1bc2 Nov 14, 2012
@ghost Unknown added a commit that referenced this issue Nov 14, 2012
@headius Wayne Meissner + headius Upgrade to jnr-posix 2.3.2. Fixes #390 8a92c51
@prathamesh-sonpatki prathamesh-sonpatki added a commit to prathamesh-sonpatki/jruby that referenced this issue Dec 3, 2012
@headius @prathamesh-sonpatki headius + prathamesh-sonpatki Disable spec for new FFI::IO.for_fd, which fails on Linux.
For #390.
9311c0a
@prathamesh-sonpatki prathamesh-sonpatki added a commit to prathamesh-sonpatki/jruby that referenced this issue Dec 3, 2012
@prathamesh-sonpatki Wayne Meissner + prathamesh-sonpatki Upgrade to jnr-posix 2.3.2. Fixes #390 f355910
@eregon eregon added a commit that referenced this issue Mar 27, 2017
@eregon eregon Squashed 'spec/ruby/' changes from 0fe99d2..2e2057a
2e2057a Test for utc_offset rather than the zone name
5cc5c33 rb_absint_size returns size_t
558f9e3 NIL_P is the standard macro name for a nil test
af2bd9f Fix typo
f4352b9 Fix spec description
a6638c5 Add core Module#initialize_copy spec
e8e7618 Add rescue splat example to language rescue specs
db172f6 Add Time#zone spec
04ea19d Add 2 specs for dumping and loading a File with YAML
c235991 Add spec that objects with singleton methods cannot be dumped
77abc93 Add spec for already-required/provided features
04ec257 Fix typo in require specs
00a2a51 Spec that Kernel#dup and Kernel#clone do not call #allocate
2e268f4 Add spec for YAML dumping and loading an OpenStruct
582d1ed Spec that Class#new does not call #allocate
02b2346 Add a spec to ensure the Encoding::Converter replacement value is actually used.
4b5abb4 Fix spec descriptions
be25e93 Add proper spec checks for rb_big_pack.
cef7444 Fix spec for platforms where fixnum is a full 64 bit int.
d220cd2 Fix rb_hash_aref
4c6477e Add branch for non Range objects in rb_range_values
d2e0b9f Typo in spec method being tested in rb_io_check_closed
d552d16 Use a more formal array for the spec for rb_mem_clear
f3009d4 Add spec for Thread#priority with too small or large priority
c937513 Pass pointers to integers rather than casting them to integers in thread spec
f2a3ca3 Move Symbol specs under symbol_spec.rb
0126547 Fix numerics specs to call correct conversion functions.
ae299e9 Add rb_any_to_s (works for an Object only)
d92f458 Rename a Cext spec
d64fc7c Include the exception for a more useful failing output
5ac37a9 Add a few expectations for $? in Kernel$system specs
c5984f7 Use #spawn + the :pgroup option over fork in Process#wait specs
fff5523 Avoid using #fork in Process#wait specs
c8348a2 Remove extra should_not raise_error
94cfae2 Add spec for jruby/jruby#4328
23946be Add spec for passing nil proc to Marshal.load
9bffb07 Add spec which shows ArgumentError if missing repeated key
0c5f15c Lengthen out for lack of determinism in this fixture
d0d3a7b Change spec to catch uninitialized argf
e47bf97 Add a spec for rb_struct_size
5fa019f Float#next_float, prev_float: Add test for +/-INFINITY
08f3f92 Float#next_float, prev_float: Be a bit more specific about assertion
5a643b3 Float#next_float, prev_float: Be explicit about {next|previous}_float returning same values for +/-0.0
45160c0 Float#prev_float: Simplify test.
491e5a4 Float#next_float: Simplify test.
455f34e Merge pull request #390 from nobu/bug/deprecated-enumerator_class
7c62925 Use Enumerator
a095a40 Enumerable#slice_when: Add spec for 0 or 1 element
6baf83f Add specs for Comparable#clamp (Ruby 2.4.0)
4c0fd74 Start the -R2 run earlier so it starts in the first 5 jobs
d5fa0b7 Start Travis OS X first as it is the slowest
bb5c574 Run Travis on OS X as well
3f05029 Make "single % characters" singular in messages
566dcf6 Split single % cases
19c84be Add new expectation from #388 so Time.now.zone is also tested
9ac9550 Use fixed times to avoid DST changes
2e4c441 Fix condition and just use ctime of the current file
79d2d32 fix typo
c7008bc Allow leading 0 while parsing decimal digits with Integer
4d18863 Detect whether the filesystem supports sub-seconds file times
d675590 Improve `File.atime` and `.mtime` specs with microseconds
c5de600 Fix spec descriptions to always start with a lowercase letter
495d072 Add microseconds specs for File.mtime, .atime and .ctime
b0de2aa Use America/New_York through the whole Time#zone spec

git-subtree-dir: spec/ruby
git-subtree-split: 2e2057afb70d2e63ea25d34156c354dc298cf693
5d256ba
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment