HDFGroup / hdf5

Official HDF5® Library Repository
https://www.hdfgroup.org/
Other
600 stars 244 forks source link

memory leaks while using async H5ES calls #4564

Open brtnfld opened 3 months ago

brtnfld commented 3 months ago

Monitoring the memory for the async vol test, test/async_test_serial_mdset.c, valgrind finds still allocated memory, even though H5ESclose is called.

valgrind --leak-check=full --show-leak-kinds=all async_test_serial_mdset.exe

==877== 8 bytes in 1 blocks are still reachable in loss record 1 of 3
==877==    at 0x483D611: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==877==    by 0x4FEB4ED: H5TS_cancel_count_inc (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4B1E163: H5EScreate (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x400CC2: main (async_test_serial_mdset.c:27)
==877== 
==877== 8 bytes in 1 blocks are still reachable in loss record 2 of 3
==877==    at 0x4838744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==877==    by 0x4A22004: H5CX__get_context (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4A2213D: H5CX_pushed (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4EBD3D0: H5T__register (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4EBCECB: H5T__register_int (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4EB594D: H5T_init (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x5017ECE: H5VL_init_phase2 (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x493385C: H5_init_library (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4B1E1A9: H5EScreate (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x400CC2: main (async_test_serial_mdset.c:27)
==877== 
==877== 2,104 bytes in 1 blocks are still reachable in loss record 3 of 3
==877==    at 0x4838744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==877==    by 0x4AF88DB: H5E__get_stack (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4AFEB78: H5E_clear_stack (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x4B1E277: H5EScreate (in /home/brtnfld/packages/hdf5/buildc/hdf5/lib/libhdf5.so.1000.0.0)
==877==    by 0x400CC2: main (async_test_serial_mdset.c:27)
fortnern commented 3 months ago

I think the first one is likely a non-issue - valgrind may be checking for leaks before the key destructors are called at thread exit