Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 'definitely lost' memory leaks #5

Open
cwsmith opened this issue Jul 13, 2015 · 3 comments
Open

fix 'definitely lost' memory leaks #5

cwsmith opened this issue Jul 13, 2015 · 3 comments
Assignees

Comments

@cwsmith
Copy link
Collaborator

cwsmith commented Jul 13, 2015

valgrind --leak-check=full phastaIC.exe on the incompressible test case reports the following (there is more).

 ==16347== 30,128 bytes in 28 blocks are definitely lost in loss record 57 of 64
 ==16347==    at 0x4C29F90: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
 ==16347==    by 0x53A965F: MPID_Dataloop_alloc_and_copy (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpi.so.12.0.2)
 ==16347==    by 0x53ADD89: MPID_Dataloop_create_vector (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpi.so.12.0.2)
 ==16347==    by 0x53AA7AD: MPID_Dataloop_create (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpi.so.12.0.2)
 ==16347==    by 0x53B9903: MPID_Type_commit (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpi.so.12.0.2)
 ==16347==    by 0x52F8E0E: MPIR_Type_commit_impl (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpi.so.12.0.2)
 ==16347==    by 0x52F8FA6: PMPI_Type_commit (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpi.so.12.0.2)
 ==16347==    by 0x5B0F078: mpi_type_commit (in /home/cwsmith/sysSoftware/mpich/3.1.2/installGcc/lib/libmpifort.so.12.0.2)
 ==16347==    by 0x49599A: ctypes_ (in /home/cwsmith/develop/streamInMem/build/phasta/bin/phastaIC.exe)
 ==16347==    by 0x45B115: readnblk_ (in /home/cwsmith/develop/streamInMem/build/phasta/bin/phastaIC.exe)
 ==16347==    by 0x434FAD: input_ (in /home/cwsmith/develop/streamInMem/build/phasta/bin/phastaIC.exe)
 ==16347==    by 0x4180C8: phasta (phasta.cc:154)
 ==16347== 
 ==16347== LEAK SUMMARY:
 ==16347==    definitely lost: 85,672 bytes in 127 blocks
 ==16347==    indirectly lost: 0 bytes in 0 blocks
 ==16347==      possibly lost: 0 bytes in 0 blocks
 ==16347==    still reachable: 11,841,064 bytes in 326 blocks
 ==16347==         suppressed: 0 bytes in 0 blocks
 ==16347== Reachable blocks (those to which a pointer was found) are not shown.
 ==16347== To see them, rerun with: --leak-check=full --show-leak-kinds=all
@cwsmith cwsmith self-assigned this Jul 13, 2015
@cwsmith
Copy link
Collaborator Author

cwsmith commented Jul 13, 2015

MPI_TYPE_COMMIT is called from common/ctypes.f and needs to be deallocated via calls to MPI_TYPE_FREE.

@cwsmith
Copy link
Collaborator Author

cwsmith commented Jul 13, 2015

fixed in cwsmith/phasta@fcc77cc

@cwsmith cwsmith closed this as completed Jul 13, 2015
@cwsmith cwsmith changed the title fix memory leaks fix definitely lost memory leaks Jul 14, 2015
@cwsmith cwsmith changed the title fix definitely lost memory leaks fix 'definitely lost' memory leaks Jul 14, 2015
@cwsmith cwsmith reopened this Jul 14, 2015
@cwsmith
Copy link
Collaborator Author

cwsmith commented Jul 14, 2015

There are 'definitely lost' leaks in compressible related to MPI_File_Open(...).

==22759== 22 bytes in 1 blocks are definitely lost in loss record 37 of 69
==22759==    at 0x4C29F90: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22759==    by 0x6F9B069: strdup (in /usr/lib/libc-2.21.so)
==22759==    by 0x53B5710: MPIR_Info_set_impl (in /home/cwsmith/software/mpich/mpich-3.1/gcc51-install/lib/libmpich.so.12.0.0)
==22759==    by 0x53B59C5: PMPI_Info_set (in /home/cwsmith/software/mpich/mpich-3.1/gcc51-install/lib/libmpich.so.12.0.0)
==22759==    by 0x5402F6A: ADIOI_GEN_SetInfo (in /home/cwsmith/software/mpich/mpich-3.1/gcc51-install/lib/libmpich.so.12.0.0)
==22759==    by 0x5405F8E: ADIO_Open (in /home/cwsmith/software/mpich/mpich-3.1/gcc51-install/lib/libmpich.so.12.0.0)
==22759==    by 0x53EF894: PMPI_File_open (in /home/cwsmith/software/mpich/mpich-3.1/gcc51-install/lib/libmpich.so.12.0.0)
==22759==    by 0x5C8DDF: openfile_ (phastaIO.cc:1175)
==22759==    by 0x43C96D: phio_openfile_write_ (phIO.cc:75)
==22759==    by 0x43A80F: write_restart_ (new_interface.c:391)
==22759==    by 0x427A5E: restar_ (in /home/cwsmith/develop/phastaChef/buildVG/phasta/bin/phastaC.exe)
==22759==    by 0x4A863A: bflux_ (in /home/cwsmith/develop/phastaChef/buildVG/phasta/bin/phastaC.exe)

asan reports

=================================================================
==22746==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 175 byte(s) in 16 object(s) allocated from:
    #0 0x7fb8a80e09da in __interceptor_malloc /build/gcc/src/gcc-5-20150623/        #1 0x7f8a38ef3069 in __strdup (/usr/lib/libc.so.6+0x80069)
SUMMARY: AddressSanitizer: 175 byte(s) leaked in 16 allocation(s).
=================================================================
==22747==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 175 byte(s) in 16 object(s) allocated from:
    #0 0x7f8a3b3929da in __interceptor_malloc /build/gcc/src/gcc-5-20150623/
    #1 0x7fb8a5c41069 in __strdup (/usr/lib/libc.so.6+0x80069)
SUMMARY: AddressSanitizer: 175 byte(s) leaked in 16 allocation(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant