From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8448 invoked by alias); 23 Jun 2006 10:37:49 -0000 Received: (qmail 8438 invoked by uid 22791); 23 Jun 2006 10:37:48 -0000 X-Spam-Check-By: sourceware.org Received: from ip-85-160-32-69.eurotel.cz (HELO host0.dyn.jankratochvil.net) (85.160.32.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 23 Jun 2006 10:37:44 +0000 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.13.6/8.13.4) with ESMTP id k5NAba4Z028446 for ; Fri, 23 Jun 2006 12:37:37 +0200 Received: (from lace@localhost) by host0.dyn.jankratochvil.net (8.13.6/8.13.6/Submit) id k5NAbZAK028445 for gdb-patches@sources.redhat.com; Fri, 23 Jun 2006 12:37:35 +0200 Date: Fri, 23 Jun 2006 10:37:00 -0000 From: Jan Kratochvil To: gdb-patches@sources.redhat.com Subject: [patch] Fix gdb crash on some missing ELF debug info Message-ID: <20060623103735.GA28356@host0.dyn.jankratochvil.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00354.txt.bz2 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 610 Hi, https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196439 On Fedora Core 5: gdb /usr/lib/valgrind/x86-linux/memcheck break _start_in_C run segfaults as the file's debug info references location list while no ".debug_loc" section exists there. eu-readelf -w /usr/lib/valgrind/x86-linux/memcheck DWARF section '.debug_info' at offset 0x14759c: ... [ 176d4] subprogram ... name "_start_in_C" ... frame_base location list [ 116d7] Trivia complaint on the file coherency, no frame_info debugging available for such functions. Regards, Jan Kratochvil --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="gdb-cvs20060623-debug_loc.patch" Content-length: 1195 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196439 Fedora Core 5: gdb /usr/lib/valgrind/x86-linux/memcheck break _start_in_C run segfault eu-readelf -w /usr/lib/valgrind/x86-linux/memcheck DWARF section '.debug_info' at offset 0x14759c: ... [ 176d4] subprogram ... name "_start_in_C" ... frame_base location list [ 116d7] corrupted as no location lists (.debug_loc) exist there at all. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.199 diff -u -p -r1.199 dwarf2read.c --- dwarf2read.c 14 Jun 2006 15:06:35 -0000 1.199 +++ dwarf2read.c 23 Jun 2006 10:28:44 -0000 @@ -9324,7 +9324,9 @@ static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) { - if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) + if ((attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) + /* DW_UNSND (attr) != 0 would produce non-zero bogus ->size & ->data */ + && dwarf2_per_objfile->loc_size) { struct dwarf2_loclist_baton *baton; --3V7upXqbjpZ4EhLz--