From: matz@... (Yukihiro Matsumoto) Date: 2003-08-05T12:29:15+09:00 Subject: Re: SEGV in GC under Linux Hi, In message "SEGV in GC under Linux" on 03/08/05, Dave Thomas writes: | |A while back I was getting double free()s reported on my MAC box when |running a particular script. If I run the same script on my Linux box |using the latest CVS I now get a SEGV. | |I can try and package up the stuff that's crashing, but it's big and I |don't want to send it to the list. Can you try the following patch? @@ -146,4 +146,10 @@ str_new4(klass, str) RSTRING(str2)->ptr = RSTRING(str)->ptr; - RSTRING(str)->aux.shared = str2; - FL_SET(str, ELTS_SHARED); + if (FL_TEST(str, ELTS_SHARED) && !RSTRING(str)->aux.shared) { + /* ptr should be null_str */ + FL_SET(str2, ELTS_SHARED); + } + else { + FL_SET(str, ELTS_SHARED); + RSTRING(str)->aux.shared = str2; + } OBJ_INFECT(str2, str);