[Patch] Make errors and crashes distinct even with LLVM_DISABLE_CRASH_REPORT

Aaron Ballman aaron at aaronballman.com
Thu Jul 25 08:54:22 PDT 2013


Wow, this code is pretty old (r82537 by ddunbar)!  I'm not certain
removing it is the correct approach though -- the point to that is to
disable crash reporting, and by removing it, the crash dialogs will
appear again on system with post mortem debuggers installed.

On Windows, crashing really does exit much like exiting with a regular
error, IIRC.  The resulting code (checked with %ERRORLEVEL%) is
usually the exception code, but there's nothing magical about process
return values except for 0.

I'm CCing in some folks who may have an opinion.

~Aaron

On Thu, Jul 25, 2013 at 11:41 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> It looks like we went a bit too far with LLVM_DISABLE_CRASH_REPORT on
> windows. Some failures, like an assert(0) not only disable the crash
> reporting, they also make the program exit as if it was a regular
> error.
>
> This creates problems for enabling pipefail, as some tests would need
> "not --crash" on unix and just "not" on windows.
>
> The attached patch removes CRTReportHook. I don't claim to fully
> understand this, but the behavior looks like what we want:
>
> * check-all is clean
> * Without  LLVM_DISABLE_CRASH_REPORT  clang -cc1 will open the crash
> dialog when it crashes (#pragma clang __debug crash).
> * With  LLVM_DISABLE_CRASH_REPORT we will print a backtrace and no
> crash report shows up.
> * "not --crash" returns zero when it runs a crashing clang.
>
> Cheers,
> Rafael




More information about the llvm-commits mailing list