This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug demangler/81684] Out of Memory in demangler


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]