]> granicus.if.org Git - llvm/commit
[Support] Ignore OutputDebugString exceptions in our crash recovery.
authorZachary Turner <zturner@google.com>
Tue, 16 May 2017 22:50:32 +0000 (22:50 +0000)
committerZachary Turner <zturner@google.com>
Tue, 16 May 2017 22:50:32 +0000 (22:50 +0000)
commit8d124b04c8477843d99c5d5512d0ff3b0325f20f
tree63a8a597e0d5b002345921cc0329d6a9b1bab516
parent40240a1e6be1ae6e19d244152df5293d2f91f10c
[Support] Ignore OutputDebugString exceptions in our crash recovery.

Since we use AddVectoredExceptionHandler, we get notified of
every exception that gets raised by a program.  Sometimes these
are not necessarily errors though, and this can be especially
true when linking against a library that we have no control
over, and may raise an exception internally which it intends
to catch.

In particular, the Windows API OutputDebugString does exactly
this.  It raises an exception inside of a __try / __except,
giving the debugger a chance to handle the exception to print
the message to the debug console.

But this doesn't interoperate nicely with our vectored exception
handler, which just sees another exception and decides that we
need to terminate the program.

Add a special case for this so that we ignore ODS exceptions
and continue normally.

Note that a better fix is to simply not use vectored exception
handlers and use SEH instead, but given that MinGW doesn't support
SEH, this is the only solution for MinGW.

Differential Revision: https://reviews.llvm.org/D33260

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303219 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/CrashRecoveryContext.cpp