Summary: | crash in quirk_gcc_member_function_pointer (dwarf2read.c) | ||
---|---|---|---|
Product: | gdb | Reporter: | Keith Seitz <keiths> |
Component: | symtab | Assignee: | Tom Tromey <tromey> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gdb-prs, tromey |
Priority: | P2 | ||
Version: | unknown | ||
Target Milestone: | 7.1 | ||
Host: | i386-unknown-linux | Target: | i386-unknown-linux |
Build: | i386-unknown-linux | Last reconfirmed: | 2010-01-21 21:51:16 |
Description
Keith Seitz
2010-01-20 20:13:57 UTC
On F11, a simpler reproducer: gdb -readnow /usr/lib/debug/usr/lib/libmathview_frontend_libxml2.so.0.8.0.debug The problem is that we somehow get a recursive call to quirk_gcc_member_function_pointer. The inner call crashes because it find the type of __pfn, but the function type's first argument does not yet have a type. I was unable to make a simpler test case :( The only fix I can think of is pretty ugly: change read_structure_type to smash the resulting type to a pointer-to-member type after the fact. That is, don't call the quirk function until the structure type has been made. Interestingly, backing out this patch works around the bug: 2009-12-15 Gaius Mulley <gaius@glam.ac.uk> * dwarf2read.c (read_subroutine_type): Add the subroutine type to the die immediately to allow a parameter type to be the same subroutine type. This may explain why we never ran into this before. FYI, I have a patch for this that I will submit soon. Still no reproducer suitable for inclusion in the test suite :( Subject: Bug 11199 CVSROOT: /cvs/src Module name: src Changes by: tromey@sourceware.org 2010-01-22 17:06:49 Modified files: gdb : ChangeLog dwarf2read.c gdbtypes.c gdbtypes.h gdb/testsuite : ChangeLog Added files: gdb/testsuite/gdb.dwarf2: member-ptr-forwardref.S member-ptr-forwardref.exp Log message: gdb PR symtab/11199: * dwarf2read.c (quirk_gcc_member_function_pointer): Change return type and arguments. Use smash_to_methodptr_type. (read_structure_type): Call quirk_gcc_member_function_pointer later. * gdbtypes.h (smash_to_methodptr_type): Declare. * gdbtypes.c (smash_to_methodptr_type): New function. (lookup_methodptr_type): Use it. gdb/testsuite 2010-01-22 Jan Kratochvil <jan.kratochvil@redhat.com> PR symtab/11199: * gdb.dwarf2/member-ptr-forwardref.exp, gdb.dwarf2/member-ptr-forwardref.S: New. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11285&r2=1.11286 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.350&r2=1.351 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/gdbtypes.c.diff?cvsroot=src&r1=1.184&r2=1.185 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/gdbtypes.h.diff?cvsroot=src&r1=1.120&r2=1.121 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2098&r2=1.2099 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.S.diff?cvsroot=src&r1=NONE&r2=1.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp.diff?cvsroot=src&r1=NONE&r2=1.1 Fix checked in. |