This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug demangler/81684] Out of Memory in demangler
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Aug 2017 08:45:40 +0000
- Subject: [Bug demangler/81684] Out of Memory in demangler
- Auto-submitted: auto-generated
- References: <bug-81684-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81684
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |UNCONFIRMED
Ever confirmed|1 |0
--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
None of the submitted demangler bugs are reproducible when using
the libiberty demangler directly. So these should all be moved to
the sourceware.org/bugzilla.
To test libiberty directly you can use something like:
trippels@gcc2-power8 ~ % cat fuzz.cpp
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
extern "C" char* cplus_demangle_v3(const char *mangled, int options);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
char *str = new char[size + 1];
memcpy(str, data, size);
str[size] = 0;
free(cplus_demangle_v3(str, 19 /* DMGL_PARAMS | DMGL_ANSI | DMGL_TYPES */));
delete[] str;
return 0;
}
trippels@gcc2-power8 ~ % clang++ -O2 -g -fsanitize-coverage=trace-pc-guard
-fsanitize=address -pthread fuzz.cpp ~/Fuzzer/libFuzzer.a ./libiberty.a
(after configuring and building in gcc/libiberty to get libiberty.a).