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

Anna Zaks zaks.anna at gmail.com
Fri Mar 6 22:30:22 PST 2015


> 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.


Users might not run that app directly; for example, it can be executed from a shell script. There are all kinds of strange scenarios. I just saw a case of a shell script, which executes arch(1), which executes a tool, which presumably dlopen's an ASanified shared library. The stderr and stdin could be redirected; exit(1) can be interpreted in various ways. Crashing is much more reliable.

We do have weak functions, so those hooks are a fair game!

However, if I understand your solution correctly, it still requires private changes to clang/llvm. (We want this functionality in clang, not in a specific application we build with it.) Ex: who will link in the library? We'd need to:

- Make sure the library builds when we build clang.
- Change the driver to link the library into an ASanified binary. (Maybe this could be conditional on the presence of the library and go into mainline?)
- Tests would still be effected. We could only build this library in some special configuration, which is turned off during testing. However, in that case, we are not testing the final product.

I think the advantage here is that it would cause less merge conflicts, especially, if we want to diverge in multiple ways.


http://reviews.llvm.org/D7203

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






More information about the llvm-commits mailing list