Solaris $B$G(B timeout.rb $B$,(B Segmentation fault $B$9$k!#(B

e$B$O$8$a$^$7$F!#DG20$H?=$7$^$9!#e(B
e$BIT6q9g$i$7$-$b$N$rH/8+$7$^$7$?$N$G!"8fJs9p$7$^$9!#e(B

[e$B8=>]e(B]
ruby 1.8.6 (2007-09-24 patchlevel 111)
[sparc-solaris2.9]e$B$G4D6-JQ?t$Ne(B
e$B%5%$%:$,>.$5$$;~$Ke(B Net::SMTP e$B$r;H$&$He(B timeout.rb e$B$,e(B
Segmentation fault
e$B$K$J$j$^$9!#e(B
e$B3NG’$7$?HO0O$G$Oe(B solaris e$B$N$_5/$-e(B FreeBSD,Linux
e$B$G$O5/$-$^$;$s!#e(B
e$B$^$?e(B solaris e$B$G$be(B ruby 1.8.4 e$B$G$O5/$-$^$;$s$G$7$?!#e(B

ruby 1.8.4 sparc-solaris2.9 e$B!{e(B
ruby 1.8.5 i486-linux e$B!{e(B
ruby 1.8.6 i386-freebsd6 e$B!{e(B
ruby 1.8.6 sparc-solaris2.9 e$B!_e(B

% env -i TERM=vt100 bin/ruby test.rb
/admins/home/shiiya/lib/ruby/1.8/timeout.rb:52: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [sparc-solaris2.9]

e$BIT;W5D$J;v$K2<5-$NMM$KM-$kDxEY$N4D6-JQ?t$N%5%$%:$,$“$k$H!”@5>o$KF0:n$7e(B
e$B$^$9!#e(B(e$B$J$N$GIaDL$K%3%^%s%I%i%$%s$+$iB9T$9$k$H@5o$KF0:n$7$^$9!#e(B)

% env -i
TERM=vt1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
bin/ruby test.rb

e$B85!9e(B ruby 1.8.4 e$B$Ge(B cron
e$B$r;H$C$F%a!<%kH/Aw$7$F$$$?$N$G$9$,!“e(B1.8.6 e$B$Ke(B
VerUpe$B$7$?$iF0$+$J$/$J$C$?0Y$KH/8+$7$^$7$?!#e(B
e$B%=!<%9$rGA$-$^$7$?$,<j$KIi$($J$$46$8$J$N$G!”?=$7Lu$"$j$^$;$s$,<1<T$NBPe(B
e$B1~$r$*4j$$$G$-$J$$$G$7$g$&$+!#e(B

[e$B%F%9%H%W%m%0%i%`e(B]
#!usr/local/bin/ruby

require ‘net/smtp’
addr = “[email protected]

Net::SMTP.start( ‘localhost’, 25 ) {|smtp|
smtp.send_mail <<EndOfMail, addr, addr
From: #{addr}
To: #{addr}
Subject: test mail

This is test mail.
EndOfMail
}

[backtrace]
#0 0xff2a04f8 in _libc_kill () from /lib/libc.so.1
#1 0xff236d18 in abort () from /lib/libc.so.1
#2 0x0009a25c in rb_bug (fmt=0xb2778 “Segmentation fault”) at
error.c:214
#3 0x00079058 in sigsegv (sig=11) at signal.c:622
#4
#5 0xff3887d4 in seg0 () from
/usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
#6 0xff247174 in realloc () from /lib/libc.so.1
#7 0x0002d890 in rb_thread_save_context (th=0x11e7c8) at eval.c:10234
#8 0x0002fd00 in rb_thread_start_0 (fn=0x30080 <rb_thread_yield>,
arg=0xde168, th=0x182d10) at defines.h:215
#9 0x00031aa0 in call_cfunc (func=0x30230 <rb_thread_start>,
recv=1097592,
len=-2, argc=1584400, argv=0x0) at eval.c:5688
#10 0x00025838 in rb_call0 (klass=1097568, recv=1097592, id=5057,
oid=5057,
argc=0, argv=0x0, body=0x10bed0, flags=0) at eval.c:5847
#11 0x00026360 in rb_call (klass=1097568, recv=1097592, mid=5057,
argc=0,
argv=0x0, scope=0, self=925416) at eval.c:6094
#12 0x000204a8 in rb_eval (self=925416, n=0x0) at ruby.h:679
#13 0x0001f8a0 in rb_eval (self=925416, n=0xe30d0) at eval.c:3203
#14 0x0001fdf4 in rb_eval (self=925416, n=0xe30a0) at eval.c:3658
#15 0x0001fd40 in rb_eval (self=925416, n=0xe33e8) at eval.c:3337
#16 0x00025b68 in rb_call0 (klass=925176, recv=925416, id=11361,
oid=11361,
argc=0, argv=0xffbfbd80, body=0xe33e8, flags=0) at eval.c:5998
#17 0x00026360 in rb_call (klass=925176, recv=925416, mid=11361,
argc=2,
argv=0xffbfbd78, scope=0, self=924024) at eval.c:6094
#18 0x000204a8 in rb_eval (self=924024, n=0x2) at ruby.h:679
#19 0x0002b894 in block_pass (self=924024, node=0xe2a28) at eval.c:8904
#20 0x000210e8 in rb_eval (self=924024, n=0xe2ae8) at eval.c:3189
#21 0x00025b68 in rb_call0 (klass=1116552, recv=924024, id=11361,
oid=11361,
argc=0, argv=0xffbfc81c, body=0xe2ae8, flags=2) at eval.c:5998
#22 0x00026360 in rb_call (klass=1116552, recv=924024, mid=11361,
argc=1,
argv=0xffbfc818, scope=1, self=924024) at eval.c:6094
#23 0x000204a8 in rb_eval (self=924024, n=0xffbfc818) at ruby.h:679
#24 0x0001f8a0 in rb_eval (self=924024, n=0xe9dd8) at eval.c:3203
#25 0x0001fdf4 in rb_eval (self=924024, n=0xe9da8) at eval.c:3658
#26 0x00025b68 in rb_call0 (klass=922920, recv=924024, id=10809,
oid=10809,
argc=0, argv=0xffbfd4d4, body=0xe9da8, flags=0) at eval.c:5998
#27 0x00026360 in rb_call (klass=922920, recv=924024, mid=10809, argc=5,
argv=0xffbfd4c0, scope=0, self=909840) at eval.c:6094
#28 0x000204a8 in rb_eval (self=909840, n=0x5) at ruby.h:679
#29 0x0001feb0 in rb_eval (self=909840, n=0xf70e0) at eval.c:3678
#30 0x0001fd40 in rb_eval (self=909840, n=0xf6618) at eval.c:3337
#31 0x00025b68 in rb_call0 (klass=912360, recv=909840, id=10769,
oid=10769,
argc=0, argv=0xffbfe178, body=0xf6618, flags=2) at eval.c:5998
#32 0x00026360 in rb_call (klass=912360, recv=909840, mid=10769, argc=4,
argv=0xffbfe168, scope=1, self=909840) at eval.c:6094
#33 0x000204a8 in rb_eval (self=909840, n=0xffbfe168) at ruby.h:679
#34 0x0001fd40 in rb_eval (self=909840, n=0xf73e0) at eval.c:3337
#35 0x00025b68 in rb_call0 (klass=912360, recv=909840, id=5057,
oid=5057,
argc=0, argv=0xffbfeac8, body=0xf73e0, flags=0) at eval.c:5998
#36 0x00026360 in rb_call (klass=912360, recv=909840, mid=5057, argc=4,
argv=0xffbfeab8, scope=0, self=912360) at eval.c:6094
#37 0x000204a8 in rb_eval (self=912360, n=0x4) at ruby.h:679
#38 0x0002b894 in block_pass (self=912360, node=0xf81a8) at eval.c:8904
#39 0x000210e8 in rb_eval (self=912360, n=0xf8328) at eval.c:3189
#40 0x00025b68 in rb_call0 (klass=912288, recv=912360, id=5057,
oid=5057,
argc=0, argv=0xffbff578, body=0xf8328, flags=0) at eval.c:5998
#41 0x00026360 in rb_call (klass=912288, recv=912360, mid=5057, argc=2,
argv=0xffbff570, scope=0, self=1110552) at eval.c:6094
#42 0x000204a8 in rb_eval (self=1110552, n=0x2) at ruby.h:679
#43 0x0001f8a0 in rb_eval (self=1110552, n=0xffbff940) at eval.c:3203
#44 0x0001c2d0 in ruby_exec_internal () at eval.c:1634
#45 0x0001c31c in ruby_exec () at eval.c:1654
#46 0x0001c34c in ruby_run () at eval.c:1664
#47 0x0001a1dc in main (argc=2, argv=0xffbfff2c, envp=0xffbfff38) at
main.c:48

e$B$J$+$@$G$9!#e(B

At Wed, 6 Feb 2008 13:19:57 +0900,
[email protected] wrote in [ruby-dev:33611]:

[e$B8=>]e(B]
ruby 1.8.6 (2007-09-24 patchlevel 111) [sparc-solaris2.9]e$B$G4D6-JQ?t$Ne(B
e$B%5%$%:$,>.$5$$;~$Ke(B Net::SMTP e$B$r;H$&$He(B timeout.rb e$B$,e(B Segmentation fault
e$B$K$J$j$^$9!#e(B

e$B$b$7$+$7$F!"e(Bruby.ce$B$Ne(B #define USE_ENVSPACE_FOR_ARG0
e$B$r%3%a%s%H%"e(B
e$B%&%H$9$k$H5/$-$J$/$J$j$^$9$+e(B?

e$B$J$+$@$G$9!#e(B

At Wed, 6 Feb 2008 14:56:41 +0900,
shiiya yoshitaka wrote in [ruby-dev:33613]:

USE_ENVSPACE_FOR_ARG0 e$B$r%3%a%s%H%"%&%H$7$F:F%3%s%Q%$%k$7!"<B9T$7$^$7$?e(B
e$B$,7k2L$OJQ$o$j$^$;$s$G$7$?!#e(B

e$B$d$O$je(BGCe$B4X78$G$7$g$&$M!#$H$J$k$H<B:]$N4D6-$,$J$$$H$A$g$C$HLLE]$Ge(B
e$B$9$M!#$A$J$_$K!“e(Benvspace.begine$B$+$ie(Benvspace.ende$B$NNN0h$O$*$=$i$/2ue(B
e$B$l$F$$$k$H;W$$$^$9$,!”$I$s$J%G!<%?$K$J$C$F$$$k$G$7$g$&$+!#$=$l$H!"e(B
1.8e$B$N:G?7$G$b5/$-$k$+$O3NG’$G$-$k$G$7$g$&$+!#$^$?!"e(BNet::SMTPe$B$r;He(B
e$B$o$J$$$+$.$j5/$-$J$$$N$G$7$g$&$+!#e(B

e$BDG20$G$9!#H?1~$"$j$,$H$&$4$6$$$^$9!#e(B

From: Nobuyoshi N. [email protected]

e$B%&%H$9$k$H5/$-$J$/$J$j$^$9$+e(B?
USE_ENVSPACE_FOR_ARG0
e$B$r%3%a%s%H%“%&%H$7$F:F%3%s%Q%$%k$7!”<B9T$7$^$7$?e(B
e$B$,7k2L$OJQ$o$j$^$;$s$G$7$?!#e(B

% ls -l bin/ruby*
-rwxr-xr-x 1 shiiya admin 2295540 2e$B7ne(B 6e$BF|e(B 14:40
bin/ruby
-rwxr-xr-x 1 shiiya admin 2296236 2e$B7ne(B 5e$BF|e(B 17:37
bin/ruby.old

% env -i TERM=vt100 bin/ruby test.rb
/admins/home/shiiya/lib/ruby/1.8/timeout.rb:52: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [sparc-solaris2.9]

In article [email protected],
SATOH Fumiyasu [email protected] writes:

e$B%9%?%C%/%H%l!<%9$r$H$C$F$_$^$7$?$,!"$3$l$G$o$+$j$^$9$+e(B?

---- e$B%7%0%J%k%O%s%I%i$+$i%7%0%J%ke(B 11 (SIGSEGV) e$B$G8F$S=P$5$l$^$7$?e(B ------
[7] _memcpy(0x18aec0, 0xffbfffe0, 0xa4, 0x0, 0x4, 0xfffffff8), e$B0LCVe(B: 0xff150e38
[8] rb_thread_save_context(th = 0x1237c8), e$B9Te(B 10234 “eval.c”

1.8.6-p111 e$B$Ne(B 10234e$B9T$O0J2<$J$N$G!"%9%?%C%/$NNN0h$NH=CG$,4Ve(B
e$B0c$C$F$k5$$,$C$F$$$k5$$,$7$^$9!#e(B
MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len);

e$B$H$3$m$G!"e(BSolaris/x86 e$B$G$NLdBj$KBP=h$9$k$?$a$KG/Kv$K0J2<$N$he(B
e$B$&$J%Q%C%A$rF~$l$?$N$G$9$,!"e(B1.8 e$B$N@hC<$@$H$I$&$G$7$g$&e(B?

Mon Dec 17 13:43:15 2007 Tanaka A. [email protected]

    * gc.c (stack_end_address): use local variable address instead 

of
__builtin_frame_address(0) to avoid SEGV on SunOS 5.11 on x86
with
gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802).
stack_end_address returned a frame address of garbage_collect
since stack_end_address doesn’t create its own frame.
So a VALUE stored in a callee saved register, %edi, pushed
into
the stack at the beginning of garbage_collect was not marked.

SPARC e$B$8$c$J$/$Fe(B x86 e$B$G$9$7!">I>u$bHyL/$K0c$&5$$,$7$^$9$,!#e(B

e$B>I>u$,JQ$o$i$J$+$C$?$i!“<!$K2x$7$$$N$Oe(B gc.c e$B$K$”$k!"e(BSPARC
e$B$Ge(B
0x80 e$B$r2C$($k<!$N2x$7$2$J%3!<%I$G$9$+$M$'!#e(B

#if defined(sparc) || defined(sparc)

define STACK_LENGTH (rb_gc_stack_start - STACK_END + 0x80)

e$B$5$H$&$U$_$d$9e(B @ OSS e$B%F%/%N%m%8$G$9!#e(B

At Fri, 8 Feb 2008 11:30:53 +0900,
Nobuyoshi N. wrote:

e$B$d$O$je(BGCe$B4X78$G$7$g$&$M!#$H$J$k$H<B:]$N4D6-$,$J$$$H$A$g$C$HLLE]$Ge(B
e$B$9$M!#$A$J$_$K!“e(Benvspace.begine$B$+$ie(Benvspace.ende$B$NNN0h$O$*$=$i$/2ue(B
e$B$l$F$$$k$H;W$$$^$9$,!”$I$s$J%G!<%?$K$J$C$F$$$k$G$7$g$&$+!#$=$l$H!"e(B
1.8e$B$N:G?7$G$b5/$-$k$+$O3NG’$G$-$k$G$7$g$&$+!#$^$?!"e(BNet::SMTPe$B$r;He(B
e$B$o$J$$$+$.$j5/$-$J$$$N$G$7$g$&$+!#e(B

Solaris 10 (SPARC) e$B$He(B
ruby 1.8.6 (2007-09-24 patchlevel 111) [sparc-solaris2.10]
ruby 1.8.6 (2008-02-05 patchlevel 5000) [sparc-solaris2.10]
e$B$G$b:F8=$7$^$7$?!#e(B

e$B%9%?%C%/%H%l!<%9$r$H$C$F$_$^$7$?$,!"$3$l$G$o$+$j$^$9$+e(B?

$ gzip -d <ruby-1.8.6-p111.tar.gz |tar xf -
$ cd ruby-1.8.6-p111
$ ./configure && make

$ env -i RUBYLIB=lib:.ext/sparc-solaris2.10 ./ruby /path/to/test.rb
./lib/timeout.rb:52: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [sparc-solaris2.10]

e$B0[>o=*N;e(B (core dumped)
$ /opt/SUNWspro/bin/dbx ./ruby core

(dbx) where
[1] __lwp_kill(0x0, 0x6, 0x0, 0x6, 0xfc00, 0x0), e$B0LCVe(B:
0xff241adc
[2] raise(0x6, 0x0, 0x0, 0xff224d94, 0xffffffff, 0x6), e$B0LCVe(B:
0xff1e0040
[3] abort(0x2e, 0x1, 0xcab6c, 0xaa1a0, 0xff26d2d8, 0x0), e$B0LCVe(B:
0xff1c0218
=>[4] rb_bug(fmt = 0xb7580 “Segmentation fault”, …), e$B9Te(B 214
“error.c”
[5] sigsegv(sig = 11), e$B9Te(B 622 “signal.c”
[6] __sighndlr(0xb, 0x0, 0xffbfa558, 0x7dab0, 0x0, 0x1), e$B0LCVe(B:
0xff240a14
---- e$B%7%0%J%k%O%s%I%i$+$i%7%0%J%ke(B 11 (SIGSEGV)
e$B$G8F$S=P$5$l$^$7$?e(B ------
[7] _memcpy(0x18aec0, 0xffbfffe0, 0xa4, 0x0, 0x4, 0xfffffff8),
e$B0LCVe(B: 0xff150e38
[8] rb_thread_save_context(th = 0x1237c8), e$B9Te(B 10234 “eval.c”
[9] rb_thread_start_0(fn = 0x30c1c =
&rubyeval.c`rb_thread_yield(register VALUE arg, register rb_thread_t
th), arg = 0xe5008, th = 0x1854d0), e$B9Te(B 215 “defines.h”
[10] rb_call0(klass = 1118040U, recv = 1118064U, id = 5057U, oid =
5057U, argc = 0, argv = (nil), body = 0x110ec8, flags = 0), e$B9Te(B
5696 “eval.c”
[11] rb_call(klass = 1118040U, recv = 1118064U, mid = 5057U, argc = 0,
argv = (nil), scope = 0, self = 947112U), e$B9Te(B 6094 “eval.c”
[12] rb_eval(self = 947112U, n = (nil)), e$B9Te(B 679 “ruby.h”
[13] rb_eval(self = 947112U, n = 0xe8590), e$B9Te(B 3203 “eval.c”
[14] rb_eval(self = 947112U, n = 0xe8560), e$B9Te(B 3658 “eval.c”
[15] rb_eval(self = 947112U, n = 0xe88a8), e$B9Te(B 3337 “eval.c”
[16] rb_call0(klass = 946872U, recv = 947112U, id = 11337U, oid =
11337U, argc = 0, argv = 0xffbfbbf8, body = 0xe88a8, flags = 953088),
e$B9Te(B 5998 “eval.c”
[17] rb_call(klass = 946872U, recv = 947112U, mid = 11337U, argc = 2,
argv = 0xffbfbbf0, scope = 0, self = 945720U), e$B9Te(B 6094 “eval.c”
[18] rb_eval(self = 945720U, n = 0x2), e$B9Te(B 679 “ruby.h”
[19] block_pass(self = 945720U, node = 0xe7ee8), e$B9Te(B 8904
“eval.c”
[20] rb_eval(self = 945720U, n = 0xe7fa8), e$B9Te(B 3189 “eval.c”
[21] rb_call0(klass = 1137024U, recv = 945720U, id = 11337U, oid =
11337U, argc = 0, argv = 0xffbfc6e4, body = 0xe7fa8, flags = 950232),
e$B9Te(B 5998 “eval.c”
[22] rb_call(klass = 1137024U, recv = 945720U, mid = 11337U, argc = 1,
argv = 0xffbfc6e0, scope = 1, self = 945720U), e$B9Te(B 6094 “eval.c”
[23] rb_eval(self = 945720U, n = 0xffbfc6e0), e$B9Te(B 679 “ruby.h”
[24] rb_eval(self = 945720U, n = 0xef1d8), e$B9Te(B 3203 “eval.c”
[25] rb_eval(self = 945720U, n = 0xef1a8), e$B9Te(B 3658 “eval.c”
[26] rb_call0(klass = 944616U, recv = 945720U, id = 10777U, oid =
10777U, argc = 0, argv = 0xffbfd3ec, body = 0xef1a8, flags = 980112),
e$B9Te(B 5998 “eval.c”
[27] rb_call(klass = 944616U, recv = 945720U, mid = 10777U, argc = 5,
argv = 0xffbfd3d8, scope = 0, self = 938160U), e$B9Te(B 6094 “eval.c”
[28] rb_eval(self = 938160U, n = 0x5), e$B9Te(B 679 “ruby.h”
[29] rb_eval(self = 938160U, n = 0xfc4b0), e$B9Te(B 3678 “eval.c”
[30] rb_eval(self = 938160U, n = 0xfb9e8), e$B9Te(B 3337 “eval.c”
[31] rb_call0(klass = 940440U, recv = 938160U, id = 10737U, oid =
10737U, argc = 0, argv = 0xffbfe0e0, body = 0xfb9e8, flags = 1033968),
e$B9Te(B 5998 “eval.c”
[32] rb_call(klass = 940440U, recv = 938160U, mid = 10737U, argc = 4,
argv = 0xffbfe0d0, scope = 1, self = 938160U), e$B9Te(B 6094 “eval.c”
[33] rb_eval(self = 938160U, n = 0xffbfe0d0), e$B9Te(B 679 “ruby.h”
[34] rb_eval(self = 938160U, n = 0xfc7b0), e$B9Te(B 3337 “eval.c”
[35] rb_call0(klass = 940440U, recv = 938160U, id = 5057U, oid =
5057U, argc = 0, argv = 0xffbfea80, body = 0xfc7b0, flags = 1035504),
e$B9Te(B 5998 “eval.c”
[36] rb_call(klass = 940440U, recv = 938160U, mid = 5057U, argc = 4,
argv = 0xffbfea70, scope = 0, self = 940440U), e$B9Te(B 6094 “eval.c”
[37] rb_eval(self = 940440U, n = 0x4), e$B9Te(B 679 “ruby.h”
[38] block_pass(self = 940440U, node = 0xfd578), e$B9Te(B 8904
“eval.c”
[39] rb_eval(self = 940440U, n = 0xfd6f8), e$B9Te(B 3189 “eval.c”
[40] rb_call0(klass = 940368U, recv = 940440U, id = 5057U, oid =
5057U, argc = 0, argv = 0xffbff580, body = 0xfd6f8, flags = 1038120),
e$B9Te(B 5998 “eval.c”
[41] rb_call(klass = 940368U, recv = 940440U, mid = 5057U, argc = 2,
argv = 0xffbff578, scope = 0, self = 1131024U), e$B9Te(B 6094 “eval.c”
[42] rb_eval(self = 1131024U, n = 0x2), e$B9Te(B 679 “ruby.h”
[43] rb_eval(self = 1131024U, n = 0xffbff948), e$B9Te(B 3203 “eval.c”
[44] ruby_exec_internal(), e$B9Te(B 1634 “eval.c”
[45] ruby_exec(), e$B9Te(B 1654 “eval.c”
[46] ruby_run(), e$B9Te(B 1664 “eval.c”
[47] main(argc = 2, argv = 0xffbfff34, envp = 0xffbfff40), e$B9Te(B 48
“main.c”

dbx e$B$Oe(B gdb e$B0J>e$K;H$$47$l$F$J$$$N$G!"e(B

e$B$3$l0J>e$N>pJs$r$I$&$d$C$F<h$C$?$i$$$$$N$+$OCN$i$J$$e(B :-X

At Fri, 8 Feb 2008 14:00:35 +0900,
Tanaka A. wrote:

e$B$H$3$m$G!"e(BSolaris/x86 e$B$G$NLdBj$KBP=h$9$k$?$a$KG/Kv$K0J2<$N$he(B
e$B$&$J%Q%C%A$rF~$l$?$N$G$9$,!"e(B1.8 e$B$N@hC<$@$H$I$&$G$7$g$&e(B?

Download Ruby e$B$K$“$ke(B
Stalbe Snapshot (stable-snapshot.tar.gz) e$B$C$F!”%@%&%s%m!<%Ie(B
e$B$7$?F|$Ne(BCSV e$B%9%J%C%W%7%g%C%HHG$8$c$J$$$s$G$7$g$&$+e(B?

$ ./ruby --version
ruby 1.8.6 (2008-02-05 patchlevel 5000) [sparc-solaris2.10]

e$B@h$N%a!<%k$NDL$j!"$3$l$G$b:F8=$7$^$9!#%9%?%C%/$O0J2<e(B:

(dbx) where
[1] __lwp_kill(0x0, 0x6, 0x0, 0x6, 0xfc00, 0x0), e$B0LCVe(B:
0xff241adc
[2] raise(0x6, 0x0, 0x0, 0xff224d94, 0xffffffff, 0x6), e$B0LCVe(B:
0xff1e0040
[3] abort(0x2e, 0x1, 0xcaf04, 0xaa1a0, 0xff26d2d8, 0x0), e$B0LCVe(B:
0xff1c0218
=>[4] rb_bug(fmt = 0xb78c8 “Segmentation fault”, …), e$B9Te(B 214
“error.c”
[5] sigsegv(sig = 11), e$B9Te(B 625 “signal.c”
[6] __sighndlr(0xb, 0x0, 0xffbfa558, 0x7d600, 0x0, 0x1), e$B0LCVe(B:
0xff240a14
---- e$B%7%0%J%k%O%s%I%i$+$i%7%0%J%ke(B 11 (SIGSEGV)
e$B$G8F$S=P$5$l$^$7$?e(B ------
[7] _memcpy(0x18b2c0, 0xffbfffc8, 0xbc, 0x0, 0x4, 0xfffffff8),
e$B0LCVe(B: 0xff150e50
[8] rb_thread_save_context(th = 0x123b20), e$B9Te(B 10243 “eval.c”
[9] rb_thread_start_0(fn = 0x30bac =
&rubyeval.c`rb_thread_yield(register VALUE arg, register rb_thread_t
th), arg = 0xe5080, th = 0x1858e8), e$B9Te(B 218 “defines.h”
[10] rb_call0(klass = 1118808U, recv = 1118832U, id = 5073U, oid =
5073U, argc = 0, argv = (nil), body = 0x1111c8, flags = 0), e$B9Te(B
5707 “eval.c”
[11] rb_call(klass = 1118808U, recv = 1118832U, mid = 5073U, argc = 0,
argv = (nil), scope = 0, self = 947232U), e$B9Te(B 6105 “eval.c”
[12] rb_eval(self = 947232U, n = (nil)), e$B9Te(B 690 “ruby.h”
[13] rb_eval(self = 947232U, n = 0xe8608), e$B9Te(B 3213 “eval.c”
[14] rb_eval(self = 947232U, n = 0xe85d8), e$B9Te(B 3668 “eval.c”
[15] rb_eval(self = 947232U, n = 0xe8920), e$B9Te(B 3347 “eval.c”
[16] rb_call0(klass = 946992U, recv = 947232U, id = 11401U, oid =
11401U, argc = 0, argv = 0xffbfbbf8, body = 0xe8920, flags = 953208),
e$B9Te(B 6009 “eval.c”
[17] rb_call(klass = 946992U, recv = 947232U, mid = 11401U, argc = 2,
argv = 0xffbfbbf0, scope = 0, self = 945840U), e$B9Te(B 6105 “eval.c”
[18] rb_eval(self = 945840U, n = 0x2), e$B9Te(B 690 “ruby.h”
[19] block_pass(self = 945840U, node = 0xe7f60), e$B9Te(B 8916
“eval.c”
[20] rb_eval(self = 945840U, n = 0xe8020), e$B9Te(B 3199 “eval.c”
[21] rb_call0(klass = 1137888U, recv = 945840U, id = 11401U, oid =
11401U, argc = 0, argv = 0xffbfc6e4, body = 0xe8020, flags = 950352),
e$B9Te(B 6009 “eval.c”
[22] rb_call(klass = 1137888U, recv = 945840U, mid = 11401U, argc = 1,
argv = 0xffbfc6e0, scope = 1, self = 945840U), e$B9Te(B 6105 “eval.c”
[23] rb_eval(self = 945840U, n = 0xffbfc6e0), e$B9Te(B 690 “ruby.h”
[24] rb_eval(self = 945840U, n = 0xef250), e$B9Te(B 3213 “eval.c”
[25] rb_eval(self = 945840U, n = 0xef220), e$B9Te(B 3668 “eval.c”
[26] rb_call0(klass = 944736U, recv = 945840U, id = 10833U, oid =
10833U, argc = 0, argv = 0xffbfd3ec, body = 0xef220, flags = 980232),
e$B9Te(B 6009 “eval.c”
[27] rb_call(klass = 944736U, recv = 945840U, mid = 10833U, argc = 5,
argv = 0xffbfd3d8, scope = 0, self = 938280U), e$B9Te(B 6105 “eval.c”
[28] rb_eval(self = 938280U, n = 0x5), e$B9Te(B 690 “ruby.h”
[29] rb_eval(self = 938280U, n = 0xfc600), e$B9Te(B 3688 “eval.c”
[30] rb_eval(self = 938280U, n = 0xfbb38), e$B9Te(B 3347 “eval.c”
[31] rb_call0(klass = 940560U, recv = 938280U, id = 10793U, oid =
10793U, argc = 0, argv = 0xffbfe0e0, body = 0xfbb38, flags = 1034304),
e$B9Te(B 6009 “eval.c”
[32] rb_call(klass = 940560U, recv = 938280U, mid = 10793U, argc = 4,
argv = 0xffbfe0d0, scope = 1, self = 938280U), e$B9Te(B 6105 “eval.c”
[33] rb_eval(self = 938280U, n = 0xffbfe0d0), e$B9Te(B 690 “ruby.h”
[34] rb_eval(self = 938280U, n = 0xfc900), e$B9Te(B 3347 “eval.c”
[35] rb_call0(klass = 940560U, recv = 938280U, id = 5073U, oid =
5073U, argc = 0, argv = 0xffbfea80, body = 0xfc900, flags = 1035840),
e$B9Te(B 6009 “eval.c”
[36] rb_call(klass = 940560U, recv = 938280U, mid = 5073U, argc = 4,
argv = 0xffbfea70, scope = 0, self = 940560U), e$B9Te(B 6105 “eval.c”
[37] rb_eval(self = 940560U, n = 0x4), e$B9Te(B 690 “ruby.h”
[38] block_pass(self = 940560U, node = 0xfd6c8), e$B9Te(B 8916
“eval.c”
[39] rb_eval(self = 940560U, n = 0xfd848), e$B9Te(B 3199 “eval.c”
[40] rb_call0(klass = 940488U, recv = 940560U, id = 5073U, oid =
5073U, argc = 0, argv = 0xffbff580, body = 0xfd848, flags = 1038456),
e$B9Te(B 6009 “eval.c”
[41] rb_call(klass = 940488U, recv = 940560U, mid = 5073U, argc = 2,
argv = 0xffbff578, scope = 0, self = 1131888U), e$B9Te(B 6105 “eval.c”
[42] rb_eval(self = 1131888U, n = 0x2), e$B9Te(B 690 “ruby.h”
[43] rb_eval(self = 1131888U, n = 0xffbff948), e$B9Te(B 3213 “eval.c”
[44] ruby_exec_internal(), e$B9Te(B 1641 “eval.c”
[45] ruby_exec(), e$B9Te(B 1661 “eval.c”
[46] ruby_run(), e$B9Te(B 1671 “eval.c”
[47] main(argc = 2, argv = 0xffbfff34, envp = 0xffbfff40), e$B9Te(B 48
“main.c”

e$BLrN)$D$+$o$+$j$^$;$s$,!"%9%?%C%/%U%l!<%`e(B 8 e$B;~E@$Ne(B th
e$B$NFbMF$Oe(B
e$B0J2<$H$J$C$F$$$^$7$?!#e(B

(dbx) frame 8
10243 MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len);
(dbx) print *th
*th = {
next = 0x123b20
prev = 0x123b20
context = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
result = 0
stk_len = 5681
stk_max = 5681
stk_ptr = 0x185b38
stk_pos = 0xffbfa7f8
frame = (nil)
scope = (nil)
dyna_vars = (nil)
block = (nil)
iter = (nil)
tag = (nil)
klass = 0
wrapper = 0
cref = (nil)
flags = 0
node = (nil)
tracing = 0
errinfo = 4U
last_status = 0
last_line = 0
last_match = 4U
safe = 0
status = THREAD_RUNNABLE
wait_for = 0
fd = 0
readfds = {
fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}
writefds = {
fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}
exceptfds = {
fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}
select_value = 0
delay = 0.0
join = (nil)
abort = 0
priority = 0
thgroup = 1116264U
locals = (nil)
thread = 1116240U
sandbox = 4U
}
(dbx)

Nightly Snapshot (snapshot.tar.gz) e$B$G$O:F8=$7$^$;$s$G$7$?!#e(B

$ ./ruby --version
ruby 1.9.0 (2008-02-08 revision 0) [sparc-solaris2.10]
$ env -i RUBYLIB=lib:.ext/sparc-solaris2.10 ./ruby test.rb
$ echo $?
0

In article [email protected],
SATOH Fumiyasu [email protected] writes:

$ ./ruby --version
ruby 1.8.6 (2008-02-05 patchlevel 5000) [sparc-solaris2.10]

e$B@h$N%a!<%k$NDL$j!"$3$l$G$b:F8=$7$^$9!#%9%?%C%/$O0J2<e(B:

e$B<:Ni$7$^$7$?!#%9%J%C%W%7%g%C%H$b;n$7$?$H$$$&OC$rFI$_F($7$F$^$7$?!#e(B

---- e$B%7%0%J%k%O%s%I%i$+$i%7%0%J%ke(B 11 (SIGSEGV) e$B$G8F$S=P$5$l$^$7$?e(B ------
[7] _memcpy(0x18b2c0, 0xffbfffc8, 0xbc, 0x0, 0x4, 0xfffffff8), e$B0LCVe(B: 0xff150e50
[8] rb_thread_save_context(th = 0x123b20), e$B9Te(B 10243 “eval.c”

MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len);
stk_len      = 5681
stk_max      = 5681
stk_ptr      = 0x185b38
stk_pos      = 0xffbfa7f8

0xffbfa7f8 e$B$+$ie(B 0x185b38 e$B$Xe(B 5681*4
e$B%P%$%H%3%T!<!"$GMn$A$F$$e(B
e$B$k$h$&$K8+$($^$9!#e(B

e$B7o$Ne(B 0x80 e$B$re(B 0
e$B$K$9$k$N$O$I$&$G$9$+$M$'!#8z$+$J$$5$$b$7$^$9e(B
e$B$,!#e(B

e$BDG20$G$9!#e(B

From: Nobuyoshi N. [email protected]

e$B$J$+$@$G$9!#e(B

e$B$d$O$je(BGCe$B4X78$G$7$g$&$M!#$H$J$k$H<B:]$N4D6-$,$J$$$H$A$g$C$HLLE]$Ge(B
e$B$9$M!#$A$J$_$K!“e(Benvspace.begine$B$+$ie(Benvspace.ende$B$NNN0h$O$*$=$i$/2ue(B
e$B$l$F$$$k$H;W$$$^$9$,!”$I$s$J%G!<%?$K$J$C$F$$$k$G$7$g$&$+!#$=$l$H!"e(B
1.8e$B$N:G?7$G$b5/$-$k$+$O3NG’$G$-$k$G$7$g$&$+!#$^$?!"e(BNet::SMTPe$B$r;He(B
e$B$o$J$$$+$.$j5/$-$J$$$N$G$7$g$&$+!#e(B

e$B!&e(B envspace.begin end e$B$Oe(B
(gdb) p envspace
$5 = {begin = 0xffbfffca “TERM=vt100”, end = 0xffbfffd4 “”}
e$B$GFC$K2u$l$F$$$k$h$&$K$O8+$($^$;$s!#e(B

e$B!&0BDjHG%9%J%C%W%7%g%C%He(B(2008/02/08
04:02:33)e$B$r;}$C$F$-$F;n$7$^$7$?$,e(B
e$B7k2L$OF1$8$G$7$?!#e(B
ruby 1.8.6 (2008-02-05 patchlevel 5000) [sparc-solaris2.9]

% env -i TERM=vt100 bin/ruby ~/test.rb
/admins/home/adm-shii/lib/ruby/1.8/timeout.rb:52: [BUG] Segmentation
fault
ruby 1.8.6 (2008-02-05) [sparc-solaris2.9]

e$B!t:G=i4V0c$($F:G?7HG%9%J%C%W%7%g%C%He(B(1.9.0)e$B$r;}$C$FMh$F$7$^$$$^$7$?$,!"e(B
e$B!t$=$A$i$G$O$3$NLdBj$O5/$-$^$;$s$G$7$?!#e(B

e$B!&e(Bcron e$B$GF0$+$7$F$$$k$N$O!“%a!<%kH/Aw$He(B DBe$B99?7$Ne(B
2e$BK$@$1$J$N$G$9$,!“e(B
DBe$B$N99?7e(B(dbi::Pg,LDAP)e$B$NJ}$OLdBj$J$/F0$$$F$$$^$9!#e(B
e$B$^$?K\BN$Ne(B WEBe$B%”%W%j%1!<%7%g%s$K$bLdBj$”$j$^$;$s!#e(B
(e$B%9%l%C%I$r;H$C$FL5$$$+$i$@$H;W$$$^$9$,!#e(B)

e$B$H$_$?$G$9!#e(B

e$B$&$A$N2q<R$N4D6-$G$bH/@8$7$?$N$G!"D4$Y$F$_$^$7$?!#e(B

e$B<!$N$h$&$J4JC1$J%5%s%W%k$G:F8=$7$^$9!#e(B

$ env -i ./ruby -e ‘Thread.new{}’

SPARC Solaris 10 e$B$G;n$7$?$N$G$9$,!"e(BRuby 1.8.1e$B!Ae(B1.8.6
e$B$N$9$Y$F$N%P!<%8%ge(B
e$B%s$GH/@8$7$^$9!#e(B

e$B%7%9%F%`%3!<%k%H%l!<%9$r<h$k$H!"e(B

setitimer(ITIMER_VIRTUAL, 0xFFBFEF98, 0x00000000) = 0
Incurred fault #6, FLTBOUNDS %pc = 0xFF150E50
siginfo: SIGSEGV SEGV_MAPERR addr=0xFFC00000
Received signal #11, SIGSEGV [caught]
siginfo: SIGSEGV SEGV_MAPERR addr=0xFFC00000

e$B$G!"e(Bapptrace e$B$O!"e(B

→ ruby → libc.so.1:setitimer(0x1, 0xffbfef40, 0x0) ** NR
→ ruby → libc.so.1:void * realloc(void * = 0x0, size_t = 0x11ac)
← ruby → libc.so.1:realloc() = 0x1476e8
→ ruby → libc_psr.so.1:memcpy(0x1476e8, 0xffbfeed0, 0x11ac) ** NR

e$B$J$N$G!"%9%?%C%/$N2<8Be(B(e$B>e8Be(B?)e$B$Ne(B 0xFFC00000
e$B$rD6$($F%a%b%j$+$i%G!<%?$rFIe(B
e$B$_9~$b$&$H$7$F$$$k$N$,860x$@$H;W$$$^$9!#e(B

On Fri, 8 Feb 2008 15:22:03 +0900
Tanaka A. [email protected] wrote:

e$B7o$Ne(B 0x80 e$B$re(B 0 e$B$K$9$k$N$O$I$&$G$9$+$M$'!#8z$+$J$$5$$b$7$^$9e(B
e$B$,!#e(B

On Fri, 8 Feb 2008 14:00:35 +0900
Tanaka A. [email protected] wrote:

e$B>I>u$,JQ$o$i$J$+$C$?$i!“<!$K2x$7$$$N$Oe(B gc.c e$B$K$”$k!"e(BSPARC e$B$Ge(B
0x80 e$B$r2C$($k<!$N2x$7$2$J%3!<%I$G$9$+$M$'!#e(B

#if defined(sparc) || defined(sparc)

define STACK_LENGTH (rb_gc_stack_start - STACK_END + 0x80)

e$B8z$-$^$7$?!#Mn$A$J$/$J$j$^$7$?!#e(B

e$B2?$J$s$G$7$g$&$M!"$3$N%3!<%I!D!#e(B

In article [email protected],
e$B$H$_$?$^$5$R$me(B [email protected] writes:

e$B>I>u$,JQ$o$i$J$+$C$?$i!“<!$K2x$7$$$N$Oe(B gc.c e$B$K$”$k!"e(BSPARC e$B$Ge(B
0x80 e$B$r2C$($k<!$N2x$7$2$J%3!<%I$G$9$+$M$'!#e(B

#if defined(sparc) || defined(sparc)

define STACK_LENGTH (rb_gc_stack_start - STACK_END + 0x80)

e$B8z$-$^$7$?!#Mn$A$J$/$J$j$^$7$?!#e(B

e$B$=$l$J$i>C$7$H$-$^$7$g$&$+$M!#e(B

e$B2?$J$s$G$7$g$&$M!"$3$N%3!<%I!D!#e(B

e$BA[A|$G$-$J$/$b$"$j$^$;$s$,!#e(B

e$B$*$=$i$/!“%9%?%C%/@hC<$N%”%I%l%9$,$&$^$/<h$l$J$/$FF0$+$J$+$Ce(B
e$B$?$N$r!"860x$r=<J,$K9M;!$9$k$3$H$b$J$/MpK=$KD>$7$?$N$G$7$g$&!#e(B

In article [email protected],
Tanaka A. [email protected] writes:

e$B2?$J$s$G$7$g$&$M!"$3$N%3!<%I!D!#e(B

e$BA[A|$G$-$J$/$b$"$j$^$;$s$,!#e(B

e$B$D$$C5$7$?$i8+$D$1$F$7$^$C$?$N$G=q$$$F$*$-$^$9$,!"e(B
[ruby-dev:15100] e$B$KE:IU$5$l$F$k%Q%C%A$Ke(B 0x80
e$B$,F~$C$F$^$9$M!#e(B

e$B$@$+$i!"?R$M$k$H$7$?$ie(B sheepman e$B$5$s$+$J!#e(B

In article [email protected],
sheepman [email protected] writes:

e$BEv;~$Ne(B eval.c e$B$K$"$C$?e(B stack_length e$B4X?t$r$=$N$^$^%3%T!<$7$?$b$N$G$9!#e(B

e$B$*$)!"$=$s$J$H$3$m$K!#<:Ni$7$^$7$?!#e(B

eval.c e$B$r$5$i$K$?$I$C$F$_$k$He(B… e$B$($'$H!“:G=i$+$ie(B (rev 2
e$B$+e(B
e$B$ie(B) e$B$”$j$^$9$M!#$J$N$G!"$^$D$b$H$5$s$+$J!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:33870] Re: Solaris e$B$Ge(B timeout.rb
e$B$,e(B Segmentation fault e$B$9$k!#e(B”
on Wed, 20 Feb 2008 12:04:47 +0900, Tanaka A. [email protected]
writes:

|eval.c e$B$r$5$i$K$?$I$C$F$_$k$He(B… e$B$($'$H!“:G=i$+$ie(B (rev 2 e$B$+e(B
|e$B$ie(B) e$B$”$j$^$9$M!#$J$N$G!"$^$D$b$H$5$s$+$J!#e(B

0x80e$B$O3N$+e(Bscme$B$@$+e(Bsiode$B$@$+$+$i$b$i$C$F$-$??tCM$@$H;W$$$^$9!#e(B

On Tue, 19 Feb 2008 18:51:07 +0900
Tanaka A. [email protected] wrote:

e$B$D$$C5$7$?$i8+$D$1$F$7$^$C$?$N$G=q$$$F$*$-$^$9$,!"e(B
[ruby-dev:15100] e$B$KE:IU$5$l$F$k%Q%C%A$Ke(B 0x80 e$B$,F~$C$F$^$9$M!#e(B

e$B$@$+$i!"?R$M$k$H$7$?$ie(B sheepman e$B$5$s$+$J!#e(B

e$BEv;~$Ne(B eval.c e$B$K$"$C$?e(B stack_length
e$B4X?t$r$=$N$^$^%3%T!<$7$?$b$N$G$9!#e(B