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

DrCallstack: provide callstack walking and packing as a DR Extension #823

Open
derekbruening opened this issue Nov 28, 2014 · 4 comments
Open

Comments

@derekbruening
Copy link
Contributor

derekbruening commented Nov 28, 2014

This is a longstanding feature request to take Dr. Memory's existing callstack walking code, which has many heuristics for stack scanning along with a compact storage scheme, and turn it into a general library that any DR client can use.

The original entry in the prior tracker:

From [email protected] on March 09, 2012 09:40:40

xref issue #822 another extension from the original discussion was DrCallstack: walking and packing callstacks, including md5 and crc32 checksums. again, this would stay within the drmemory codebase: simply build callstack.c as an Extension and perhaps tweak the interface a little if necessary but it shouldn't need much as its options, etc. are all already modular.

Original issue: http://code.google.com/p/drmemory/issues/detail?id=823

@derekbruening
Copy link
Contributor Author

From [email protected] on February 01, 2014 08:37:45

Reminder: make sure to document support for keeping unique callstacks in a
hashtable like drmem does for malloc callstacks.

We should also move -zero_retaddr into DrCallstack.
We'd need to include its auxiliary pieces:

The last one we can't easily include: we'd have to document that those
using drwrap_replace_native may need to zero things?

@derekbruening
Copy link
Contributor Author

derekbruening commented May 5, 2017

DynamoRIO/dynamorio#2414 is the same request but in the DR tracker and maybe diverging if we want a BSD-licensed extension.

@derekbruening
Copy link
Contributor Author

We'd want to improve win64 walking with #1222.

@derekbruening
Copy link
Contributor Author

And we'd want to provide a way to use .eh_frame/.debug_frame: #2399. Even if that's too slow for Dr. Memory it is more accurate these days and is what most users would want. Even Dr. Memory is recently hitting cases that require just too much stack scanning and it may be time to re-evalute Dr. Memory's use of DWARF unwind info.

derekbruening added a commit that referenced this issue Oct 17, 2021
Updates DR to 53af6c7 for the new drcallstack library.

Adds a new option -callstack_use_unwind which is on by default for
Linux.  This uses drcallstack's libunwind-based callstack walk, which
fixes problems of missing frames.  If the starting PC is not in a
module, the old callstack walking is used.

Updates malloc replacement contexts to include the PC as of the same
point as the captured stack pointer, for proper libunwind input.

Issue: #823, #2399, #2392, #1222
Fixes #2392
derekbruening added a commit that referenced this issue Oct 18, 2021
Updates DR to 53af6c7 for the new drcallstack library.

Adds a new option -callstack_use_unwind which is on by default for
Linux.  This uses drcallstack's libunwind-based callstack walk, which
fixes problems of missing frames.  If the starting PC is not in a
module, the old callstack walking is used.

Updates malloc replacement contexts to include the PC as of the same
point as the captured stack pointer, for proper libunwind input.

Issue: #823, #2399, #2392, #1222
Fixes #2392
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

1 participant