[PATCH] [compiler-rt] Turn abort_on_error=1 by default on OS X (part 1/2)

Kostya Serebryany kcc at google.com
Fri Mar 6 17:40:47 PST 2015


In http://reviews.llvm.org/D7203#135893, @zaks.anna wrote:

> > How about altering the default at run-time? 
>
> >  If you someone recognize that you are running via launchd, enable abort_on_error
>
> >  That would sounds reasonable to me.
>
>
> That'd be confusing to the user. Someone launches the app from the dock, the app crashes. They launch the same app from command line, it does not. Having consistency and generating a crashlog is the most user friendly behavior.


consistency is good, but here I don't buy this argument completely. 
If one runs the app from command line, the app will not just exit(1) but it will also print tons of stuff to the console -- hard to miss.

> You are right, "not --crash" will slow down testing. I did not think about this right away.

> 

> The only other idea I have is to use an altered run command (ex: "%run_under_san" or "%set_asan_options %run") that would include ASAN_OPTIONS in its expansion. All tests would have to adopt it, but it would make tests running under lit and manually behave the same.


Too complex. (requires lots of test changes and then more complex manual runs).

Again, I propose you a solution that will allow you to have abort_on_error=1 (always, or only for some cases)
w/o a) affecting everyone else upstream b) changing tests and c) requiring you to keep separate branch.

We can define a weak hook __asan_default_abort_on_error and you will simply link with a module that defines this hook to return 1;
(Err.. Do we have weak functions on Mac? If not, we'll need to invent other mechanism to  override defaults on Mac)
See what we are doing with __asan_default_options or __asan_default_suppressions.
It's a good idea to have such hooks on Mac anyway if we don't have them yet.


http://reviews.llvm.org/D7203

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list