[#5219] Segmentation fault in timeout.rb — Michel Pastor <K@...>

Hi,

18 messages 2005/06/16
[#5220] Re: Segmentation fault in timeout.rb — Eric Hodel <drbrain@...7.net> 2005/06/16

[#5221] Re: Segmentation fault in timeout.rb — Michel Pastor <K@...> 2005/06/16

On Fri, 17 Jun 2005 05:03:18 +0900

[#5223] Re: Segmentation fault in timeout.rb — nobu.nokada@... 2005/06/17

Hi,

[#5296] Subversion — Shugo Maeda <shugo@...>

Hi,

64 messages 2005/06/30
[#5297] Re: Subversion — Curt Hibbs <curt@...> 2005/06/30

Shugo Maeda wrote:

[#5298] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Curt Hibbs wrote:

[#5301] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5304] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Austin Ziegler wrote:

[#5305] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5307] Re: Subversion — mathew <meta@...> 2005/06/30

Austin Ziegler wrote:

[#5308] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, mathew <meta@pobox.com> wrote:

[#5311] Re: Subversion — mathew <meta@...> 2005/07/01

Austin Ziegler wrote:

[#5323] Re: Subversion — Austin Ziegler <halostatue@...> 2005/07/01

On 7/1/05, mathew <meta@pobox.com> wrote:

[#5325] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/07/01

Austin Ziegler wrote:

Re: Segmentation fault in timeout.rb

From: nobuyoshi nakada <nobuyoshi.nakada@...>
Date: 2005-06-21 06:20:20 UTC
List: ruby-core #5261
Hi,

At Tue, 21 Jun 2005 01:11:50 +0900,
nobu.nokada@softhome.net wrote in [ruby-core:05258]:
> The cause was quite simple, GC run during saving thread context
> and thread scheduling occurred.
> 
> #24 0x0806e9c5 in garbage_collect () at gc.c:1196
> #25 0x0806efe4 in ruby_xmalloc (size=69292) at gc.c:119
> #26 0x0805767d in rb_thread_save_context (th=0x872fc38) at eval.c:9920
> #27 0x08067368 in rb_thread_start_0 (fn=0x8067480 <rb_thread_yield>, arg=0xb752a220, th=0x872fc38) at eval.c:11512
> 
> Hmmm, but I wonder how it can be fixed.

I'm feeling it seems too critical to allow GC to run.


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.791
diff -U2 -p -r1.791 eval.c
--- eval.c	20 Jun 2005 09:59:58 -0000	1.791
+++ eval.c	21 Jun 2005 04:51:42 -0000
@@ -10326,5 +10326,7 @@ rb_thread_save_context(th)
     th->stk_pos = pos;
     if (len > th->stk_max) {
-	REALLOC_N(th->stk_ptr, VALUE, len);
+	VALUE *ptr = realloc(th->stk_ptr, sizeof(VALUE) * len);
+	if (!ptr) rb_memerror();
+	th->stk_ptr = ptr;
 	th->stk_max = len;
     }


-- 
Nobu Nakada

In This Thread