Summary: | Crash when loading symbols from C++11 / gcc 4.7 binary | ||
---|---|---|---|
Product: | gdb | Reporter: | Kenton Varda <temporal> |
Component: | c++ | Assignee: | Tom Tromey <tromey> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | temporal, tromey |
Priority: | P2 | ||
Version: | 7.4 | ||
Target Milestone: | 7.5 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | Binary which causes gdb to crash on load (linux/x86_64) |
Description
Kenton Varda
2012-05-06 19:04:48 UTC
Ugh, when I said gdb 4.7/4.7.1 I of course meant gdb 7.4/7.4.1... It's a bug in the demangler. Valgrind shows: barimba. echo _ZN4modc6parser8sequenceINS_9astParser13LocatedParserINS0_9ParserRefINS2_UlRNS2_16TokenParserInputEE_EEEEEINS0_14OptionalParserINS2_18ListParserTemplateILNS_6tokens5Token4TypeE4EXadL_ZNSD_Ut_13parenthesizedEEEE6ParserINS4_INS0_6ParserIS5_NS_3ast10ExpressionEEEEEEEEENSA_INS4_INS2_22OneOfKeywordsToTParserINSJ_5StyleEEEEEEENS0_14SequenceParserIS5_INS0_18ExactElementParserIS5_EENSA_ISM_EEEEENS0_14RepeatedParserINS4_INS0_15TransformParserINSU_IS5_INS4_INSP_INSJ_10Annotation12RelationshipEEEEESX_EEENS2_UlNS2_3LocES12_ONS_5MaybeISK_EEE19_EEEEELb0EEEEEENSU_INS0_17ExtractParserTypeIT_E9InputTypeEINS0_8MaybeRefIS1F_E4TypeEDpNS1I_IT0_E4TypeEEEEOS1F_DpOS1L_ | valgrind --num-callers=50 ~/gnu/archer/build/libiberty/demangle ==2911== Memcheck, a memory error detector ==2911== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==2911== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==2911== Command: /home/tromey/gnu/archer/build/libiberty/demangle ==2911== ==2911== Conditional jump or move depends on uninitialised value(s) ==2911== at 0x405925: d_find_pack (cp-demangle.c:3697) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x405A25: d_find_pack (cp-demangle.c:3731) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x4059FD: d_find_pack (cp-demangle.c:3728) ==2911== by 0x407D49: d_print_comp (cp-demangle.c:4659) ==2911== by 0x406F53: d_print_comp (cp-demangle.c:4336) ==2911== by 0x406FEC: d_print_comp (cp-demangle.c:4348) ==2911== by 0x406F53: d_print_comp (cp-demangle.c:4336) ==2911== by 0x406FEC: d_print_comp (cp-demangle.c:4348) ==2911== by 0x406171: d_print_comp (cp-demangle.c:3947) ==2911== by 0x406B0B: d_print_comp (cp-demangle.c:4206) ==2911== by 0x405F8E: d_print_comp (cp-demangle.c:3894) ==2911== by 0x4057A0: cplus_demangle_print_callback (cp-demangle.c:3611) ==2911== by 0x408FE6: d_demangle_callback (cp-demangle.c:5240) ==2911== by 0x40903B: d_demangle (cp-demangle.c:5261) ==2911== by 0x4090A5: cplus_demangle_v3 (cp-demangle.c:5418) ==2911== by 0x409601: main (cp-demangle.c:5667) ==2911== Submitted a patch. Fixed. But note if you are checking out from the gdb cvs repository, you will have to wait until the file is sync'd from gcc svn. The change you want is this one, from libiberty: 2012-05-22 Tom Tromey <tromey@redhat.com> http://sourceware.org/bugzilla/show_bug.cgi?id=14065 * testsuite/demangle-expected: Add regression test. * cp-demangle.c (d_find_pack): Return NULL for DEMANGLE_COMPONENT_UNNAMED_TYPE. Thanks for the fix! |