[Nexus] Memory leak in NeXus 3.0.0 API

POIRIER Stephane stephane.poirier at synchrotron-soleil.fr
Mon Feb 5 09:25:41 GMT 2007


Hello all!

Using the NeXus API 3.0.0 and HDF5 (v1.6.5) under GNU/Linux, I have noticed a memory leak in my process recording data in NeXus format. Then I tryed to see what's going wrong with Valgrind, a memory debugging tool.
In the listing produced by Valgrind (after a 3 hours test) I read :

==15497== 264256 bytes in 4129 blocks are definitely lost in loss record 185 of 185
==15497==    at 0x3414A23C: malloc (vg_replace_malloc.c:131)
==15497==    by 0x80CB15B: NXIformatNeXusTime (napi.c:1017)
==15497==    by 0x80CB704: NX5open (napi5.c:146)
==15497==    by 0x80CA589: nxiopen_ (napi.c:232)

Looking at the NX5open function in napi5.c I saw that the pointer named 'time_buffer' is allays allocated (using NXIformatNeXusTime()) when calling NX5open but freed only in the case of a NXACC_CREATE5 access (=> H5F_ACC_TRUNC) to the NeXus file.

Thanks,

Stephane

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° 
Stéphane POIRIER
Groupe Gestion des données
Tél. : 01 69 35 93 38
SYNCHROTRON SOLEIL
Bâtiment Central pièce A1.0.28
L'Orme des Merisiers
Saint-Aubin - BP 48
91192 GIF-SUR-YVETTE CEDEX
Site Web: <http://www.synchrotron-soleil.fr/> 
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° 



More information about the NeXus mailing list