2

This simple program leaks memory according to LeakSanitizer.

#include <mpi.h>
int main(int argc, char *argv[])
{
    MPI_Init(&argc, &argv);
    MPI_Finalize();
    return 0;
}

I am linking it to Open MPI v1.10.2.

This other question asks almost the same thing but using valgrind instead of LeakSanitizer. The answers explain that the reported memory leaks are false positives and instruct how to suppress them when using valgrind.

I suppose that the memory leaks reported by LeakSanitizer are also false postives. Is that so? Is it possible to suppress them?

toliveira
  • 1,533
  • 16
  • 27
  • 1
    Just search for "suppress" on the first link you provided. – John Zwinck Aug 30 '18 at 12:29
  • OpenMP [admits to leaking memory](https://www.open-mpi.org/faq/?category=debugging#valgrind_clean), i.e. not freeing it properly furing `MPI_Finalize`. You may consider this a false positive given that they should not practically hurt you since a normal MPI implementation ends after `MPI_Finalize`. Unfortunately the report I get from LeakSanitzer is very unhelpful in terms of locating the source of the leak and hence the suppression. – Zulan Aug 30 '18 at 12:58
  • @Zulan you meant Open MPI, right ? Yes, there are still some memory leaks in Open MPI and they are (slowly) being dealt, see https://github.com/open-mpi/ompi/pull/2175 . These leaks can be ignored for now. The valgrind file are here to suppress the warning when sending some uninitialized memory (for example, some padding bytes are uninitialized and valgrind complains about it) – Gilles Gouaillardet Aug 31 '18 at 04:15
  • @GillesGouaillardet of course OpenMPI, sorry. All I'm saying is that the given suppression file *also* contains `Memcheck:Leak` entries. Thanks for your work on improving OpenMPI! – Zulan Aug 31 '18 at 07:59
  • @JohnZwinck, thank you for pointing it out. – toliveira Sep 01 '18 at 16:52

0 Answers0