[Bug libstdc++/96345] New: __cxa demangle fails to demangle a very long string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96345 Bug ID: 96345 Summary: __cxa demangle fails to demangle a very long string Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hededrk at gmail dot com Target Milestone: --- I found this bug because one of my tests started to fail (not sure when it started to fail because I've set up CI only yesterday). I assume this is a bug because GCC is able to produce such names. Steps to reproduce: 1. compile attached file g++ -c cxa_demangle_fail.cpp 2. obtain mangled name with nm nm cxa_demangle_fail.o 3. pass that name into abi::__cxa_demangle auto name = /*long string*/; size_t size = 1024; auto memory = static_cast(malloc(size)); int status; auto demangled = abi::__cxa_demangle(name, memory, &size, &status); Result: __cxa_demangle fails with code -2.
[Bug libstdc++/96345] __cxa demangle fails to demangle a very long string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96345 --- Comment #1 from V --- Created attachment 48936 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48936&action=edit failing example
[Bug libstdc++/96345] __cxa demangle fails to demangle a very long string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96345 --- Comment #2 from V --- Created attachment 48937 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48937&action=edit function with name that __cxa_demangle rejects
[Bug libstdc++/96345] __cxa demangle fails to demangle a very long string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96345 --- Comment #4 from V --- No, c++filt also does not demangle it.
[Bug libstdc++/96345] __cxa demangle fails to demangle a very long string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96345 --- Comment #5 from V --- (In reply to Andrew Pinski from comment #3) > Does c++filt demangle it? I've fed output of nm into c++filt and this function came out mangled, while others were demangled.
[Bug demangler/96345] __cxa demangle fails to demangle a very long string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96345 V changed: What|Removed |Added Version|10.1.0 |12.1.1 Host||x86_64 Target||x86_64 --- Comment #6 from V --- Still fails as of GCC 12.1. I've shortened the input string, it fails with names longer than 999 characters.