From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29857 invoked by alias); 24 Jun 2008 17:03:15 -0000 Received: (qmail 29842 invoked by uid 22791); 24 Jun 2008 17:03:14 -0000 X-Spam-Check-By: sourceware.org Received: from f10.mail.ru (HELO f10.mail.ru) (194.67.57.130) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jun 2008 17:02:53 +0000 Received: from mail by f10.mail.ru with local id 1KBBur-000BXf-00 for gdb@sourceware.org; Tue, 24 Jun 2008 21:02:49 +0400 Received: from [212.92.145.7] by win.mail.ru with HTTP; Tue, 24 Jun 2008 21:02:49 +0400 From: Dmitry Smirnov To: gdb@sourceware.org Subject: =?koi8-r?Q?Re=3A_How_to_catch_GDB_crash?= Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 Date: Tue, 24 Jun 2008 17:03:00 -0000 Reply-To: Dmitry Smirnov Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: X-Spam: Not detected X-Mras: OK X-IsSubscribed: yes 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 X-SW-Source: 2008-06/txt/msg00241.txt.bz2 Finally, I was able to gather some logs from Cygwin GDB. For this, I've switched debug configuration in Eclipse from gdbServer to Cygwin GDB. It differs in how it starts the program. gdbServer connects to remote target by itself, whereas Cygwin GDB allows me to do it manually from its console. Below is the log. I've set additional breakpoint at mi_execute_command to see what coommands are issued by Eclipse. As you can see, first time mi_on_resume is called with ptid={pid = -1, lwp = 0, tid = 0}. Something happens between this call and second call where ptid={pid = 42000, lwp = 0, tid = 0}. I'm going to figure out which command is followed by wrong pid. I'm suspecting memory corruption. I have to note that I didn't see some of these commands while debugging gdbServer as a Java code (CDT debugger) from Eclipse. I've seen the following commands that are common for both cases: info threads -stack-info-depth -stack-list-frames -data-list-changed-registers -stack-list-arguments 0 0 0 info signal SIGHUP -data-disassemble -f -l 333 -n 100 -- 1 -data-disassemble -s 0x8c4a8e -e 0x8c4af2 -- 0 -stack-list-locals 0 I will try to simulate these command with console (do not use Eclipse), so if you know equivalent commands for GDB console, please let me know. BTW, command 'info threads' gives me (gdb) info threads warning: RMT ERROR : failed to get remote thread list. Dmitry (gdb) attach 4760 Attaching to program `/cygdrive/d/Install/GDB/gdb-6.8.50.20080620/gdb-6.8.50.200 80620/gdb/gdb.exe', process 4760 [Switching to thread 4760.0xcbc] (gdb) ni 0x7c9507a8 in ntdll!KiIntSystemCall () from /c/WINDOWS/system32/ntdll.dll (gdb) 0x7c9507bb in ntdll!KiIntSystemCall () from /c/WINDOWS/system32/ntdll.dll (gdb) 0x7c9507bf in ntdll!KiIntSystemCall () from /c/WINDOWS/system32/ntdll.dll (gdb) 0x7c9507c1 in ntdll!KiIntSystemCall () from /c/WINDOWS/system32/ntdll.dll (gdb) [Switching to thread 4760.0x1150] Breakpoint 5, mi_execute_command ( cmd=0x113a4610 "182-interpreter-exec console \"info b\"", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command (cmd=0x1392c8c8 "183-exec-continue", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 4, mi_on_resume (ptid={pid = -1, lwp = 0, tid = 0}) at .././gdb/mi/mi-interp.c:335 335 if (PIDGET (ptid) == -1) (gdb) c Continuing. Breakpoint 5, mi_execute_command (cmd=0x138c2700 "184 info threads", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command (cmd=0x13931a38 "185-stack-info-depth", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command ( cmd=0x10d2abf0 "186-stack-list-frames 0 11", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command ( cmd=0x10c3d120 "187-data-list-changed-registers", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command (cmd=0x10c3d2c0 "188 info sharedlibrary", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command (cmd=0x10cfd660 "189 info signal SIGHUP", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 5, mi_execute_command ( cmd=0x1144e0a8 "190-data-disassemble -f -l 333 -n 100 -- 1", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x10d438b8 "191-stack-list-arguments 0 0 0", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x10d2a770 "192-data-disassemble -s 0x8c4a8e -e 0x8c4af2 -- 0", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command (cmd=0x10d2a820 "193-stack-list-locals 0", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command (cmd=0x10d2a8d0 "194 whatis i", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command (cmd=0x10f3ea98 "195 whatis rt_status", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command (cmd=0x10f34780 "196 whatis __result", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command (cmd=0x10f3e748 "197-var-create - * i", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x10f39150 "198-var-evaluate-expression var1", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x1131f9e8 "199-var-create - * rt_status", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x11244350 "200-var-evaluate-expression var2", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x1127bb70 "201-var-create - * __result", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x1127bdc8 "202-var-evaluate-expression var3", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) Continuing. Breakpoint 5, mi_execute_command ( cmd=0x112d6500 "203-exec-next-instruction 1", from_tty=1) at .././gdb/mi/mi-main.c:1135 1135 { (gdb) c Continuing. Breakpoint 4, mi_on_resume (ptid={pid = 42000, lwp = 0, tid = 0}) at .././gdb/mi/mi-interp.c:335 335 if (PIDGET (ptid) == -1) (gdb) c Continuing. Breakpoint 2, 0x61084819 in cygwin1!abort () from /usr/bin/cygwin1.dll (gdb)