2

Suppose I have a core dump from a program compiled with AddressSanitizer (ASan), as well as all relevant libraries and debug info, and suppose further that ASan was configured to record a full stack trace at all calls to malloc() (fast_unwind_on_malloc=0).

Had the program been running, ASAN would have been able to report the full stack trace for every extant allocation. It seems to follow that the core dump should contain all the information necessary for that, so I should be able to load up that core dump in GDB, point at any valid memory address, and get a stack trace from when it was allocated.

How do I get the allocation-time stack trace for a byte of memory in a core dump of an ASan-enabled program loaded into gdb? And how deep would I need to get into the internals of ASan?

2
  • So you basically want what __asan_get_alloc_stack would give you in a live process? Commented Sep 6 at 13:01
  • @ssbssa Yes, or maybe __asan_describe_address more generally. I think I’ve made my peace with the fact that I’m going to need to just rewrite the relevant parts from C++ to GDB-specific Python, so watch this space I guess. Commented Sep 6 at 20:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.