From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21647 invoked by alias); 23 Mar 2015 19:56:56 -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 21319 invoked by uid 55); 23 Mar 2015 19:56:56 -0000 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/18021] Segfault in dwarf2_add_member_fn Date: Mon, 23 Mar 2015 22:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.9 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: keiths at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-q1/txt/msg00475.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18021 --- Comment #5 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Keith Seitz : https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e993ebf2343a5b39d6d1df29fdebc2818064ae5 commit 7e993ebf2343a5b39d6d1df29fdebc2818064ae5 Author: Keith Seitz Date: Fri Feb 27 09:55:07 2015 -0800 PR gdb/18021 - defend against "static virtual" methods This bug appears to be caused by bad debuginfo. The method causing the sefault in the reporter's test case is marked both static and virtual. This patch simply safegaurds against this case in dwarf2_add_member_fn, where the code assumes that there is a `this' pointer when a virtual method is seen (more specifically, when DW_AT_vtable_elem is seen). It previously dereferenced the first formal parameter (`this' pointer), which in this case doesn't exist. GDB consequently segfaulted dereferencing a NULL pointer. gdb/ChangeLog PR gdb/18021 * dwarf2read.c (dwarf2_add_member_fn): Issue a complaint if we find a static method with DW_AT_vtable_elem_location. gdb/testsuite/ChangeLog PR gdb/18021 * gdb.dwarf2/staticvirtual.exp: New test. -- You are receiving this mail because: You are on the CC list for the bug.