[geos-devel] Ruby, FFI and ERROR_/NOTICE_MESSAGE

J Smith dark.panda+lists at gmail.com
Fri Dec 10 02:20:52 EST 2010


Alright, I think it's all good. I posted to the ruby-ffi list and got
back a response already and the prognosis is good! See
http://groups.google.com/group/ruby-ffi/browse_thread/thread/836d6c772d8088dc
, wherein I picked up the science that Mr. Wayne Meissner laid down.

Apparently the garbage collector was collecting some objects that
shouldn't have been collected, so the solution is to store them
somewhere until they can more safely be discarded with. I've patched
things up and stored the error and notice handler return values in
Thread.current and voilà, things started working -- no segfaults, no
weird memory errors. The full test suite is now running crash-free on
both Ruby 1.8.7 and 1.9.2, including a new multithreading test using
multiple WkbWriters, byte orders and dimensions and the whole shebang.

(As an aside, the varchars thing was a red herring -- the
documentation on "Missing Features" was a bit confusing and didn't
mean at all what I thought it did...)

Anyways, things are looking quite good now and we're getting closer to
a usable state! Rad!

J!


More information about the geos-devel mailing list