This is an archive of the discontinued LLVM Phabricator instance.

Enabled Backtraces with just ENABLE_BACKTRACES
AcceptedPublic

Authored by jmittert on Feb 26 2019, 5:12 PM.

Details

Reviewers
resistor
compnerd
Summary

Some platforms, e.g. Windows, support backtraces but don't have
BACKTRACE. Checking for BACKTRACE prevents Windows from having
backtraces.

Diff Detail

Event Timeline

jmittert created this revision.Feb 26 2019, 5:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2019, 5:12 PM
compnerd accepted this revision.Feb 26 2019, 6:32 PM
compnerd added a subscriber: compnerd.

This seems right, the Unix side will provide the same interfaces that do nothing in the case that the target doesn't support the backtrace API, and on Windows we provide the same interfaces using DbgHelp if we have access to it.

This revision is now accepted and ready to land.Feb 26 2019, 6:32 PM

Thanks! Can you commit this for me?

compnerd closed this revision.Feb 26 2019, 7:21 PM

SVN r354951

Hi!
This move will call AddSignalHandler and enable SetUnhandledExceptionFilter in llvm\lib\Support\Windows\signals.inc. In our application, llvm's component is called as a library , and the Unhandled Exception handler set in our application is over written by the llvm.
I think the application, not one of its components, should be responsible for application-wide error handling and reporting policy. Any libraries called from application should not permanently change global exception handler. This is reserved for application code (not the library code).
The llvm called as a library may change the exception handler temporarily, but must restore the handler before call finishes.
To sum up my point of view, permanently changing UnhandledExceptionFilter in library code is a bug that should be fixed

yifeihe reopened this revision.Sep 10 2019, 11:29 PM

Hi @compnerd !
This patch will enable exception filter in llvm, which is not a thing llvm should do, and introduced bugs in our application, I think we should revert or modify this patch.

This revision is now accepted and ready to land.Sep 10 2019, 11:29 PM

@yifeihe, you should be able to build with backtraces disabled to get the previous behaviour. The fact that the behaviour was a certain way previously was just an accident, not an explicit design point.