From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8048 invoked by alias); 6 Jul 2004 20:59:07 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8027 invoked from network); 6 Jul 2004 20:59:06 -0000 Received: from unknown (HELO e33.co.us.ibm.com) (32.97.110.131) by sourceware.org with SMTP; 6 Jul 2004 20:59:06 -0000 Received: from westrelay03.boulder.ibm.com (westrelay03.boulder.ibm.com [9.17.195.12]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i66Kx4ZK675044 for ; Tue, 6 Jul 2004 16:59:04 -0400 Received: from austin.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay03.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i66KwR6G357958 for ; Tue, 6 Jul 2004 14:59:03 -0600 Received: from lazy.austin.ibm.com (lazy.austin.ibm.com [9.53.94.97]) by austin.ibm.com (8.12.10/8.12.10) with ESMTP id i66HL6Kw040688 for ; Tue, 6 Jul 2004 12:21:06 -0500 Date: Tue, 06 Jul 2004 20:59:00 -0000 From: Manoj Iyer X-X-Sender: manjo@lazy To: gdb@sources.redhat.com Subject: GDB mainline segfaults on 32bit threaded program. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-07/txt/msg00051.txt.bz2 GDB (mainline cvs) built 32bit on ppc64 machine running sles9 dumps core on a multithreaded program. gdb segfaults only when I set a breakpoint on the thread fucntion and decide to stop there. 1. cc -o tbug_dwarf2 tbug.c -g dwarf-2 -lpthread 2. gdb tbug_dwarf2 3. br main 4. br tf 5. run <---- segfalts here 6. c Attached is a testcase that can re-create this problem "tbug.c" I used GDB to debug this core produced, here is the backtrace... #0 0x0fe05694 in strcmp () from /lib/tls/libc.so.6 #1 0x100cfba8 in lookup_symtab (name=0xffffc360 "/root/manjo/tbug.c") at symtab.c:185 #2 0x100d9254 in symtab_from_filename (argptr=0xffffc480, p=0x104caafa ":tf", is_quote_enclosed=0, not_found_ptr=0x0) at linespec.c:1523 #3 0x100d99c4 in decode_line_1 (argptr=0xffffc480, funfirstline=1, default_symtab=0x0, default_line=0, canonical=0x0, not_found_ptr=0x0) at linespec.c:744 #4 0x100a432c in breakpoint_re_set_one (bint=0x104ca958) at breakpoint.c:7157 #5 0x10051748 in do_catch_errors (uiout=0x104ca958, data=0x0) at top.c:524 #6 0x10053d20 in catcher (func=0x1005172c , func_uiout=0x104712c8, func_args=0xffffc848, func_val=0xffffc850, func_caught=0xffffc854, errstring=0x7f7f7f7f
, gdberrmsg=0x0, mask=6) at top.c:431 #7 0x10053d80 in catch_errors (func=0xffffc2f0, func_args=0x104cbeb8, errstring=0x7f7f7f7f
, mask=0) at top.c:536 #8 0x100a2b14 in breakpoint_re_set () at breakpoint.c:7340 #9 0x100d2bd4 in new_symfile_objfile (objfile=0x104ca958, mainline=0, verbo=0) at symfile.c:741 #10 0x100d4634 in symbol_file_add_with_addrs_or_offsets (abfd=0x104d0220, from_tty=0, addrs=0x0, offsets=0x0, num_offsets=0, mainline=0, flags=8) The macro FILENAME_CMP in symtab.c:185 uses the strcmp to do the comparison, symtab_to_fullname() function returns NULL for s->fullname and this causes strcmp to segfault. Although syntab.c:185 checks if full_path != NULL but it does not check if const char *fp = symtab_to_fullname (s); is not equal to NULL. I dont know what causes symtab_to_fullname() to return NULL. Thanks Manoj Iyer