public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/22268] New: libiberty demanger crashes on (invalid) mangled name
@ 2005-07-01 13:24 sb at biallas dot net
  2005-07-01 15:11 ` [Bug other/22268] " sb at biallas dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sb at biallas dot net @ 2005-07-01 13:24 UTC (permalink / raw)
  To: gcc-bugs

I use the libiberty c++ name demangler for unmangling symbols. Since I don't
know whether the symbols are really mangled, the demangler will sometimes see
names which are either mangled with a completely different mangler or even not
mangled at all. 

This is quite a good stress test for the demangler and I've encountered a symbol
name on which it fails (crashes). The symbol is "ALsetchannels" which will be
regarded as an array type ('A') with exp-primary ('L'). But the exp-primary
end-marker ('E') is missing, this will result in an endless loop in
d_expr_primary(): 

2337  while (d_peek_char (di) != 'E')
2338	d_advance (di, 1);

Example program showing crash (or other undefined behaviour):

#include "demangle.h"
int main()
{
cplus_demangle_v3("ALsetchannels", DMGL_PARAMS | DMGL_ANSI | DMGL_TYPES);
return 0;
}

-- 
           Summary: libiberty demanger crashes on (invalid) mangled name
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sb at biallas dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22268


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-01 16:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-01 13:24 [Bug other/22268] New: libiberty demanger crashes on (invalid) mangled name sb at biallas dot net
2005-07-01 15:11 ` [Bug other/22268] " sb at biallas dot net
2005-07-01 15:24 ` pinskia at gcc dot gnu dot org
2005-07-01 16:39 ` cvs-commit at gcc dot gnu dot org
2005-07-01 16:42 ` ian at airs dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).