Segmentation fault in cleanup
I don't know whether it is the interpreters fault or mine.
This is what I do:
- Subclassing StandardError in C
- Encapsulating some data into it using Data_Make_Struct
- Raising this exception
- Not catching it by "rescue"
If I catch it by "rescue", everything is fine. If I don't, the
finalizer crashes with a segmentation fault.
I made a gem out of it containting the full example and a little
bit more description. See the attached file.
This gem contains a build dependency, so you probably prefer to
untar it and compile it on the command line by "cc". This is what
I have to do here:
$ cc -c -DHAVE_HEADER_RUBY_RUBY_H -I/usr/local/include/ruby-1.9 -I/usr/local/include/ruby-1.9/i386-freebsd9 -fPIC -o dataerr.o dataerr.c
$ cc --shared -o dataerr.so dataerr.o
$ ruby -r ./dataerr -e 'begin ; raise_it! ; rescue ; end'
-> Return code 0
$ ruby -r ./dataerr -e 'raise_it!'
-> Segmentation fault