Boost logo

Boost Users :

Subject: [Boost-users] [MPI] Code example leaks memory
From: Yves Daemen (yves.daemen_at_[hidden])
Date: 2010-03-26 08:37:56


Hi all,

the code example given at: http://www.boost.org/doc/libs/1_41_0/doc/html/mpi/tutorial.html leaks memory as reported by Valgrind 3.5.0

I compile it like this:

mpic++ -I/<path-to-Boost>/include test.cpp -L/<path-to-Boost>/lib/ -lboost_mpi-mt

Which returns the following Valgrind output (running with --leak-check=full returns way too much output)

$ valgrind ./a.out
==31807== Memcheck, a memory error detector
==31807== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==31807== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==31807== Command: ./a.out
==31807==
I am process 0 of 1.
==31807==
==31807== HEAP SUMMARY:
==31807==     in use at exit: 125,916 bytes in 2,065 blocks
==31807==   total heap usage: 3,494 allocs, 1,429 frees, 24,534,682 bytes allocated
==31807==
==31807== LEAK SUMMARY:
==31807==    definitely lost: 2,344 bytes in 28 blocks
==31807==    indirectly lost: 678 bytes in 19 blocks
==31807==      possibly lost: 0 bytes in 0 blocks
==31807==    still reachable: 122,894 bytes in 2,018 blocks
==31807==         suppressed: 0 bytes in 0 blocks
==31807== Rerun with --leak-check=full to see details of leaked memory
==31807==
==31807== For counts of detected and suppressed errors, rerun with: -v
==31807== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 30 from 11)



I am just wondering if this example is just incomplete, or that it is the library's own leak.

Best regards,

Yves.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net