Forum: Ruby-dev [Bug #943] Segmentation fault (cygwin)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin Dürst (Guest)
on 2008-12-29 08:53
(Received via mailing list)
Bug #943: Segmentation fault (cygwin)
http://redmine.ruby-lang.org/issues/show/943

$B5/I<<T(B: Martin D$(D+d(Brst
$B%9%F!<%?%9(B: Open, $BM%@hEY(B: Normal

$B<!$N%9%/%j%W%H$,(B Segmentation fault (core dumped)
$B$G=*$o$j$^$9!#(B

ruby -e 'puts "A=["; 0.upto(1000000) { puts "  [22, 55]," }; puts "]"' |
ruby

[ruby-dev:37611] $B$GJs9p$7$?LdBj$r4JC12=$7$^$7$?!#LdBj$O:8B&$N(B ruby
$B$N$G$O$J$/!"(B
$B1&B&$N(B ruby $B$G5/$3$j$^$9!#(B

$B$h$m$7$/$*4j$$$7$^$9!#(B    Martin.
SASADA Koichi (Guest)
on 2008-12-29 09:19
(Received via mailing list)
$B!!$5$5$@$G$9!%(B

Martin Du"rst wrote::
> $B<!$N%9%/%j%W%H$,(B Segmentation fault (core dumped) $B$G=*$o$j$^$9!#(B
>
> ruby -e 'puts "A=["; 0.upto(1000000) { puts "  [22, 55]," }; puts "]"' | ruby
>
> [ruby-dev:37611] $B$GJs9p$7$?LdBj$r4JC12=$7$^$7$?!#LdBj$O:8B&$N(B ruby 
$B$N$G$O$J$/!"(B
> $B1&B&$N(B ruby $B$G5/$3$j$^$9!#(B

$B!!%9%?%C%/%*!<%P!<%U%m!<%A%'%C%/$,B-$j$F$$$^$;$s$G$7$?!%B?J,!$$3$l$GD>$j(B
$B$^$9!%<j85$G$OD>$j$^$7$?!%(B[ruby-dev:37611]
$B$N$[$&$O;n$7$F$$$J$$$N$G$9(B
$B$,!$8+$F$b$i$($^$;$s$+!%(B

Index: vm.c
===================================================================
--- vm.c  ($B%j%S%8%g%s(B 21150)
+++ vm.c  ($B:n6H%3%T!<(B)
@@ -77,6 +77,8 @@ vm_set_top_stack(rb_thread_t * th, VALUE
     vm_push_frame(th, iseq, VM_FRAME_MAGIC_TOP,
       th->top_self, 0, iseq->iseq_encoded,
       th->cfp->sp, 0, iseq->local_size);
+
+        CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
 }

 static void
@@ -95,6 +97,8 @@ vm_set_eval_stack(rb_thread_t * th, VALU
     if (cref) {
   th->cfp->dfp[-1] = (VALUE)cref;
     }
+
+    CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
 }

 static void
@@ -116,6 +120,8 @@ vm_set_main_stack(rb_thread_t *th, VALUE
     if (bind && iseq->local_size > 0) {
   bind->env = vm_make_env_object(th, th->cfp);
     }
+
+    CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
 }

 rb_control_frame_t *
Koichi Sasada (Guest)
on 2008-12-29 09:47
(Received via mailing list)
$B%A%1%C%H(B #943 $B$,99?7$5$l$^$7$?!#(B (by Koichi Sasada)

$B%9%F!<%?%9(B Open$B$+$i(BClosed$B$KJQ99(B
$B?JD=(B % 0$B$+$i(B100$B$KJQ99(B

Applied in changeset r21163.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/943
Martin D. (Guest)
on 2008-12-29 10:08
(Received via mailing list)
$B:{ED$5$s!"$3$s$K$A$O!#(B

At 16:18 08/12/29, SASADA Koichi wrote:
>$B!!%9%?%C%/%*!<%P!<%U%m!<%A%'%C%/$,B-$j$F$$$^$;$s$G$7$?!%B?J,!$$3$l$GD>$j(B
>$B$^$9!%<j85$G$OD>$j$^$7$?!%(B[ruby-dev:37611] $B$N$[$&$O;n$7$F$$$J$$$N$G$9(B
>$B$,!$8+$F$b$i$($^$;$s$+!%(B

$B0J2<$N=$@5$G>e5-$NLdBj$b(B [ruby-dev:37611] $B$bD>$C$F$$$^$9!#(B
$B$H$$$&$N$O!"(BSegmentation fault $B$+$i(B SystemStackError
$B$K(B
$BJQ$o$C$?$@$1$G$9!#$=$NJ}$,$$$$$G$9$N$G!"@'Hs2<5-$N%Q%C%A$r(B
$B%3%_%C%H$7$F$/$@$5$$!#(B

$B$7$+$7!"??$CJ?$i$J%G!<%?$rFI$_9~$`$@$1$G%9%?%C%/$,$3$s$J$K?-$S$k(B
$B$N$O$J$<$G$7$g$&$+!#>e5-$N%9%/%j%W%H$r(B

ruby -e 'puts "A=[]"; 0.upto(1000000) { puts "A<<[22, 55]" }' | ruby

$B$KD>$9$H!";~4V$,$+$+$k$b$N$N!"LdBj$J$/40@.$5$l$^$9!#(B

$B$h$m$7$/$*4j$$$7$^$9!#(B     Martin.

> }
> static void
>
>--
>// SASADA Koichi at atdot dot net


#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp 
mailto:removed_email_address@domain.invalid
SASADA Koichi (Guest)
on 2008-12-29 10:20
(Received via mailing list)
$B!!$5$5$@$G$9!%(B

Martin D. wrote::
> $B$KD>$9$H!";~4V$,$+$+$k$b$N$N!"LdBj$J$/40@.$5$l$^$9!#(B
$B!!(B[e1, e2, ..., eN] $B$H$$$&%j%F%i%k$O!$0lEY(B e1, e2, ..., eN
$B$rA4It%9%?%C(B
$B%/$K@Q$s$G!$%9%?%C%/>e$NCM$rMxMQ$7$FG[Ns$r:n$j$^$9!%$=$N$?$a!$%9%?%C%/(B
$B%*!<%P!<%U%m!<$K$J$j$^$9!%(B

$B!!>e5-Nc$N$h$&$K!$6u$NG[Ns$r:n$C$F!$$=$l$K(B push
$B$9$k$h$&$KJQ99$9$k$3$H$b(B
$B2DG=$G$9$,!$$=$l$r=PMh$k$h$&$K$7$?$[$&$,$$$$$G$9$+$M$'!%$9$k$K$7$F$b!$(B
1.9.2
$B$GL?NaDI2C$C$F$3$H$K$J$k$H;W$$$^$9$,!%$=$&JQ99$7$?$i!$$A$g$C$HB.EY(B
$B$,CY$/$J$k$C$F$/$i$$$+$J$!!%(B
Martin D. (Guest)
on 2008-12-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$$$H;W$$$^$9!#(B

$B$h$m$7$/$*4j$$$7$^$9!#(B     Martin.



#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp 
mailto:removed_email_address@domain.invalid
This topic is locked and can not be replied to.