Forum: Ruby-core [ruby-trunk - Bug #9167][Open] Segmentation fault in cleanup

F5b50e0a300e904985db12fe940577a5?d=identicon&s=25 BertramScharpf (Bertram Scharpf) (Guest)
on 2013-11-27 13:49
(Received via mailing list)
Issue #9167 has been reported by BertramScharpf (Bertram Scharpf).

----------------------------------------
Bug #9167: Segmentation fault in cleanup
https://bugs.ruby-lang.org/issues/9167

Author: BertramScharpf (Bertram Scharpf)
Status: Open
Priority: Normal
Assignee:
Category:
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]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2013-11-30 05:53
(Received via mailing list)
Issue #9167 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Feedback

Fundamentally, subclasses of Exception are not expected other than
T_OBJECT.
And I couldn't reproduce it with the trunk, can't you show your
backtrace?
----------------------------------------
Bug #9167: Segmentation fault in cleanup
https://bugs.ruby-lang.org/issues/9167#change-43278

Author: BertramScharpf (Bertram Scharpf)
Status: Feedback
Priority: Normal
Assignee:
Category:
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]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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
F5b50e0a300e904985db12fe940577a5?d=identicon&s=25 BertramScharpf (Bertram Scharpf) (Guest)
on 2013-12-05 22:39
(Received via mailing list)
Issue #9167 has been updated by BertramScharpf (Bertram Scharpf).


nobu (Nobuyoshi Nakada) wrote:
> Bertram, thank you for reporting this issue.
> Your contribution to Ruby is greatly appreciated.

Thank you for fixing it.
I'll keep my eyes open.

----------------------------------------
Bug #9167: Segmentation fault in cleanup
https://bugs.ruby-lang.org/issues/9167#change-43433

Author: BertramScharpf (Bertram Scharpf)
Status: Closed
Priority: Normal
Assignee:
Category:
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]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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
This topic is locked and can not be replied to.