[crash BUG] the latest ruby 1.8 (2003-08-22) give SIGBUS

V

Ville Mattila

This SunOS xxxxxx 5.8 Generic_108528-20 sun4u sparc SUNW,Ultra-60

When I'm trying to compile the latest sources I get at miniruby stage the following
dump

r ./ext/extmk.rb --extstatic="" --dest-dir="" --make="make" --mflags="" --make-flags=""
Starting program: /workarea2/stonebeat/work/m_o/mulperi/nb/ruby/ruby-cvs/ruby/./miniruby ./ext/extmk.rb --extstatic="" --dest-dir="" --make="make" --mflags="" --make-flags=""

Program received signal SIGBUS, Bus error.
rb_yield_0 (val=1604896, self=1069304, klass=0, flags=0, avalue=2)
at eval.c:4109
4109 val = RARRAY(val)->ptr[0];
(gdb) bt
#0 rb_yield_0 (val=1604896, self=1069304, klass=0, flags=0, avalue=2)
at eval.c:4109
#1 0x7aa40 in rb_str_scan (str=1605184, pat=1617640) at string.c:3069
#2 0x2fdf0 in call_cfunc (func=0x7a988 <rb_str_scan>, recv=1605184, len=1,
argc=1, argv=0xffbee208) at eval.c:4781
#3 0x245a8 in rb_call0 (klass=1063856, recv=1605184, id=4481, oid=4481,
argc=1, argv=0xffbee208, body=0x103160, nosuper=1) at eval.c:4918
#4 0x24e34 in rb_call (klass=1063856, recv=1605184, mid=4481, argc=1,
argv=0xffbee208, scope=0) at eval.c:5136
#5 0x1f8b8 in rb_eval (self=1069304, n=0xffbee208) at ruby.h:627
#6 0x1ebf0 in rb_eval (self=1069304, n=0x18afa8) at eval.c:2721
#7 0x24858 in rb_call0 (klass=1075064, recv=1069304, id=10585, oid=10585,
argc=5, argv=0xffbeea9c, body=0x18afa8, nosuper=1) at eval.c:5046
#8 0x24e34 in rb_call (klass=1075064, recv=1069304, mid=10585, argc=6,
argv=0xffbeea98, scope=1) at eval.c:5136
#9 0x1f8b8 in rb_eval (self=1069304, n=0x0) at ruby.h:627
#10 0x24858 in rb_call0 (klass=1075064, recv=1069304, id=10577, oid=10577,
argc=0, argv=0x0, body=0xee5b0, nosuper=1) at eval.c:5046
#11 0x24e34 in rb_call (klass=1075064, recv=1069304, mid=10577, argc=0,
argv=0x0, scope=1) at eval.c:5136
#12 0x1f8b8 in rb_eval (self=1069304, n=0x0) at ruby.h:627
#13 0x1b684 in ruby_exec () at eval.c:1388
#14 0x1b6d4 in ruby_run () at eval.c:1409
#15 0x195fc in main (argc=0, argv=0xffbef6e4, envp=0xffbef704) at main.c:50
 
N

nobu.nokada

Hi,

At Fri, 22 Aug 2003 20:17:29 +0900,
Ville said:
When I'm trying to compile the latest sources I get at miniruby stage the following
dump

r ./ext/extmk.rb --extstatic="" --dest-dir="" --make="make" --mflags="" --make-flags=""
Starting program: /workarea2/stonebeat/work/m_o/mulperi/nb/ruby/ruby-cvs/ruby/./miniruby ./ext/extmk.rb --extstatic="" --dest-dir="" --make="make" --mflags="" --make-flags=""

Program received signal SIGBUS, Bus error.
rb_yield_0 (val=1604896, self=1069304, klass=0, flags=0, avalue=2)
at eval.c:4109
4109 val = RARRAY(val)->ptr[0];

This patch woudl fix it.


Index: string.c
===================================================================
RCS file: /cvs/ruby/src/ruby/string.c,v
retrieving revision 1.173
diff -u -2 -p -r1.173 string.c
--- string.c 22 Aug 2003 08:09:57 -0000 1.173
+++ string.c 22 Aug 2003 09:49:45 -0000
@@ -3031,9 +3031,6 @@ scan_once(str, pat, start)
*start = END(0);
}
- if (regs->num_regs == 1) {
- return rb_reg_nth_match(0, match);
- }
result = rb_ary_new2(regs->num_regs);
- for (i=1; i < regs->num_regs; i++) {
+ for (i=0; i < regs->num_regs; i++) {
rb_ary_push(result, rb_reg_nth_match(i, match));
}
 
V

Ville Mattila

Thanks Nobu,

This patch fixes the SIGBUS and the ruby compilation now completes correctly.

- Ville
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,261
Messages
2,571,040
Members
48,769
Latest member
Clifft

Latest Threads

Top