From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24689 invoked by alias); 3 Sep 2015 16:55:42 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 24655 invoked by uid 48); 3 Sep 2015 16:55:42 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/18903] GDB crashes upon reading debug info Date: Thu, 03 Sep 2015 16:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: 7.10 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q3/txt/msg00247.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18903 dje at google dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dje at google dot com --- Comment #2 from dje at google dot com --- The attached patch is close. There's a preceding reference to name that also needs to be protected. Here's the definition of set_main_name from 7.6 (I didn't have 7.7 readily available). void set_main_name (const char *name) { if (name_of_main != NULL) { xfree (name_of_main); name_of_main = NULL; language_of_main = language_unknown; } if (name != NULL) { name_of_main = xstrdup (name); language_of_main = language_unknown; } } I think the thing to do is rewrite set_objfile_main_name to have the same semantics. [Can't free something from an obstack of course, but otherwise keep the same semantics.] -- You are receiving this mail because: You are on the CC list for the bug.