bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

infinite loop in ld (libiberty.a:cplus-dem.c)


From: Keenan Forbes
Subject: infinite loop in ld (libiberty.a:cplus-dem.c)
Date: Thu, 16 May 2002 13:21:52 -0700

Hi-
        I've encountered an infinite loop in ld. I've tracked it down to code in
libiberty.a, in particular, cplus-dem.c:demangle_arm_hp_template(). I'm not
really sure what the correct fix is since I don't have a very full
understanding of how the code is meant to work, but hopefully someone more
familiar with the code will have more luck. One possibility would be to
break out of the "while (args < e)" loop if args doesn't change... hopefully
there's a more correct fix that ensures that args changes on each iteration
:-)

This shows up when passing names mangled by the EDG front end into the
linker when producing map files (ld -M). Below is a very simple program that
exhibits the bug (I've included the original EDG symbol, but have stripped
it down into a shorter name that still reproduces the problem). The
following command line will reproduce the bug:

        gcc -Wl,-M foo.c

The linker gets into an infinite loop trying to demangle the symbol. I think
this should be target independent, but I've bee testing with native i386
linux on a RedHat 7.2 distribution (gcc --version: 2.96). I've verified the
problem in the following two linkers:
        ld --version: GNU ld 2.11.90.0.8
        ld --version: GNU ld version 2.12 (which is the one I debugged)

--Keenan

========================== foo.c ============================

/*
This is closer to the original symbol, produced from EDG's mangler
        std::vector<std::map<std::string, int>> vm;
int
__CPR589__Min__Q2_3std394_Tree__tm__380_Q2_3std369_Tmap_traits__tm__348_Q2_3
std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std18allocator__
tm__2_ciQ2_3std100less__tm__88_Q2_3stdJ70JQ2_3std131allocator__tm__113_Q2_3s
td102pair__tm__90_CQ2_3stdJ70JiXCbL_1_0SFQ5_Z1Z14allocator_type50rebind__tm_
_36_Q3_3std20_Tree_nod__tm__4_Z1Z5_Node5other7pointer_QJ413J4allocator_typeJ
434JJ486JJ492J () {}
*/

int
M__tm__2__1X100less__tm__88_Q2_3stdJ70JQ2_3std131allocator__tm__113_Q2_3std1
02pair__tm__90_CQ2_3stdJ70JiXCbL_1_0SFQ;

int main() { return 0;}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]