Coredump on Mac OS X

e$B$O$8$a$^$7$F!"$^$k$^$ke(B e$B$H?=$7$^$9!#e(B
Mac OS X 10.4 e$B$G$be(B [ruby-dev:30198] coredump on NetBSD
e$B$HF1MM$N>I>u$,e(B
e$B8+$i$l$^$7$?$N$G!"$4Js9pCW$7$^$9!#e(B

[email protected]$7!"e(BOS X e$B$G$Oe(B Revision11540
e$B0J9_%S%k%I$G$-$J$/$J$C$F$$$k$?$a!“e(B
e$B!Je(B[riby-core:9958] rb_cProc and rb_cBinding defined twice in
trunke$B!Ke(B
e$B0J2<$Ne(B crash.log e$B$Oe(B Revision11540 e$B$N$b$N$G$9!#e(B
e$B!JG0$N$?$a!”<j85$G%=!<%9$rJQ99$7$F%S%k%I$7$?e(B ruby 1.9.0
(2007-01-28 patchlevel 0)
e$B$G$bF1MM$G$7$?!#!Ke(B

$ ruby/11540/miniruby -v 0
ruby 1.9.0 (2007-01-16 patchlevel 0) [powerpc-darwin8.8.0]
– stack frame ------------
– control frame ----------
c:0001 p:---- s:0000 b:-001 l:000000 d:000000 ------

[BUG] Segmentation fault
ruby 1.9.0 (2007-01-16) [powerpc-darwin8.8.0]

Abort trap

— e$B$3$3$+$ie(B miniruby.crash.loge$BH4?he(B —
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x0068500c

Thread 0 Crashed:
0 miniruby 0x00004434 frame_func_id + 4 (eval.c:1858)
1 miniruby 0x00004534 error_pos + 100 (eval_error.h:39)
2 miniruby 0x000075e4 error_print + 308 (eval_error.h:100)
3 miniruby 0x00007b9c error_handle + 364 (eval_error.h:241)
4 miniruby 0x00007c84 ruby_options + 148 (eval.c:149)
5 miniruby 0x00002590 main + 48 (eval_intern.h:303)
6 miniruby 0x0000217c _start + 760
7 miniruby 0x00001e80 start + 48

Thread 1:
0 libSystem.B.dylib 0x90040978 mach_wait_until + 8
1 libSystem.B.dylib 0x90040744 nanosleep + 388
2 miniruby 0x0005f734 thread_timer + 100
(thread_pthread.ci:414)
3 libSystem.B.dylib 0x9002b508 _pthread_body + 96

Thread 0 crashed with PPC Thread State 64:
srr0: 0x0000000000004434 srr1: 0x100000000000f030
vrsave: 0x0000000000000000
cr: 0x28000424 xer: 0x0000000000000000 lr:
0x0000000000004534 ctr: 0x00000000900015c0
r0: 0x0000000000004534 r1: 0x00000000bffff260 r2:
0x00000000000e7034 r3: 0x0000000000685000
r4: 0x00000000011220d1 r5: 0x000000000000754c r6:
0x00000000bffff374 r7: 0x00000000000000ff
r8: 0x00000000bffff360 r9: 0x00000000002c5000 r10:
0x00000000000044a8 r11: 0x0000000000000000
r12: 0x00000000900015c0 r13: 0x0000000000000000 r14:
0x0000000000000000 r15: 0x0000000000000000
r16: 0x0000000000000000 r17: 0x0000000000000000 r18:
0x0000000000000000 r19: 0x0000000000000000
r20: 0x0000000000000000 r21: 0x0000000000000000 r22:
0x0000000000000000 r23: 0x0000000000000000
r24: 0x0000000000000000 r25: 0x0000000000000003 r26:
0x00000000bffffb98 r27: 0x0000000000000001
r28: 0x00000000000f3d4c r29: 0x00000000000f3d50 r30:
0x00000000000e7034 r31: 0x00000000000044dc

Binary Images Description:
0x1000 - 0xe6fff miniruby /Users/marumaru/ruby/11540/miniruby
0x8fe00000 - 0x8fe51fff dyld 45.3 /usr/lib/dyld
0x90000000 - 0x901bcfff libSystem.B.dylib /usr/lib/libSystem.B.dylib
0x90214000 - 0x90219fff libmathCommon.A.dylib
/usr/lib/system/libmathCommon.A.dylib
0x90a3a000 - 0x90abefff libobjc.A.dylib /usr/lib/libobjc.A.dylib
0x90b6e000 - 0x90b80fff libauto.dylib /usr/lib/libauto.dylib
— miniruby.crash.log e$B$3$3$^$Ge(B —

e$B0J>e$G$9!#e(B

e$B$^$k$^$ke(B = T.Kanai

e$B$5$Ne(B e$B$h$7$N$je(B e$B$G$9e(B

e$B$O$8$a$^$7$F!"$^$k$^$ke(B e$B$H?=$7$^$9!#e(B
Mac OS X 10.4 e$B$G$be(B [ruby-dev:30198] coredump on NetBSD e$B$HF1MM$N>I>u$,e(B
e$B8+$i$l$^$7$?$N$G!"$4Js9pCW$7$^$9!#e(B

e$B0J2<$N4D6-$G$b%P%0$,:F8=$9$k$3$H$r3NG’$7$^$7$?!#e(B

% uname -a
Darwin MacBookPro.local 8.8.1 Darwin Kernel Version 8.8.1: Mon Sep 25
19:42:00 PDT 2006; root:xnu-792.13.8.obj~1/RELEASE_I386 i386 i386
% gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build
5250)
Copyright © 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

% cat no_such_file.rb
cat: no_such_file.rb: No such file or directory
% ./ruby no_such_file.rb
– stack frame ------------
– control frame ----------
c:0001 p:---- s:0000 b:-001 l:000000 d:000000 ------

[BUG] Segmentation fault
ruby 1.9.0 (2007-02-04) [i686-darwin8.8.1]

zsh: abort ./ruby no_such_file.rb

GDBe$B$G$3$N%P%0$rJ,@O$7$F$_$^$7$?!#e(B

% gdb --quiet ./ruby
Reading symbols for shared libraries … done
(gdb) run no_such_file.rb
Starting program: /Users/ysano/ruby-trunk/ruby no_such_file.rb
Reading symbols for shared libraries … done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0068500c
frame_func_id (cfp=0x685000) at eval.c:1861
1861 yarv_iseq_t *iseq = cfp->iseq;
(gdb) bt
#0 frame_func_id (cfp=0x685000) at eval.c:1861
#1 0x00003349 in error_pos () at eval_error.h:39
#2 0x00005f55 in error_print () at eval_error.h:100
#3 0x000063ab in error_handle (ex=893572) at eval_error.h:241
#4 0x0000643f in ruby_options (argc=2, argv=0xbffff0c0) at eval.c:146
#5 0x00001d6e in main (argc=2, argv=0xbffff0c0, envp=0xbffff0cc) at
main.c:46
(gdb) f 0
#0 frame_func_id (cfp=0x685000) at eval.c:1861
1861 yarv_iseq_t *iseq = cfp->iseq;
(gdb) list
1856 }
1857
1858 static ID
1859 frame_func_id(yarv_control_frame_t *cfp)
1860 {
1861 yarv_iseq_t *iseq = cfp->iseq;
1862 if (!iseq) {
1863 return cfp->method_id;
1864 }
1865 else if (YARV_IFUNC_P(iseq)) {
(gdb) p *(yarvCurrentThread->cfp)
$2 = {
pc = 0x0,
sp = 0x605000,
bp = 0x0,
iseq = 0x0,
magic = 0,
self = 4,
lfp = 0x605000,
dfp = 0x605000,
block_iseq = 0x0,
proc = 0,
callee_id = 0,
method_id = 0,
method_klass = 0,
prof_time_self = 0,
prof_time_chld = 0,
dummy = 0
}

(gdb) p *(yarvCurrentThread->cfp+1)
Cannot access memory at address 0x685000
(gdb) p (yarvCurrentThread->stack)
$4 = (VALUE *) 0x605000
(gdb) p (yarvCurrentThread->stack + yarvCurrentThread->stack_size)
$5 = (VALUE *) 0x685000

e$B$3$NJ,@O7k2L$+$i!"0J2<$N%Q%C%A$r:n$j$^$7$?!#e(B
yarvCurrentThread->cfp+1e$B$,!“e(Byarvcore.ce$B$Ne(Bth_init2()e$B$G3NJ]$5$l$?%9%l%C%I%9%?%C%/e(B
e$B$NCf$K$”$k$+$I$&$+%A%’%C%/$9$k$h$&$K$7$^$7$?!#e(B

Index: eval.c

— eval.c (revision 11626)
+++ eval.c (working copy)
@@ -1879,7 +1879,13 @@
ID
rb_frame_callee(void)
{

  • return frame_func_id(GET_THREAD()->cfp + 1);
  • yarv_thread_t *th = GET_THREAD();
  • yarv_control_frame_t *prev_cfp =
    YARV_PREVIOUS_CONTROL_FRAME(th->cfp);
  • /* check if prev_cfp can be accessible */
  • if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
  •    return 0;
    
  • }
  • return frame_func_id(prev_cfp);
    }

e$B$3$N%Q%C%A$rE,MQ$9$k$H!"e(Bseg faulte$B$7$J$/$J$j$^$9!#e(B

% ./ruby no_such_file.rb
./ruby:1: No such file or directory – no_such_file.rb (LoadError)

e$B$^$?!“e(B[ruby-core:9856] YARV segfault when reading from STDIN
e$B$G;XE&$5$l$F$$$?LdBj$b!”$3$N%Q%C%A$rE,MQ$9$k$H2r7h$G$-$^$9!#e(B

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/9856

(e$B%Q%C%AE,MQA0e(B)
% ./ruby
(Ctrl+c)
– stack frame ------------
– control frame ----------
c:0001 p:---- s:0000 b:-001 l:000000 d:000000 ------

[BUG] Segmentation fault
ruby 1.9.0 (2007-02-04) [i686-darwin8.8.1]

zsh: abort ./ruby

(e$B%Q%C%AE,MQ8ee(B)
% ./ruby
(Ctrl+c)
./ruby:1: Interrupt

07/01/29 e$B$Ke(B T. Kanai[email protected] e$B$5$s$O=q$-$^$7$?e(B:

[email protected]$G$9!%e(B

Yoshinori Sano wrote:

e$B$3$NJ,@O7k2L$+$i!"0J2<$N%Q%C%A$r:n$j$^$7$?!#e(B
yarvCurrentThread->cfp+1e$B$,!“e(Byarvcore.ce$B$Ne(Bth_init2()e$B$G3NJ]$5$l$?%9%l%C%I%9e(B
e$B%?%C%/e(B
e$B$NCf$K$”$k$+$I$&$+%A%’%C%/$9$k$h$&$K$7$^$7$?!#e(B

e$B!!$3$l$K4X$7$F$O!$$4;XE&$NDL$je(BVMe$B%9%?%C%/$N>uBV$,[email protected]$+$i5/$-$k!$$H$$e(B
e$B$&$3$H$J$N$G$9$,!$2r7h$H$7$F$O!$:G=i$+$i$-$A$s$H%9%?%C%/$r:n$C$F$*$/!$$He(B
e$B$$$&$3$H$r9M$($F$$$^$7$?!%Kh2s%A%’%C%/$9$k$N$O$J$s$+7y$G$9$N$G!%e(B

[email protected]$G$9!#e(B

Yoshinori Sano wrote:

YARV_PREVIOUS_CONTROL_FRAME(th->cfp)e$B$,!">o$K0BA4$Je(B
e$B%"%I%l%9$r;X$7$F$$$k$3$H$rJ]>Z$9$k$N$OFq$7$$$h$&$J5$$,$9$k$N$G$9$,!#!#!#e(B

e$B!!$J$<$G$7$g$&$+!#=PMh$k$H;W$C$F$$$?$N$G!"$3$&$$$&>l9g$KL5M}!"$H$$$&$N$,e(B
e$B$"$l$P$4;XE&$/[email protected]$5$$!#e(B

e$B$5$Ne(B e$B$h$7$N$j$G$9e(B

e$BKh2s%A%’%C%/$9$k$N$O$J$s$+7y$G$9$N$G!%e(B

e$BKM$b!“3N$+$KKh2s%A%’%C%/$9$k$N$O!”$I$&$J$N$+$J$!$H;W$C$F$$$^$7$?!#e(B
e$B$G$-$l$P!"$7$?$/$J$$$G$9$h$M!#e(B

e$B$G$b!"$-$A$s$H%9%?%C%/$r:n$C$F$*$1$P!"$3$&$$$C$?%A%’%C%/=hM}$Oe(B
e$B$7$J$/$F$b:Q$`$h$&$K$G$-$k$N$G$7$g$&$+e(B?

YARV_PREVIOUS_CONTROL_FRAME(th->cfp)e$B$,!">o$K0BA4$Je(B
e$B%"%I%l%9$r;X$7$F$$$k$3$H$rJ]>Z$9$k$N$OFq$7$$$h$&$J5$$,$9$k$N$G$9$,!#!#!#e(B

07/02/05 e$B$Ke(B SASADA Koichi[email protected] e$B$5$s$O=q$-$^$7$?e(B:

e$B$5$Ne(B e$B$h$7$N$j$G$9e(B

07/02/05 e$B$Ke(B SASADA Koichi[email protected] e$B$5$s$O=q$-$^$7$?e(B:

[email protected]$G$9!#e(B

Yoshinori Sano wrote:

YARV_PREVIOUS_CONTROL_FRAME(th->cfp)e$B$,!">o$K0BA4$Je(B
e$B%"%I%l%9$r;X$7$F$$$k$3$H$rJ]>Z$9$k$N$OFq$7$$$h$&$J5$$,$9$k$N$G$9$,!#!#!#e(B

e$B!!$J$<$G$7$g$&$+!#=PMh$k$H;W$C$F$$$?$N$G!"$3$&$$$&>l9g$KL5M}!"$H$$$&$N$,e(B
e$B$"$l$P$4;XE&$/[email protected]$5$$!#e(B

e$B$9$$$^$;$s!#D>46$G$7$?!#e(B

e$B$h$/9M$($k$H!"%9%l%C%I%9%?%C%/$NMxMQ3+;[email protected]$7$F$d$l$P!“e(B
YARV_PREVIOUS_CONTROL_FRAME(th->cfp)e$B$,!”>o$K%9%l%C%I%9%?%C%/e(B
e$B$NCf$N%"%I%l%9$r<($9$h$&$K$G$-$=$&$G$9$M!#e(B

e$B0J2<$NJQ99$,$5$l$k0l$DA0$Ne(Br11627e$B$G!"%9%l%C%I%9%?%C%/$Ne(B
e$BMxMQ3+;[email protected]$9$k<B83$r$7$F$_$^$7$?!#e(B

Mon Feb 5 04:09:48 2007 Yukihiro M. [email protected]

* eval.c (rb_frame_callee): check if prev_cfp can be accessible.
  a patch from Yoshinori Sano <yoshinori.sano at gmail.com> in
  [ruby-dev:30252].  solves [ruby-dev:30200] and [ruby-core:9856].

e$B0J2<$N$h$&$K!"%9%l%C%I%9%?%C%/$NMxMQ3+;O0LCV$re(B1e$B%U%l!<%`J,e(B
e$B%^!<%8%s$r$H$k$3$H$G!“e(BYARV_PREVIOUS_CONTROL_FRAME(th->cfp)
e$B$,[email protected]$J%”%I%l%9$r<($5$J$$$h$&$K$G$-$^$7$?!#e(B

Index: yarvcore.c

— yarvcore.c (revision 11627)
+++ yarvcore.c (working copy)
@@ -390,7 +390,7 @@

 th->stack_size = YARV_THREAD_STACK_SIZE;
 th->cfp = (void *)(th->stack + th->stack_size);
  • th->cfp–;
  • th->cfp -= 2;

    th->cfp->pc = 0;
    th->cfp->sp = th->stack;

% ./ruby -v no_such_file.rb
ruby 1.9.0 (2007-02-04 patchlevel 0) [i686-darwin8.8.1]
./ruby:1: No such file or directory – no_such_file.rb (LoadError)

% gdb -q ./ruby
Reading symbols for shared libraries … done
(gdb) b rb_frame_callee
Breakpoint 1 at 0x3305: file eval.c, line 1882.
(gdb) run no_such_file.rb
Starting program: /Users/ysano/ruby-trunk/ruby no_such_file.rb
Reading symbols for shared libraries … done

Breakpoint 1, rb_frame_callee () at eval.c:1882
1882 return frame_func_id(GET_THREAD()->cfp + 1);
(gdb) p *(yarvCurrentThread->cfp+1)
$1 = {
pc = 0x0,
sp = 0x0,
bp = 0x0,
iseq = 0x0,
magic = 0,
self = 0,
lfp = 0x0,
dfp = 0x0,
block_iseq = 0x0,
proc = 0,
callee_id = 0,
method_id = 0,
method_klass = 0,
prof_time_self = 0,
prof_time_chld = 0,
dummy = 0
}
(gdb) p *(yarvCurrentThread->cfp+2)
Cannot access memory at address 0x685000

07/02/05 e$B$Ke(B SASADA Koichi[email protected] e$B$5$s$O=q$-$^$7$?e(B:

e$B$3$l$K4X$7$F$O!$$4;XE&$NDL$je(BVMe$B%9%?%C%/$N>uBV$,[email protected]$+$i5/$-$k!$$H$$e(B
e$B$&$3$H$J$N$G$9$,!$2r7h$H$7$F$O!$:G=i$+$i$-$A$s$H%9%?%C%/$r:n$C$F$*$/!$$He(B
e$B$$$&$3$H$r9M$($F$$$^$7$?!%Kh2s%A%’%C%/$9$k$N$O$J$s$+7y$G$9$N$G!%e(B

[email protected]$5$se(B >
e$B$b$7$h$m$7$1$l$P!"!V:G=i$+$i$-$A$s$H%9%?%C%/$r:n$C$F$*$/!W$H$$$&e(B
e$B%"%$%G%"$r$b$&>/$7>$7$/@bL@[email protected]$1$J$$$G$7$g$&$+!)e(B
(e$B$^[email protected]}2r$G$-$J$$$+$b$7$l$^$;$s$,!“6=L#$,$”$j$^$9!#e(B)

07/02/05 e$B$Ke(B SASADA Koichi[email protected] e$B$5$s$O=q$-$^$7$?e(B:

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

In message “Re: [ruby-dev:30255] Re: coredump on Mac OS X”
on Mon, 5 Feb 2007 04:58:06 +0900, SASADA Koichi [email protected]
writes:

|e$B!!$3$l$K4X$7$F$O!$$4;XE&$NDL$je(BVMe$B%9%?%C%/$N>uBV$,[email protected]$+$i5/$-$k!$$H$$e(B
|e$B$&$3$H$J$N$G$9$,!$2r7h$H$7$F$O!$:G=i$+$i$-$A$s$H%9%?%C%/$r:n$C$F$*$/!$$He(B
|e$B$$$&$3$H$r9M$($F$$$^$7$?!%Kh2s%A%’%C%/$9$k$N$O$J$s$+7y$G$9$N$G!%e(B

|// e$B$H9M$($F$$$?$i%3%_%C%H$5$l$F$7$^$C$?!%e(B

e$B$9$$$^$;$s!#$A$c$s$H%9%?%C%/$r:n$k$h$&$K$J$C$?$i:o$C$F$/[email protected]$5e(B
e$B$$$^$;!#e(B

[email protected]$G$9!%e(B

Yoshinori Sano wrote:

e$B$b$7$h$m$7$1$l$P!"!V:G=i$+$i$-$A$s$H%9%?%C%/$r:n$C$F$*$/!W$H$$$&e(B
e$B%"%$%G%"$r$b$&>/$7>$7$/@bL@[email protected]$1$J$$$G$7$g$&$+!)e(B
(e$B$^[email protected]}2r$G$-$J$$$+$b$7$l$^$;$s$,!“6=L#$,$”$j$^$9!#e(B)

e$B!!$$$d!$$5$N$5$s$,$d$C$F$/$l$?$b$N$K!$$"$H=i4|CM$r$F$-$H!<$K=q$/[email protected]$1$Ge(B
e$B$9!%$I$s$J=i4|CM$K$9$k$Y$-$+!$$^[email protected]$"$s$^$j9M$($F$$$^$;$s!%e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs