[#1378] differences between Module and Class ? — Mathieu Bouchard <matju@...>

25 messages 2003/08/11
[#1387] Re: differences between Module and Class ? — matz@... (Yukihiro Matsumoto) 2003/08/12

Hi,

[#1442] Re: differences between Module and Class ? — Mathieu Bouchard <matju@...> 2003/08/21

[#1406] _id2ref bug? — Ryan Pavlik <rpav@...>

While debugging some caching code, I've come across a segfault related

22 messages 2003/08/14
[#1407] Re: _id2ref bug? — matz@... (Yukihiro Matsumoto) 2003/08/14

Hi,

[#1413] Re: _id2ref bug? (REPRODUCED, short) — Ryan Pavlik <rpav@...> 2003/08/14

On Fri, 15 Aug 2003 01:57:18 +0900

Re: SEGV in GC under Linux

From: matz@... (Yukihiro Matsumoto)
Date: 2003-08-05 03:29:15 UTC
List: ruby-core #1343
Hi,

In message "SEGV in GC under Linux"
    on 03/08/05, Dave Thomas <dave@pragprog.com> 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);

In This Thread