| Issue |
163804
|
| Summary |
[asan win] Releasing memory via HeapDestroy does not work (affects only windows_hook_rtl_allocators=1)
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
bernhardu
|
Hello, I wondered why a 32-bit test application was crashing with memory exhaustion,
when run with `-fsanitize=address` and `windows_hook_rtl_allocators=1`.
After quite some time I realized this application creates own heaps
by `HeapCreate` and "releases" that memory later via `HeapDestroy`.
This seems to work properly if HeapAlloc and friends are not intercepted,
but if the real allocation is done by ASan the memory gets not released.
While seeing this with Wine, I could also observe it with attached reproducer with Windows.
As a first step, would be an interception of HeapDestroy/RtlDestroyHeap
with a warning to the user about this situation be acceptable?
A better solution may be to store somehow the heap handle to each allocation and
release those in heap destruction.
[test-heapcreate-heapdestroy.c.txt](https://github.com/user-attachments/files/22952962/test-heapcreate-heapdestroy.c.txt)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs