Project

General

Profile

Actions

Bug #9167

closed

Segmentation fault in cleanup

Added by BertramScharpf (Bertram Scharpf) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p448 (2013-06-27 revision 41675) [i386-ruby 1.9.3p448 (2013-06-27 revision 41675) [i386-freebsd9]freebsd9]
[ruby-core:58643]

Description

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


Files

dataerr-0.0.gem (6 KB) dataerr-0.0.gem BertramScharpf (Bertram Scharpf), 11/27/2013 09:49 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0