http://groups.google.com/group/ruby-ffi/browse_thread/thread/ff20fdb3ec612585
explains why you really can’t
Stack: [0x00030000,0x00230000], sp=0x0022f1ac, free space=2044k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x1dac2c]
j sun.misc.Unsafe.getInt(J)I+0
j com.kenai.jffi.MemoryIO$UnsafeImpl.getInt(J)I+4
j org.jruby.ext.ffi.jffi.NativeMemoryIO.getInt(J)I+9
#<FFI::Pointer:0xe2ade0>
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68: [BUG] Segmentation fault
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]
– control frame ———-
c:0006 p:—- s:0021 b:0021 l:000020 d:000020 CFUNC :get_pointer
c:0005 p:0013 s:0017 b:0017 l:000016 d:000016 METHOD E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68
c:0004 p:0042 s:0014 b:0013 l:000012 d:000012 METHOD bad.rb:17
c:0003 p:0049 s:0006 b:0006 l:0025ac d:00172c EVAL bad.rb:27
c:0002 p:—- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0025ac d:0025ac TOP
—————————
– Ruby level backtrace information—————————————–
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68:in `get_pointer’
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:68:in `read_pointer’
bad.rb:17:in `go’
bad.rb:27:in `<main>’
[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
E:\dev\digitalarchive_trunk.trunk>ruby bad.rb
#<FFI::Pointer:0xe2ae80>
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45: [BUG] Segmentation fault
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]
– control frame ———-
c:0006 p:—- s:0021 b:0021 l:000020 d:000020 CFUNC :get_int32
c:0005 p:0013 s:0017 b:0017 l:000016 d:000016 METHOD E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45
c:0004 p:0042 s:0014 b:0013 l:000012 d:000012 METHOD bad.rb:17
c:0003 p:0049 s:0006 b:0006 l:0025ac d:00172c EVAL bad.rb:27
c:0002 p:—- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0025ac d:0025ac TOP
—————————
– Ruby level backtrace information—————————————–
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45:in `get_int32′
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/ffi-0.6.2/lib/ffi/pointer.rb:45:in `read_int’
bad.rb:17:in `go’
bad.rb:27:in `<main>’