Unable to use tradional tools to find memory leaks
Flamaros
flamaros.xavier at gmail.com
Sat Sep 21 09:24:35 PDT 2013
On Saturday, 21 September 2013 at 16:01:17 UTC, Maxim Fomin wrote:
> 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.
Application run correctly without Valgring or Dr Memory.
> 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.
Yes, I think it's normal, I got also some false leaks from
graphics drivers. Sadly Valgrind make my application crash before
the initialization is finished.
I think I am in you 2 point.
>> 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