Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Cedric Roux <sed@free.fr>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: "record save" failure
Date: Wed, 22 Jan 2014 01:26:00 -0000	[thread overview]
Message-ID: <CANFwon26TA-z0t5TNM4EJFHxA-Sr3cSZhc_-+y_Fn1OzpZ83-A@mail.gmail.com> (raw)
In-Reply-To: <52DE76B2.3070302@free.fr>

Prec didn't support multithread.

Thanks,
Hui

On Tue, Jan 21, 2014 at 9:31 PM, Cedric Roux <sed@free.fr> wrote:
> Hi GNU gdb people,
>
> I'm trying to analyse an unfriendly program and I gave a try
> to the "record" thing gdb provides.
>
> Except it fails.
>
> Below is an excerpt of the log.
> Am I doing something wrong? forgetting to type something?
> Does the "record" thing works with multi-threaded programs?
> I used the "set scheduler-locking on" command to run only the
> desired thread.
>
> As you see, I record more than 5 millions instructions between
> breakpoint 3 and breakpoint 2. The "record save" fails and a
> following "info record" crashes gdb. My computer is a 64b intel p6000
> thing with debian testing (last updated in october of last year or
> something). I compiled gdb 7.6.2 locally with gcc 4.8.1.
>
> I hacked a bit gdb (but just a bit) to dump the "record list" at
> the beginning of "record_full_save" and I get a different dump
> compared to "record_full_save" (which does more than dump the
> list, it replays the instructions, which I don't do). So I'm a
> bit lost. (I compared with a simple multi-threaded program I quickly
> wrote, and for which "record" works.)
>
> Any hint or whatever (maybe there is a bug somewhere in gdb...) is
> very welcome.
>
> Regards and thanks for gdb which is a great program,
> Cédric.
>
> momo@sed:~$ dbg/bin/gdb -p 23553
> GNU gdb (GDB) 7.6.2
> [...]
> This GDB was configured as "x86_64-unknown-linux-gnu".
> [...]
> Attaching to process 23553
> [...]
> [New LWP 23554]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> [...]
> 0x00007ffff325824d in poll () from /lib/x86_64-linux-gnu/libc.so.6
> (gdb) hb *0x00007fffe8c63f22
> Hardware assisted breakpoint 1 at 0x7fffe8c63f22
> (gdb) cont
> Continuing.
> [New Thread 0x7fffe4372700 (LWP 23570)]
> [New Thread 0x7fffe4b73700 (LWP 23571)]
> [New Thread 0x7fffdeaff700 (LWP 23572)]
> [New Thread 0x7fffca553700 (LWP 23594)]
> [New Thread 0x7fffc87ff700 (LWP 23595)]
> [New Thread 0x7fffc7ffe700 (LWP 23596)]
> [New Thread 0x7fffc77fd700 (LWP 23597)]
> [New Thread 0x7fffc6ce9700 (LWP 23598)]
> [New Thread 0x7fffc64e8700 (LWP 23599)]
> [Thread 0x7fffc77fd700 (LWP 23597) exited]
> [Thread 0x7fffc7ffe700 (LWP 23596) exited]
> [Thread 0x7fffc87ff700 (LWP 23595) exited]
> [Thread 0x7fffc6ce9700 (LWP 23598) exited]
> [Thread 0x7fffc64e8700 (LWP 23599) exited]
> [Thread 0x7fffca553700 (LWP 23594) exited]
> [New Thread 0x7fffca553700 (LWP 23600)]
> [New Thread 0x7fffc64e8700 (LWP 23601)]
> [Thread 0x7fffc64e8700 (LWP 23601) exited]
> [Switching to Thread 0x7fffca553700 (LWP 23600)]
>
> Breakpoint 1, 0x00007fffe8c63f22 in ?? () from XXX.so
> (gdb) cont
> Continuing.
>
> Breakpoint 1, 0x00007fffe8c63f22 in ?? () from XXX.so
> (gdb) hb *0x00007fffe8ad361c
> Hardware assisted breakpoint 2 at 0x7fffe8ad361c
> (gdb) hb *0x00007fffe8c0f066
> Hardware assisted breakpoint 3 at 0x7fffe8c0f066
> (gdb) cont
> Continuing.
>
> Breakpoint 3, 0x00007fffe8c0f066 in ?? () from XXX.so
> (gdb) set record full insn-number-max 10000000
> (gdb) record full
> (gdb) set scheduler-locking on
> (gdb) cont
> Continuing.
>
> Breakpoint 2, 0x00007fffe8ad361c in ?? () from XXX.so
> (gdb) info record
> Active record target: record-full
> Record mode:
> Lowest recorded instruction number is 1.
> Highest recorded instruction number is 5681093.
> Log contains 5681093 instructions.
> Max logged instructions is 10000000.
> (gdb) record save TOTOTATA
> warning: target file /proc/23553/cmdline contained unexpected null
> characters
> Couldn't get registers: No such process.
> (gdb) info record
> Active record target: record-full
> Segmentation fault


  reply	other threads:[~2014-01-22  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 13:32 Cedric Roux
2014-01-22  1:26 ` Hui Zhu [this message]
2014-01-22  3:11   ` Sergio Durigan Junior
2014-01-22 15:45     ` Cedric Roux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANFwon26TA-z0t5TNM4EJFHxA-Sr3cSZhc_-+y_Fn1OzpZ83-A@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=sed@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox