Closed nanliu closed 11 years ago
This appears to be an FFI issue. @wmeissner?
See the above commit. It was never working in JRuby, it was just silently failing to cleanup resources.
Does not work on MRI either spoon version 0.0.3, ffi version 1.6.0
/home/cpk/.rvm/gems/ruby-1.9.3-p392/gems/ffi-1.6.0/lib/ffi/autopointer.rb:72:in `initialize': proc must be callable (RuntimeError)
from /home/cpk/.rvm/gems/ruby-1.9.3-p392/gems/spoon-0.0.3/lib/spoon/unix.rb:23:in `new'
from /home/cpk/.rvm/gems/ruby-1.9.3-p392/gems/spoon-0.0.3/lib/spoon/unix.rb:23:in `initialize'
from examples/ls.rb:20:in `new'
from examples/ls.rb:20:in `<main>'
@r4um Copy commit b4b4877 from wmeissner/spoon to a fresh checkout of spoon master, and it should work on both.
@wmeissner thanks, After the patch causes a crash
Starting program: /home/cpk/.rvm/rubies/ruby-1.8.7-p249/bin/ruby examples/ls.rb
[Thread debugging using libthread_db enabled]
*** glibc detected *** /home/cpk/.rvm/rubies/ruby-1.8.7-p249/bin/ruby: double free or corruption (!prev): 0x0000000000abb4f0 ***
Full back trace here.
@r4um also apply commit 917c0d555592b15a65aa5af2e297283d310ea8fb - the size of the spawnattr struct was too small for 64bit linux
@headius you should probably spin a new spoon gem with these commits sometime.
I haven't had a chance to dive into the changes with ffi. spoon gem works with JRuby 1.7.1, but not 1.7.2: