[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 14:48:36 PST 2015


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

> > We have various ways to alter the default behavior at link-time. 
>
> >  We can have a separate tool like that for abort_on_error. 
>
> >  E.g. a function that will check if we are in #2
>
>
> What do you mean by altering the behavior at link time?
>
> It's not how you build the binaries that differs. It's how you run them. You can have the same process that can be launched from command line and through launchd. I don't know how to restrict the set of these at link time. People can build with make, ninja, or xcodebuild, it should not matter. In all cases, we want to trigger the CrashReporter on OS X.


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.

> 

> 

> > Existing workflows is an important concern.

> 

> >  Not just our own workflows (where we can easily override the defaults) but also workflows of some unknown users.

> 

> 

> True. However, crashing on error is the right thing to do on OS X (in my opinion). It might be worth doing the switch and the sooner you do this the better (less people rely on the existing behavior). Also, it should be relatively easy for people to work around this. However, this most likely will break someone and this is a policy decision, so I can only offer an opinion.

> 

> > That thing I dislike even more. Such a change in lit will mean that tests running under lit and manually will behave differently

> 

> >  and that tests that use ASAN_OPTIONS=foo will have to be changed to ASAN_OPTIONS=$ASAN_OPTIONS=foo

> 

> 

> True. Dmitri G. suggested providing a different substitution for lit's "not" on darwin. Specifically, we would use "not crash" instead of "not". Kuba, I don't think we've explored this option before.


There is "not --crash"

> 

> 

> > What is "generating crashlogs"  and can that be disabled separately?

> 

> 

> CrashReporter is activated when a program receives a fatal termination signal. It cannot be disabled on per process/application bases and is enabled by default on Mac. Crashlogs are the reports generated by CrashReporter, which is the standard facility for logging information about crashed processes on OS X. It works for command line tools as well as daemons, apps automatically. CrashReporter will not work on processes that do not crash. This is why we believe, an ASan report should trigger CrashReporter and generate a crashlog. This is the first place Mac developers look at when there is a malfunction anywhere in the system.


So, we clearly do not want to have this in lit tests, 
but I also don't want the hack that disables changed the default ASAN_OPTIONS in lit.cfg (explained above)

> https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html



http://reviews.llvm.org/D7203

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






More information about the llvm-commits mailing list