checking for memory leaks with valgrind when using TBB

236 views
Skip to first unread message

shapero...@gmail.com

unread,
Apr 6, 2017, 11:37:22 AM4/6/17
to deal.II developers
Hi all -- I'm wondering about how others go about checking for memory leaks either when developing deal.II or applications that use it. I get a lot of false positive reports of memory leaks from valgrind on test programs whenever I compile deal.II with Intel TBB. I've tried telling valgrind about TBB's malloc (as suggested in https://kate-editor.org/2013/07/29/intel-threading-building-blocks-scalable-allocator-valgrind/) but the results are the same.

The reason for this is that I'm trying to incorporate leak checking into how I do tests for a library I'm writing that uses deal.II. What I'm aiming for is that every test is run normally to check for correctness, and then through valgrind to check for leaks. I want the unit tests to fail if I introduce a leak somewhere as well as if the code doesn't do what it's supposed to.

Timo Heister

unread,
Apr 6, 2017, 2:42:37 PM4/6/17
to deal.II developers
Do you also see the leaks if you set the thread limit to 1?

On Thu, Apr 6, 2017 at 11:37 AM, <shapero...@gmail.com> wrote:
> Hi all -- I'm wondering about how others go about checking for memory leaks either when developing deal.II or applications that use it. I get a lot of false positive reports of memory leaks from valgrind on test programs whenever I compile deal.II with Intel TBB. I've tried telling valgrind about TBB's malloc (as suggested in https://urldefense.proofpoint.com/v2/url?u=https-3A__kate-2Deditor.org_2013_07_29_intel-2Dthreading-2Dbuilding-2Dblocks-2Dscalable-2Dallocator-2Dvalgrind_&d=DwIFaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=bIZ1PN9GFeiDFVPWRQ7rHwsFOCnh0BavuhRERQ4RDWGqJOxfLu0FfCOxyifWO5wc&m=Bb1YNYJKXrQNIUKtnNDvA7m19-awk0Dk3C9ARZN3J_A&s=zuAePJAGZYvisD_bi9rFIRlyydxBVZqVK-y0jVaTWV8&e= ) but the results are the same.
>
> The reason for this is that I'm trying to incorporate leak checking into how I do tests for a library I'm writing that uses deal.II. What I'm aiming for is that every test is run normally to check for correctness, and then through valgrind to check for leaks. I want the unit tests to fail if I introduce a leak somewhere as well as if the code doesn't do what it's supposed to.
>
> --
> You received this message because you are subscribed to the Google Groups "deal.II developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii-develop...@googlegroups.com.
> For more options, visit https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIFaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=bIZ1PN9GFeiDFVPWRQ7rHwsFOCnh0BavuhRERQ4RDWGqJOxfLu0FfCOxyifWO5wc&m=Bb1YNYJKXrQNIUKtnNDvA7m19-awk0Dk3C9ARZN3J_A&s=kgRx0MhVrXTOWxhFMgRAduxvn1fgKS4JHWsd0-nbMNg&e= .



--
Timo Heister
http://www.math.clemson.edu/~heister/
Reply all
Reply to author
Forward
0 new messages