[FLASH-USERS] XFlash Bug Fixes

James Guillochon jfg at ucolick.org
Mon Oct 20 05:30:37 EDT 2008


Hi guys,

Some missing code in one of the XFlash support routines was causing me 
intermittent problems for a long time, so I figured I'd share the fix in 
case anyone else was getting the same problem. Basically, whoever wrote 
the routine forgot to include a couple H5_CLOSE (such as "H5T_CLOSE, 
datatype") commands, which are necessary to avoid memory leaks! The 
omissions I found were in the determine_file_version.pro and 
read_amr.pro routines, both essential to XFlash. Here's the location of 
the missing commands:

determine_file_version.pro:
Missing "H5T_CLOSE, datatype" after "H5D_GET_TYPE", should be inserted 
after "H5D_CLOSE, dataset" line.
"H5F_CLOSE" command appears inside if statement, it should be OUTSIDE 
the if statement, otherwise it isn't guaranteed to execute!

read_amr.pro:
"H5F_CLOSE" command appears inside if statement, it should be OUTSIDE 
the if statement.

This was causing me a huge headache and a memory corruption issue which 
would rear itself only occasionally, but would result in the wrong file 
being read! Very annoying when you're looping over hundreds of dumps...

-- 

James Guillochon
Department of Astronomy & Astrophysics
University of California, Santa Cruz
jfg at ucolick.org



More information about the flash-users mailing list