Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose __sanitizer_symbolize_pc() #322

Closed
ramosian-glider opened this issue Sep 1, 2015 · 6 comments
Closed

Expose __sanitizer_symbolize_pc() #322

ramosian-glider opened this issue Sep 1, 2015 · 6 comments

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 322

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?

Reported by earthdok@google.com on 2014-06-26 18:57:38

@ramosian-glider
Copy link
Member Author

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.

Reported by eugenis@google.com on 2014-06-27 08:13:33

@ramosian-glider
Copy link
Member Author

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.

Reported by earthdok@google.com on 2014-06-27 09:00:06

@ramosian-glider
Copy link
Member Author

Just curious, why do Asan users need these functions in public interface?

Reported by tetra2005 on 2014-06-27 09:18:49

@ramosian-glider
Copy link
Member Author

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.

Reported by earthdok@google.com on 2014-06-27 09:31:26

@vitalybuka vitalybuka assigned vitalybuka and unassigned google Jul 20, 2016
@kcc
Copy link
Contributor

kcc commented Jul 20, 2016

We also need __sanitizer_print_stack_trace in all the sanitizers.

@kcc
Copy link
Contributor

kcc commented Aug 25, 2016

__sanitizer_symbolize_pc is added
__sanitizer_print_stack_trace also seems to be in every sanitizer now.

@kcc kcc closed this as completed Aug 25, 2016
kubamracek pushed a commit to apple/swift-compiler-rt that referenced this issue Jan 8, 2017
swift-ci added a commit to apple/swift-compiler-rt that referenced this issue Jan 8, 2017
* origin/swift-3.1-branch:
  [sanitizer] rename __sanitizer_symbolize_data to __sanitizer_symbolize_global (to avoid conflict with another definition)
  [sanitizer] add __sanitizer_symbolize_data (can only print the names of the globals for now)
  [sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc (need to put a zero after strncmp). LOL
  [sanitizer] add __sanitizer_symbolize_pc. google/sanitizers#322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants