Hi,
I've written a memory tracking system in c++ using Detours to patch the various memory allocation functions. When I receive a call to malloc in addition to the malloc I also store the stacktrace (so I can pin point the leak).
The only reliable way to obtain an accurate stacktrace is to use StackWalk64 (I tried RtlCaptureStackBackTrace, and this only managed to caputure very simple stacks).
However here's my problem, StackWalk64 calls malloc, which in turn calls StackWalk64 and leads to a stack overflow. Now I could have a flag that deals with recursive calls, however this doesn't work with multiple threads
I was wondering if anyone had a possible solution to this pickle.
Thanks Rich Carless