RubySpec #3757: GC bug after loading gem
http://redmine.ruby-lang.org/issues/show/3757

Author: Joel VanderWerf
Status: Open, Priority: Normal

This bug is very general. All you have to do is:

1) require enough of the stdlib
2) require some gem
3) GC.stress=3Dtrue
4) create a few objects

See the attached gcbug.rb.

The bug appears on both x86_64-linux and i686-linux.

It does not happen with ruby-1.9.2, AFAICT.

It does happen with both p302 and p299 of ruby-1.8.7.

The bug is typically reported as one of the following:

gcbug.rb:24: [BUG] Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

gcbug.rb:24: [BUG] rb_gc_mark(): unknown data type 0x18(0x1bbaf00) non ob=
ject
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]


----------------------------------------
http://redmine.ruby-lang.org
IyBGaXJzdCwgcmVxdWlyZSBhIGJ1bmNoIG9mIHN0ZGxpYiBleHRlbnNpb25z
LgpyZXF1aXJlICdyZWFkbGluZScKcmVxdWlyZSAnc29ja2V0JwpyZXF1aXJl
ICdjdXJzZXMnCnJlcXVpcmUgJ3B0eScKcmVxdWlyZSAnb3BlbnNzbCcKcmVx
dWlyZSAnYmlnZGVjaW1hbCcKcmVxdWlyZSAnc2RibScKcmVxdWlyZSAnZmNu
dGwnCnJlcXVpcmUgJ2RsJwpyZXF1aXJlICdzeXNsb2cnCnJlcXVpcmUgJ3Rr
JwpyZXF1aXJlICd6bGliJwoKIyBTZWNvbmQsIHJlcXVpcmUgYSBnZW0uIFRo
ZXJlJ3Mgbm90aGluZyB0b28gc3BlY2lhbCBhYm91dCBqc29uLiBJJ3ZlIGZv
dW5kCiMgb3RoZXJzIHRoYXQgd29yayAoZXZlbiB3aXRob3V0IGhhdmluZyBu
YXRpdmUgY29kZSkuIElmIHlvdSBsb2FkIHRoZSBsaWJyYXJ5CiMgd2l0aG91
dCB1c2luZyBnZW1zICh1c2UgUlVCWUxJQiBpbnN0ZWFkKSwgdGhlbiB0aGUg
YnVnIGRvZXMgbm90IGhhcHBlbi4KcmVxdWlyZSAnanNvbicgCgojIFRoaXMg
aXMgbm90IGVzc2VudGlhbCwgYnV0IGl0IG1ha2VzIHRoZSBidWcgYXBwZWFy
IHNvb25lciBhbmQgbW9yZQojIHJlbGlhYmx5LCB1c2luZyBqdXN0IHRoZSBz
aG9ydCBsb29wIGJlbG93LgpHQy5zdHJlc3MgPSB0cnVlCgojIEJ1ZyBhcHBl
YXJzIGluIHRoZSBsb29wIGJlbG93LiBOb3RlIG5vIGNhbGxzIGludG8gZ2Vt
cyBvciBzdGRsaWIuCjEwLnRpbWVzIGRvCiAgYSA9IFtdCmVuZAo=