1) Explicitly provide important arguments to llvm-symbolizer,
not relying on defaults.
2) Be more defensive about symbolizer output.
This might fix weird failures on ninja-x64-msvc-RA-centos6 buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219541
91177308-0d34-0410-b5e6-
96231b3b80d8
- const char *args[] = {"llvm-symbolizer", nullptr};
+ const char *Args[] = {"llvm-symbolizer", "--functions=linkage", "--inlining",
+ "--demangle", nullptr};
- sys::ExecuteAndWait(LLVMSymbolizerPath, args, nullptr, Redirects.data());
+ sys::ExecuteAndWait(LLVMSymbolizerPath, Args, nullptr, Redirects.data());
if (RunResult != 0)
return false;
if (RunResult != 0)
return false;
// Read pairs of lines (function name and file/line info) until we
// encounter empty line.
for (;;) {
// Read pairs of lines (function name and file/line info) until we
// encounter empty line.
for (;;) {
+ if (CurLine == Lines.end())
+ return false;
StringRef FunctionName = *CurLine++;
if (FunctionName.empty())
break;
fprintf(FD, "#%d %p ", frame_no++, StackTrace[i]);
if (!FunctionName.startswith("??"))
fprintf(FD, "%s ", FunctionName.str().c_str());
StringRef FunctionName = *CurLine++;
if (FunctionName.empty())
break;
fprintf(FD, "#%d %p ", frame_no++, StackTrace[i]);
if (!FunctionName.startswith("??"))
fprintf(FD, "%s ", FunctionName.str().c_str());
+ if (CurLine == Lines.end())
+ return false;
StringRef FileLineInfo = *CurLine++;
if (!FileLineInfo.startswith("??"))
fprintf(FD, "%s", FileLineInfo.str().c_str());
StringRef FileLineInfo = *CurLine++;
if (!FileLineInfo.startswith("??"))
fprintf(FD, "%s", FileLineInfo.str().c_str());