[Nexus] Memory leak in NeXus 3.0.0 API

Akeroyd, FA (Freddie) F.A.Akeroyd at rl.ac.uk
Mon Feb 5 10:27:34 GMT 2007


Stephane,

Thank you for your bug report. This problem has been corrected in the current development version of the NeXus library and the fix will be included in the next official release of the API (date not yet decided - I'll let you know when more information is available).

Regards,

Freddie

-----Original Message-----
From: nexus-bounces at nexusformat.org [mailto:nexus-bounces at nexusformat.org] On Behalf Of POIRIER Stephane
Sent: 05 February 2007 09:26
To: nexus at nexusformat.org
Subject: [Nexus] Memory leak in NeXus 3.0.0 API

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/> 
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° 

_______________________________________________
NeXus mailing list
NeXus at nexusformat.org
http://lists.nexusformat.org/mailman/listinfo/nexus



More information about the NeXus mailing list