[PATCH] D144830: [asan darwin] Allow clients to implement `__sanitizer_report_error_summary`

Dave MacLachlan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 13:54:41 PST 2023


dmaclach added a comment.

In D144830#4165204 <https://reviews.llvm.org/D144830#4165204>, @yln wrote:

> Taking a step back, please check my understanding:



> So if we keep using this approach, we want to find a function that is:
>
> - Defined in the sanitizer runtime
> - Not overridable
> - Can be looked up via `dladdr()` (Can you find out and explain here what exactly the rules around this are? Does the function need to be exported?)

Thank you for making me think about it. `dladdr()` looks up an address...not a function. So we can use any function that we can get the address of (such as the function we are in).

> Also, I am not sure why we do the detour to go to the image and then compare image names.  Maybe it's worth exploring if we can do something more direct, e.g., something in the spirit of `dlsym("puts") == &wrap_puts`?

`wrap_puts` isn't defined. It's being called `wrap_puts` in the comment because it's our "puts" that is being linked in in place of the system puts. Hopefully the solution that we have now is acceptable.

`ninja check-asan` on darwin gives me:

  Testing Time: 769.12s
    Unsupported      :  455
    Passed           : 1033
    Expectedly Failed:    2




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144830



More information about the llvm-commits mailing list