mirror of
https://review.haiku-os.org/haiku
synced 2025-01-19 21:11:28 +01:00
158e20e60e
When configured to do so (using heap_debug_set_stack_trace_depth(depth) or MALLOC_DEBUG=s<depth>) the guarded heap now captures stack traces on alloc and free. A crash due to hitting a guard page or an already freed page now dumps these stack traces. In the case of use-after-free one can therefore see both where the allocation was done and where it was freed. Note that there is a hardcoded maximum stack trace depth of 50 and that the alloc stack trace takes away space from the free stack trace which uses up the rest of that maximum.