[llvm-bugs] [Bug 31031] New: __cxa_demangle consumes 6.5Gb on "___Z2i_D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 15 20:40:42 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31031

            Bug ID: 31031
           Summary: __cxa_demangle consumes 6.5Gb on
                    "___Z2i_D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1
                    D1D1D1D1D1D1D"
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: kcc at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Feed "___Z2i_D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D"
into __cxa_demangle and watch it consume 6.5 Gb of RAM:

#include <stddef.h>
extern "C" char *
__cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status);


int main() {
 
__cxa_demangle("___Z2i_D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1D",
0, 0, 0);
}

clang++ -std=c++11 -g   cxa_demangle.cpp -I../include repro.cc -o repro

/usr/bin/time ./repro 
8.55user 2.41system 0:10.98elapsed 99%CPU (0avgtext+0avgdata
6557996maxresident)k


(found by libFuzzer, see also
https://bugs.chromium.org/p/chromium/issues/detail?id=606626)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161116/19641eba/attachment.html>


More information about the llvm-bugs mailing list