bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Gc] GDB 7's process record/replay & BDW-GC


From: Boehm, Hans
Subject: RE: [Gc] GDB 7's process record/replay & BDW-GC
Date: Tue, 27 Oct 2009 22:52:14 +0000

I couldn't immediately find much of a description of how the record mechanism 
works.  Does it just interpret or single-step, recording overwritten values?  
Something cleverer?  Even if it just interprets, presumably I end up with a 
separate log for each thread.  If I can reverse-single-step thread 
individually, how do I make sure that I don't end up in an impossible state, in 
which one thread has observed the action of another one that hasn't executed 
yet?

I'm really trying to understand what part of the mechanism the GC might be 
interfering with.  The GC itself doesn't play with segment registers.  But it 
does use thread-local variables by default, which I think on X86 take advantage 
of a segment register pointing at the base of the thread structure.  Is there a 
chance that the problem is really with thread-local (__thread) variables?

Hans

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On Behalf Of Ludovic Courtès
> Sent: Tuesday, October 27, 2009 2:52 PM
> To: address@hidden
> Cc: address@hidden
> Subject: [Gc] GDB 7's process record/replay & BDW-GC
> 
> Hello,
> 
> GDB 7.0 provides process record/replay facilities, which in 
> turn provide support for reverse execution[*] (info "(gdb) 
> Process Record and Replay").
> 
> Unfortunately, GDB's record facility is confused by libgc's tricks:
> 
> --8<---------------cut here---------------start------------->8---
> $ cat > ,,t.c <<EOF
> #include <gc/gc.h>
> 
> int   
> main (int argc, char *argv[])
> {
>   GC_INIT ();
>   GC_malloc (123);
>   return 0;
> }
> EOF
> 
> $ gcc -Wall ,,t.c -lgc
> $ gdb ./a.out 
> 
> warning: Can not parse XML syscalls information; XML support 
> was disabled at compile time.
> GNU gdb (GDB) 7.0
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type 
> "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /home/ludo/src/guile/a.out...done.
> (gdb) r
> Starting program: /home/ludo/src/guile/a.out [Thread 
> debugging using libthread_db enabled]
> 
> Program exited normally.
> (gdb) b main
> Breakpoint 1 at 0x400783: file ,,t.c, line 6.
> (gdb) r
> Starting program: /home/ludo/src/guile/a.out [Thread 
> debugging using libthread_db enabled]
> 
> Breakpoint 1, main (argc=1, argv=0x7fffffffc8e8) at ,,t.c:6
> 6         GC_INIT ();
> (gdb) record
> (gdb) c
> Continuing.
> warning: Process record ignores the memory change of 
> instruction at address 0x7ffff7612e5a because it can't get 
> the value of the segment register.
> warning: Process record ignores the memory change of 
> instruction at address 0x7ffff784e8c3 because it can't get 
> the value of the segment register.
> Process record doesn't support instruction 0xf6e at address 
> 0x7ffff789f2f2.
> Process record: failed to record execution log.
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x00007ffff789f2f0 in memset () from 
> /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
> (gdb) bt
> #0  0x00007ffff789f2f0 in memset () from 
> /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
> #1  0x00007ffff7b8a7c8 in GC_init_headers () at ../headers.c:197
> #2  0x00007ffff7b904cb in GC_init () at ../misc.c:788
> #3  0x0000000000400788 in main (argc=1, argv=0x7fffffffc8e8) 
> at ,,t.c:6
> (gdb) c
> Continuing.
> Process record doesn't support instruction 0xf6e at address 
> 0x7ffff789f2f2.
> Process record: failed to record execution log.
> 
> Program received signal SIGABRT, Aborted.
> 0x00007ffff789f2f0 in memset () from 
> /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
> (gdb) bt
> #0  0x00007ffff789f2f0 in memset () from 
> /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
> #1  0x00007ffff7b8a7c8 in GC_init_headers () at ../headers.c:197
> #2  0x00007ffff7b904cb in GC_init () at ../misc.c:788
> #3  0x0000000000400788 in main (argc=1, argv=0x7fffffffc8e8) 
> at ,,t.c:6 --8<---------------cut 
> here---------------end--------------->8---
> 
> Is it a known issue?  Any idea how to fix it?
> 
> Thanks,
> Ludo'.
> 
> [*] The 'multi-thread' target doesn't support reverse 
> execution, but the
>     'record' target does.  Thus 'record' is the only way to 
> get reverse
>     execution for multi-threaded programs.
> 
> _______________________________________________
> Gc mailing list
> address@hidden
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]