Increase size of demangled symbol buffer
authorMark Drayton <markdrayton@fb.com>
Fri, 31 Oct 2014 20:42:40 +0000 (13:42 -0700)
committerPavlo Kushnir <pavlo@fb.com>
Sat, 8 Nov 2014 02:25:50 +0000 (18:25 -0800)
Summary:
Symbols which demangle to a string longer than 1024 bytes are
quite common in our code. This diff increases the size of the output
buffer to accommodate them.

Test Plan: run it

Reviewed By: lucian@fb.com

Subscribers: trunkagent, njormrod, folly-diffs@

FB internal diff: D1639801

Tasks: 5464222

Signature: t1:1639801:1414784601:2f59d5a58e434f4cf9df5b25b917c5094c8b133f

folly/experimental/symbolizer/Symbolizer.cpp

index 535193324fa0fa328838376d7dcef7c8b3508220..f89c6f414bfac929e016e170cbd66dd548004ac7 100644 (file)
@@ -311,7 +311,7 @@ void SymbolizePrinter::print(uintptr_t address, const SymbolizedFrame& frame) {
   if (!frame.name || frame.name[0] == '\0') {
     doPrint(" (unknown)");
   } else {
-    char demangledBuf[1024];
+    char demangledBuf[2048];
     demangle(frame.name, demangledBuf, sizeof(demangledBuf));
     doPrint(" ");
     doPrint(demangledBuf[0] == '\0' ? frame.name : demangledBuf);
@@ -383,7 +383,7 @@ void SymbolizePrinter::println(uintptr_t address,
 void SymbolizePrinter::printTerse(uintptr_t address,
                                   const SymbolizedFrame& frame) {
   if (frame.found && frame.name && frame.name[0] != '\0') {
-    char demangledBuf[1024] = {0};
+    char demangledBuf[2048] = {0};
     demangle(frame.name, demangledBuf, sizeof(demangledBuf));
     doPrint(demangledBuf[0] == '\0' ? frame.name : demangledBuf);
   } else {