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

malloc_history equivalent #91

Open
davidchisnall opened this issue Aug 20, 2019 · 0 comments
Open

malloc_history equivalent #91

davidchisnall opened this issue Aug 20, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@davidchisnall
Copy link
Collaborator

The Darwin malloc implementation has a feature (enabled by an environment variable) that records, for each allocation or deallocation event:

  • The size of the allocation.
  • The address of the allocation.
  • The thread ID for the [de]allocation call.
  • A stack trace at the [de]allocation site.

This makes it possible for after a crash to determine where an allocation originated and where it was freed.

Implementing similar functionality in snmalloc (ideally using ifunc logic to replace the malloc / free functions at load time) could reuse some of the compressed stack trace logic from the LLVM sanitisers.

@davidchisnall davidchisnall added enhancement New feature or request help wanted Extra attention is needed labels Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant