Re: [netcdfgroup] Accessing a NetCDF and HDF5 file at the same time corrupts the HDF file

  • To: Oliver Lemke <Oliver.Lemke@xxxxxx>
  • Subject: Re: [netcdfgroup] Accessing a NetCDF and HDF5 file at the same time corrupts the HDF file
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Mon, 25 Oct 2010 09:16:31 -0600
Oliver Lemke <Oliver.Lemke@xxxxxx> writes:

> On 2010-10-22, at 16:40, Ed Hartnett wrote:
>
>> Oliver Lemke <olemke@xxxxxx> writes:
>> 
>>> Hi,
>>> 
>>> I'm trying to write to a NetCDF file and an HDF5 file at the same time. 
>>> When I call nc_close() the HDF5 file identifier gets corrupted:
>>> 
>>> [snip]
>>> Using NetCDF 4.1.1 and HDF5 1.8.5, I get the following error when calling 
>>> H5Fclose and the resulting HDF file is empty:
>>> 
>>> HDF5-DIAG: Error detected in HDF5 (1.8.5) thread 0:
>>> #000: H5F.c line 1943 in H5Fclose(): invalid file identifier
>>>   major: Invalid arguments to routine
>>>   minor: Inappropriate type
>>> 
>>> Calling H5Fclose() _before_ nc_close() makes the problem go away. The 
>>> problem also does not occur when linking against NetCDF 3.6.3. Is this 
>>> possibly a bug in nc_close()?
>>> 
>>> Any help appreciated.
>>> 
>>> /oliver
>>> 
>> 
>> Howdy Oliver!
>> 
>> Can you try the latest netCDF snapshot release and tell me if this goes
>> away?
>> 
>> ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz
>
> Hi Ed,
>
> Tried with snapshot2010102020 and the problem indeed goes away.
>
> /oliver
>

Great!

This problem was caused by an inadvisable call to H5close() inside the
netCDF library. Of course it was very silly of me to do this - how can
the netCDF library know if you are still using the HDF5 library? 

The call to H5close() was removed, and thus the problem will not occur
for you.

Thanks,

Ed

-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: