Unable to use tradional tools to find memory leaks

Maxim Fomin maxim at maxim-fomin.ru
Sat Sep 21 09:01:16 PDT 2013


On Saturday, 21 September 2013 at 14:30:19 UTC, Flamaros wrote:
> I tried to used Valgrind (Linux) and Dr Memory (Windows) 
> without success to find a big leak I have in my application.
> But both tools can't launch my application without make it 
> crash.

Is application crashing without these tools? Probably you have 
some bug which is detected by valgrind.

By the way, some pitfalls of using valgrind for testing D code:

1) Its implementation of float numbers at compile time is buggy 
(for example, there may be static asserts which are true when 
running under native envorionment and false under valgrind)
2) Dmd's codegen is sometimes not supported by valgrind (cannot 
execute some instructions which is rare case when something from 
D beats some tool outside)
3) It has some false positives regarding using uninitialized 
values especially during execution of GC code.

> Do I need do something particular, to have a chance to see one 
> of those tool working fine with my application?

If you run into #2 then you cannot fix it.

> It can be really hard to find leaks manually, maybe some option 
> of the gc can help me?

If you look into gc sources, you can found some testing code, but 
it needs druntime recompilation.


More information about the Digitalmars-d-learn mailing list