[compiler-rt] [compiler-rt] Write ASAN/TSAN reports to a global for crash reporting (PR #200526)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun May 31 21:30:29 PDT 2026


vitalybuka wrote:

> > What is Apple special here? Please try to build generic version.
> 
> Do other platforms have a use-case for storing report information to a global? The solution here _is_ completely generic: it can be added to other platforms simply by removing the `SANITIZER_APPLE` guards (and I'd probably want to remove `Darwin` from the function names).

ErrorDescription ScopedInErrorReport::current_error_(LINKER_INITIALIZED);

and entire list of function associated with report for asan

> 
> My stated use-case (crash reporting infrastructure) does require a certain degree of stability on macOS. After we create `llvm_sanitizer_report_payload_v1`, it cannot be changed (as OS crash reporting tools will depend on it) -- if other platforms later decide they have different needs they would need to create `llvm_sanitizer_report_payload_v2`. The `version` field exists with this in mind.

Isn't asan_abi is added by Apple to solve this stability problem.

> 
> Are you happy with the current format and want to use it on other platforms? If so, I think I can remove the SANITIZER_APPLE guards from everything and move the global outside of sanitizer_mac.cpp. If you want to use a different but undetermined format, I could remove the SANITIZER_APPLE guards from everything but leave the global in sanitizer_mac.cpp and/or behind a SANITIZER_APPLE guard. It all depends on whether other platforms want this by default or want to opt-in.



https://github.com/llvm/llvm-project/pull/200526


More information about the llvm-commits mailing list