From: Christian Szegedy Date: 2001-10-10T00:28:42+09:00 Subject: [ruby-talk:22319] 64-bit Ruby under AIX 4.3 I am trying again to compile 64-bit Ruby under AIX 4.3 using VAC 5. (I got essentially the same problems with the old xlc also.) I used the newest version (1.6.5) downloaded today. miniruby crached while executing rbconfig.rb (The 32 bit - version works fine on the same box (and on a lot of other boxes).) The 64 crashes deterministically in the garbage collection. The crutial point seems to be the setjmp at line 1007. It disrupts the value of stack end. Here is the log of my debugging session: reading symbolic information ... (dbx) st in gc_start "gc_start" is not a subprogram (dbx) st in rb_gc [1] stop in rb_gc (dbx) r mkconfig.rb [1] stopped in rb_gc at line 969 in file "gc.c" 969 VALUE *stack_end = alloca(1); (dbx) where rb_gc(), line 969 in "gc.c" load_file(0x1, 0x100175e0), line 853 in "ruby.c" proc_options(0x1, 0x100853e8), line 724 in "ruby.c" ruby_process_options(0x0, 0x200fe7c8), line 1033 in "ruby.c" unnamed block $b230, line 1128 in "eval.c" ruby_options(0xbadc0ffe, 0xe0ddf00d), line 1128 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" warning: Frame information in error at 0x100000444 (dbx) n stopped in rb_gc at line 974 in file "gc.c" 974 if (dont_gc || during_gc) { (dbx) p stack_end 0x0ffffffffffff990 (dbx) p dont_gc 0 (dbx) p during_gc 0 (dbx) n stopped in rb_gc at line 982 in file "gc.c" 982 malloc_memories = 0; (dbx) n stopped in rb_gc at line 984 in file "gc.c" 984 if (during_gc) return; (dbx) n stopped in rb_gc at line 985 in file "gc.c" 985 during_gc++; (dbx) n stopped in rb_gc at line 988 in file "gc.c" 988 for (frame = ruby_frame; frame; frame = frame->prev) { (dbx) n stopped in rb_gc at line 989 in file "gc.c" 989 rb_gc_mark_frame(frame); (dbx) p frame 0x00000001100265d0 (dbx) n stopped in unnamed block $b279 at line 990 in file "gc.c" 990 if (frame->tmp) { (dbx) n stopped in unnamed block $b279 at line 988 in file "gc.c" 988 for (frame = ruby_frame; frame; frame = frame->prev) { (dbx) p frame->tmp (nil) (dbx) n stopped in rb_gc at line 998 in file "gc.c" 998 rb_gc_mark(ruby_class); (dbx) n stopped in rb_gc at line 999 in file "gc.c" 999 rb_gc_mark(ruby_scope); (dbx) where rb_gc(), line 999 in "gc.c" load_file(0x1, 0x100175e0), line 853 in "ruby.c" proc_options(0x1, 0x100853e8), line 724 in "ruby.c" ruby_process_options(0x0, 0x200fe7c8), line 1033 in "ruby.c" unnamed block $b230, line 1128 in "eval.c" ruby_options(0xbadc0ffe, 0xe0ddf00d), line 1128 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" warning: Frame information in error at 0x100000444 (dbx) n stopped in rb_gc at line 1000 in file "gc.c" 1000 rb_gc_mark(ruby_dyna_vars); (dbx) where rb_gc(), line 1000 in "gc.c" load_file(0x1, 0x100175e0), line 853 in "ruby.c" proc_options(0x1, 0x100853e8), line 724 in "ruby.c" ruby_process_options(0x0, 0x200fe7c8), line 1033 in "ruby.c" unnamed block $b230, line 1128 in "eval.c" ruby_options(0xbadc0ffe, 0xe0ddf00d), line 1128 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" warning: Frame information in error at 0x100000444 (dbx) p stack_end 0x0ffffffffffff990 (dbx) n stopped in rb_gc at line 1001 in file "gc.c" 1001 if (finalizer_table) { (dbx) where rb_gc(), line 1001 in "gc.c" load_file(0x1, 0x100175e0), line 853 in "ruby.c" proc_options(0x1, 0x100853e8), line 724 in "ruby.c" ruby_process_options(0x0, 0x200fe7c8), line 1033 in "ruby.c" unnamed block $b230, line 1128 in "eval.c" ruby_options(0xbadc0ffe, 0xe0ddf00d), line 1128 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" warning: Frame information in error at 0x100000444 (dbx) p stack_end 0x0ffffffffffff990 (dbx) n stopped in rb_gc at line 1007 in file "gc.c" 1007 setjmp(save_regs_gc_mark); (dbx) where rb_gc(), line 1007 in "gc.c" load_file(0x1, 0x100175e0), line 853 in "ruby.c" proc_options(0x1, 0x100853e8), line 724 in "ruby.c" ruby_process_options(0x0, 0x200fe7c8), line 1033 in "ruby.c" unnamed block $b230, line 1128 in "eval.c" ruby_options(0xbadc0ffe, 0xe0ddf00d), line 1128 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" warning: Frame information in error at 0x100000444 (dbx) p stack_end 0x0ffffffffffff990 (dbx) n stopped in rb_gc at line 1008 in file "gc.c" 1008 mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *)); (dbx) where rb_gc(), line 1008 in "gc.c" (dbx) p stack_end (nil) (dbx) p save_regs_gc_mark (1, 133160, 1, 191376, 268435455, -1760, 1, 268577520, -1159983106, -522326003, 0, 2, 0, 537913288, 0, 5379133 12, 0, 0, 0, 537915088, 0, 0, -1159983106, -522326003, -1159983106, -522326003, -1159983106, -522326003, -115 983106, -522326003, -1159983106, -522326003, -1159983106, -522326003, -1159983106, -522326003, -1159983106, - 22326003, -1159983106, -522326003, -1159983106, -522326003, 268435455, -1744, 1, 268443464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) (dbx) p rb_gc_stack_start 0x0ffffffffffffd00 (dbx) n stopped in rb_gc at line 1009 in file "gc.c" 1009 rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END); (dbx) p stack_end (nil) (dbx) p rb_gc_stack_start 0x0ffffffffffffd00 (dbx) p &stack_end 0x0ffffffffffffab0 (dbx) s stopped in rb_gc_mark_locations at line 391 in file "gc.c" 391 if (start > end) { (dbx) where rb_gc_mark_locations(start = 0x0ffffffffffffd00, end = (nil)), line 391 in "gc.c" rb_gc(), line 1009 in "gc.c" (dbx) stopped in rb_gc_mark_locations at line 392 in file "gc.c" 392 tmp = start; (dbx) n stopped in rb_gc_mark_locations at line 393 in file "gc.c" 393 start = end; (dbx) n stopped in rb_gc_mark_locations at line 394 in file "gc.c" 394 end = tmp; (dbx) n stopped in rb_gc_mark_locations at line 396 in file "gc.c" 396 n = end - start + 1; (dbx) n stopped in rb_gc_mark_locations at line 397 in file "gc.c" 397 mark_locations_array(start,n); (dbx) p n 1152921504606845664 Segmentation fault in mark_locations_array at line 377 in file "gc.c" 377 if (is_pointer_to_heap(*x)) { (dbx) n mkconfig.rb:118: [BUG] Segmentation fault ruby 1.6.5 (2001-09-19) [powerpc-aix4.3.3.0] IOT/Abort trap in . at 0x3774 0x0000000000003774 e9a1ff68 ld r13,-152(r1) ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Note that the first "where" directive yielded the hint: "warning: Frame information in error at 0x100000444" So it is obvious, that something has already gone wrong... I tryed to find the first place, where the stack frame is in error. It seems that this is caused by the first setjmp in the program: ruby_options(argc = 2, argv = 0x00000000200fe7c8), line 1126 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" (dbx) n stopped in unnamed block $b230 at line 1127 in file "eval.c" 1127 if ((state = EXEC_TAG()) == 0) { (dbx) where unnamed block $b230, line 1127 in "eval.c" ruby_options(argc = 2, argv = 0x00000000200fe7c8), line 1127 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" (dbx) n stopped in unnamed block $b230 at line 1128 in file "eval.c" 1128 ruby_process_options(argc, argv); (dbx) where unnamed block $b230, line 1128 in "eval.c" ruby_options(argc = 2, argv = 0x00000000200fe7c8), line 1128 in "eval.c" main(argc = 2, argv = 0x00000000200fe7c8, envp = 0x00000000200fe7e0), line 49 in "main.c" warning: Frame information in error at 0x100000444 So it seems that something has gone wrong with the setjmps. Perhaps it is a bug in the compiler? If this seems to be definitively the case (that is, the code here is completely ANSI (or whatever) conform), then I would pose this as a support question. I would be very grateful for any help. -- A society that will trade a little order for a little freedom will lose both, and deserve neither. --Thomas Jefferson