From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6345 invoked by alias); 22 Jan 2014 01:26:56 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 6324 invoked by uid 89); 22 Jan 2014 01:26:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f180.google.com Received: from mail-ob0-f180.google.com (HELO mail-ob0-f180.google.com) (209.85.214.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 22 Jan 2014 01:26:54 +0000 Received: by mail-ob0-f180.google.com with SMTP id wp4so4449701obc.25 for ; Tue, 21 Jan 2014 17:26:52 -0800 (PST) X-Received: by 10.182.126.167 with SMTP id mz7mr72510obb.69.1390354012347; Tue, 21 Jan 2014 17:26:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.172.241 with HTTP; Tue, 21 Jan 2014 17:26:12 -0800 (PST) In-Reply-To: <52DE76B2.3070302@free.fr> References: <52DE76B2.3070302@free.fr> From: Hui Zhu Date: Wed, 22 Jan 2014 01:26:00 -0000 Message-ID: Subject: Re: "record save" failure To: Cedric Roux Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00021.txt.bz2 Prec didn't support multithread. Thanks, Hui On Tue, Jan 21, 2014 at 9:31 PM, Cedric Roux 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=E9dric. > > 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