On Windows certain function from Signals.h require that DbgHelp.dll is loaded. This typically happens when the main program calls llvm::InitLLVM, however in some cases main program doesn't do that (e.g. when the application is using LLDB via liblldb.dll). This patch adds a safe guard to prevent crashes. More discussion in
https://reviews.llvm.org/D119009.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Do you think you can add a unit test (in SupportTests) that demonstrates the issue before your patch?
Comment Actions
Maybe take a look at llvm/unittests/Support/ProgramTest.cpp (for example TestExecuteAndWaitTimeout). You should be able to start the executable again with an extra env. variable which prevents the call to PrintStackTraceOnErrorSignal in llvm/utils/unittest/UnitTestMain/TestMain.cpp.
Comment Actions
I've added a test and verified that on Windows it fails without the safeguard in Signals.inc. Thanks for the pointer!
Comment Actions
LGTM with a comment:
llvm/utils/unittest/UnitTestMain/TestMain.cpp | ||
---|---|---|
25–30 | I think it's more desirable to not have an empty block. You could could do if (!getenv...) and add the comment above the if statement. |
I think it's more desirable to not have an empty block. You could could do if (!getenv...) and add the comment above the if statement.