gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

Expose __sanitizer_symbolize_pc() #322

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I had to add this interface function today when hacking on NSS crypto code, 
which uses function pointers heavily. I needed to know which function was being 
called by pointer and this was the best solution I could come up with. Looks 
like it would require almost zero effort to add this to our interface. Opinions?

Original issue reported on code.google.com by earth...@google.com on 26 Jun 2014 at 6:57

GoogleCodeExporter commented 9 years ago

Original comment by earth...@google.com on 26 Jun 2014 at 6:57

GoogleCodeExporter commented 9 years ago
I'm not sure we want something like this in the public interface, where would 
have to support it in the future.
If you only need it as a debugging aid (I assume you could not use gdb for some 
reason?), you could just declare it at the call site.

Original comment by euge...@google.com on 27 Jun 2014 at 8:13

GoogleCodeExporter commented 9 years ago
We could just say that we provide no guarantees about it being supported in the 
future, since it's only intended for debugging anyway. We already do this with 
__sanitizer_print_stack_trace().

> I assume you could not use gdb for some reason?
The code was called several times with different function pointers, and I there 
was no way to know in advance which call was the interesting one.

> you could just declare it at the call site.
It still has to be defined and declared with SANITIZER_INTERFACE_ATTRIBUTE in 
the runtime.

Original comment by earth...@google.com on 27 Jun 2014 at 9:00

GoogleCodeExporter commented 9 years ago
Just curious, why do Asan users need these functions in public interface?

Original comment by tetra2...@gmail.com on 27 Jun 2014 at 9:18

GoogleCodeExporter commented 9 years ago
Sometimes it's useful to have this for debugging (other code). Since we already 
have code that does this, it might make sense to expose it.

Original comment by earth...@google.com on 27 Jun 2014 at 9:31