[#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:45:21 UTC
List: ruby-core #1344
Hi,

In message "Re: SEGV in GC under Linux"
    on 03/08/05, Yukihiro Matsumoto <matz@ruby-lang.org> writes:

|Can you try the following patch?
|
|@@ -146,4 +146,10 @@ str_new4(klass, str)

I removed lines too much.  Here's the whole patch.

diff -p -u -1 -r1.171 string.c
--- string.c	30 Jul 2003 07:08:56 -0000	1.171
+++ string.c	5 Aug 2003 03:29:04 -0000
@@ -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