From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12061 invoked by alias); 4 Jun 2009 00:52:36 -0000 Received: (qmail 12051 invoked by uid 22791); 4 Jun 2009 00:52:35 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,FB_WORD1_END_DOLLAR,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Jun 2009 00:52:29 +0000 Received: from zps37.corp.google.com (zps37.corp.google.com [172.25.146.37]) by smtp-out.google.com with ESMTP id n540qQGn017428 for ; Thu, 4 Jun 2009 01:52:26 +0100 Received: from localhost (ruffy.mtv.corp.google.com [172.18.118.116]) by zps37.corp.google.com with ESMTP id n540qOWn006516 for ; Wed, 3 Jun 2009 17:52:25 -0700 Received: by localhost (Postfix, from userid 67641) id 80922843FB; Wed, 3 Jun 2009 17:52:24 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [obv] (reread_symbols): Reset psymtabs_addrmap to NULL Message-Id: <20090604005224.80922843FB@localhost> Date: Thu, 04 Jun 2009 00:52:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00057.txt.bz2 Hi. Rerunning an executable after stripping it crashes gdb: gdb$ gcc -g hello.c -o hello.x64 gdb$ ./gdb -nx hello.x64 GNU gdb (GDB) 6.8.50.20090603-cvs Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux". For bug reporting instructions, please see: ... (gdb) start Temporary breakpoint 1 at 0x40049c: file hello.c, line 6. Starting program: /usr/local/g3/gnu/sourceware/addr-map-segv/build/obj64/gdb/hello.x64 Temporary breakpoint 1, main () at hello.c:6 6 printf ("Hello.\n"); (gdb) shell strip hello.x64 (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y `/usr/local/g3/gnu/sourceware/addr-map-segv/build/obj64/gdb/hello.x64' has changed; re-reading symbols. (no debugging symbols found) Starting program: /usr/local/g3/gnu/sourceware/addr-map-segv/build/obj64/gdb/hello.x64 (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) Segmentation fault gdb$ I traced it to a stray psymtabs_addrmap pointer. Checked in as obvious. 2009-06-03 Doug Evans * symfile.c (reread_symbols): Reset psymtabs_addrmap to NULL after discarding its contents. Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.229 diff -u -p -r1.229 symfile.c --- symfile.c 24 May 2009 12:27:35 -0000 1.229 +++ symfile.c 4 Jun 2009 00:46:57 -0000 @@ -2361,6 +2361,7 @@ reread_symbols (void) objfile->sections = NULL; objfile->symtabs = NULL; objfile->psymtabs = NULL; + objfile->psymtabs_addrmap = NULL; objfile->free_psymtabs = NULL; objfile->cp_namespace_symtab = NULL; objfile->msymbols = NULL;