[PATCH] D67847: [Support] make report_fatal_error `abort` instead of `exit`

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 17:20:11 PDT 2019


ychen added a comment.

In D67847#1677251 <https://reviews.llvm.org/D67847#1677251>, @rnk wrote:

> This has been proposed before by @MatzeB:
>  https://reviews.llvm.org/D33960
>
> At the time, there was an issue that some people had been "fixing" fuzzer bugs by replacing asserts with `if (cond) report_fatal_error(...);`. Moving to abort will reopen all of those fuzzer bugs. However, I think we have consensus that that is the desired behavior: every call to report_fatal_error is essentially a bug,. Code should be using the error handlers on MCContext and LLVMContext instead and recovering.


Thanks for the pointer, Reid. It feels to me that both versions of `report_fatal_error` have their practical value in the codebase. If the only known value of the `exit` version is to make the fuzzer happy, should we just make fuzzer not report abort version of `report_fatal_error`? This way we could encourage the correct error handling and not miss anything from the fuzzer side?

PS: I think ThinLTO is another case of `should not use report_fatal_error` in the first place.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67847/new/

https://reviews.llvm.org/D67847





More information about the llvm-commits mailing list