[racket] debugging core dump - comments appreciated

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Wed May 25 02:08:03 EDT 2011

Matthew Flatt wrote at 05/23/2011 10:47 PM:
> Neither the C stack or Scheme stack (yes, they are separate) seems
> particularly large. There's one overflow of the Scheme stack, but
> that's not surprising since it starts small and grows on demand.
>
> I guess we're back to checking on the stack size. Maybe also
> disassemble GC_clear_stack_inner() so we can be clear on what
> part of the function is crashing?
>   

Here's the function disassembly, and the instruction's source code 
line.  At this point, there are a few things I can do in the application 
code to try to avoid this intermittent error condition, but I can't do 
much useful on the PLT internals side of debugging except be a remote 
typist for gdb.

gdb /usr/local/plt-4.2.5/bin/mzschemecgc core.28525
[[...]]
Program terminated with signal 11, Segmentation fault.
[[...]]
#0  0x00000000005655b6 in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:243

warning: Source file is more recent than executable.
243        BZERO(dummy, CLEAR_SIZE*sizeof(word));
(gdb) disassemble
Dump of assembler code for function GC_clear_stack_inner:
0x0000000000565590 <GC_clear_stack_inner+0>:    mov    %rbp,-0x10(%rsp)
0x0000000000565595 <GC_clear_stack_inner+5>:    mov    %r12,-0x8(%rsp)
0x000000000056559a <GC_clear_stack_inner+10>:    mov    %rsi,%rbp
0x000000000056559d <GC_clear_stack_inner+13>:    mov    %rbx,-0x18(%rsp)
0x00000000005655a2 <GC_clear_stack_inner+18>:    sub    $0x6c8,%rsp
0x00000000005655a9 <GC_clear_stack_inner+25>:    xor    %esi,%esi
0x00000000005655ab <GC_clear_stack_inner+27>:    mov    %rdi,%r12
0x00000000005655ae <GC_clear_stack_inner+30>:    mov    $0x6a8,%edx
0x00000000005655b3 <GC_clear_stack_inner+35>:    mov    %rsp,%rdi
0x00000000005655b6 <GC_clear_stack_inner+38>:    callq  0x4261b0 
<memset at plt>
0x00000000005655bb <GC_clear_stack_inner+43>:    cmp    %rbp,%rsp
0x00000000005655be <GC_clear_stack_inner+46>:    jbe    0x5655cb 
<GC_clear_stack_inner+59>
0x00000000005655c0 <GC_clear_stack_inner+48>:    mov    %rbp,%rsi
0x00000000005655c3 <GC_clear_stack_inner+51>:    mov    %r12,%rdi
0x00000000005655c6 <GC_clear_stack_inner+54>:    callq  0x565590 
<GC_clear_stack_inner>
0x00000000005655cb <GC_clear_stack_inner+59>:    mov    %rsp,%rdi
0x00000000005655ce <GC_clear_stack_inner+62>:    callq  0x567b80 <GC_noop1>
0x00000000005655d3 <GC_clear_stack_inner+67>:    mov    %r12,%rax
0x00000000005655d6 <GC_clear_stack_inner+70>:    mov    0x6b0(%rsp),%rbx
0x00000000005655de <GC_clear_stack_inner+78>:    mov    0x6b8(%rsp),%rbp
0x00000000005655e6 <GC_clear_stack_inner+86>:    mov    0x6c0(%rsp),%r12
0x00000000005655ee <GC_clear_stack_inner+94>:    add    $0x6c8,%rsp
0x00000000005655f5 <GC_clear_stack_inner+101>:    retq  
End of assembler dump.
(gdb) info locals
dummy = Cannot access memory at address 0x7fff2dd5ca20
(gdb) where
#0  0x00000000005655b6 in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:243
#1  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#2  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#3  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#4  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#5  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#6  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#7  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#8  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#9  0x00000000005655cb in GC_clear_stack_inner (arg=0x0,
    limit=0x7fff2dd5ce30 <Address 0x7fff2dd5ce30 out of bounds>) at 
./misc.c:245
#10 0x000000000056564b in GC_clear_stack (arg=0x0) at ./misc.c:291
#11 0x000000000056db58 in GC_generic_malloc_many (lb=2, k=0, 
result=0x7e7780) at ./mallocx.c:421
#12 0x000000000056e3f5 in GC_malloc_atomic (bytes=16) at 
./thread_local_alloc.c:219
#13 0x000000000055ee7a in scheme_make_char (ch=12985) at ./char.c:146
#14 0x00000000005606a4 in integer_to_char (argc=1, argv=0x7fff2c5b7028) 
at ./char.c:248
#15 0x00000000004452b8 in scheme_do_eval (obj=0x909110, num_rands=1, 
rands=0x7fff2c5b7028, get_value=1)
    at ./eval.c:8825
[[...]]
#403 0x0000000000426e3e in main (argc=<value optimized out>, argv=<value 
optimized out>) at ./main.c:268
[[...]]
(gdb) print GC_mark_stack_size
$5 = 8192


-- 
http://www.neilvandyke.org/


Posted on the users mailing list.