From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8534 invoked by alias); 21 Jan 2014 13:32: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 8522 invoked by uid 89); 21 Jan 2014 13:32:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: smtp1-g21.free.fr Received: from smtp1-g21.free.fr (HELO smtp1-g21.free.fr) (212.27.42.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2014 13:32:54 +0000 Received: from [192.168.1.12] (unknown [86.193.110.90]) (Authenticated sender: sed) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 11924940150 for ; Tue, 21 Jan 2014 14:32:47 +0100 (CET) Message-ID: <52DE76B2.3070302@free.fr> Date: Tue, 21 Jan 2014 13:32:00 -0000 From: Cedric Roux User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: gdb@sourceware.org Subject: "record save" failure Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00020.txt.bz2 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