From: Charles Oliver Nutter Date: 2009-08-03T13:34:05+09:00 Subject: Re: JRuby, ffi, bad file descriptor Got the source of that temp.rb handy? It looks like it's passing a bad/closed descriptor to IO.new or something... On Sun, Aug 2, 2009 at 11:17 PM, Daniel Berger wrote: > > > On Aug 2, 2:32 am, Charles Oliver Nutter wrote: >> Hmm, did you post this to JRuby dev list or ruby-ffi list yet? Could >> be something simple... >> >> You might also try getting a raw Java backtrace by passing this flag to JRuby: >> >> -J-Djruby.backtrace.style=raw >> >> That will show us if it's happening in JRuby's IO code or in FFI somewhere. > > I tried to post to jruby-dev, but I guess you can't post directly to > the list via google groups. > > Here's the output using the flag you suggested: > > daniel-bergers-computer:~/Documents/workspace/file-temp/lib/file > djberge$ jruby -J-Djruby.backtrace.style=raw temp.rb > Thread.java:1409:in `getStackTrace': Bad file descriptor - Bad file > descriptor (Errno::EBADF) >        from RubyException.java:139:in `setBacktraceFrames' >        from RaiseException.java:160:in `setException' >        from RaiseException.java:72:in `' >        from Ruby.java:3033:in `newRaiseException' >        from Ruby.java:2789:in `newErrnoEBADFError' >        from RubyIO.java:895:in `initialize' >        from RubyFile.java:405:in `initialize' >        from org/jruby/RubyFile$i_method_0_2$RUBYFRAMEDINVOKER > $initialize.gen:-1:in `call' >        from DynamicMethod.java:176:in `call' >        from SuperCallSite.java:344:in `cacheAndCall' >        from SuperCallSite.java:188:in `callBlock' >        from SuperCallSite.java:193:in `call' >        from temp.rb:31:in `method__1$RUBY$initialize' >        from temp#initialize:-1:in `call' >        from CachingCallSite.java:238:in `cacheAndCall' >        from CachingCallSite.java:46:in `callBlock' >        from CachingCallSite.java:51:in `call' >        from RubyClass.java:593:in `newInstance' >        from RubyIO.java:822:in `newInstance' >        from org/jruby/RubyIO$s_method_0_0$RUBYFRAMEDINVOKER > $newInstance.gen:-1:in `call' >        from DynamicMethod.java:160:in `call' >        from DynamicMethod.java:156:in `call' >        from CachingCallSite.java:258:in `cacheAndCall' >        from CachingCallSite.java:77:in `call' >        from temp.rb:45:in `__file__' >        from temp.rb:-1:in `load' >        from Ruby.java:592:in `runScript' >        from Ruby.java:514:in `runNormally' >        from Ruby.java:360:in `runFromMain' >        from Main.java:268:in `run' >        from Main.java:113:in `run' >        from Main.java:97:in `main' > > Regards, > > Dan > >