[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #KJJ-291289]: netCDF4 HDF4 Linking Issue



This is fixed by github pull request
https://github.com/Unidata/netcdf-c/pull/1153

> 
> > 1. I can verify that the wrong NC_check_id is being called, I actually 
> > found this bug while debugging using gdb. It is also easy to tell without 
> > gdb, since in this scenario the hdf4 function will write "<nc_id> is not a 
> > valid cdfid" to stderr. I actually don't see any HNAME macro in the netCDF 
> > source.
> > 2. I just tested this scenario. It appears that linking an hdf4 library 
> > built with the --disable-netcdf does prevent the issue.
> >
> > I apologize for taking so long to get back to you. I actually wrote a 
> > separate test program to test these scenarios and found that the issue was 
> > not as easy to reproduce as I had previously thought. The production 
> > program I'm working on needs to link in a cocktail of libraries which 
> > include hdf4, hdf5, hdfeos5, PGS Toolkit, and netcdf4. Some mix of linking 
> > these libraries is causing the issue, but ultimately I still think 
> > correcting the NC_ckeck_id function name is the correct fix.
> >
> >
> > Zachary Richard
> > Software/Test Engineer
> > Land SIPS Software Integration
> > address@hidden
> > Office Phone: (301) 867-2059
> > Cell Phone:    (302) 245-6170
> > ________________________________________
> > From: Unidata netCDF Support [address@hidden]
> > Sent: Wednesday, August 29, 2018 4:49 PM
> > To: Richard, Zachary (GSFC-619.0)[GLOBAL SCIENCE & TECHNOLOGY INC]
> > Subject: [netCDF #KJJ-291289]: netCDF4 HDF4 Linking Issue
> >
> > A couple of questions:
> > 1. have you verified that the wrong NC_check_id is being called
> > by using gdb, for example? The reason I ask is that the hdf4
> > code appears to be doing some kind of renaming using a HNAME macro.
> > 2. does the problem go away if hdf4 is built with the --disable-netcdf
> > option to ./configure?
> >
> > > Interesting. I wonder why we have not seen this before.
> > >
> > > > It looks like I've found a bug with the netCDF C library.
> > > >
> > > > If you write a C program that uses both netcdf4 (for the purposes of 
> > > > creating/reading hdf5/netcdf4 files) and hdf4 (for reading hdf4 files) 
> > > > most netCDF4 functions become unusable. This is because both hdf4 and 
> > > > netCDF4 have a function named NC_check_id(), which are two different 
> > > > functions that are not interchangeable. This issue essentially makes 
> > > > netCDF4 incompatible with use in a program which also uses hdf4.
> > > >
> > > > The issue can be fixed if the function is renamed and it's references 
> > > > are corrected. I can fix the issue by implementing this fix and 
> > > > rebuilding netCDF4 from source.
> > > > I would really like this change to be properly implemented from unidata 
> > > > so that my team doesn't need to maintain a separate version of netCDF. 
> > > > I was under the impression that netCDF4 was supposed to be compatible 
> > > > with hdf4, so I'm surprised no one else has found this issue.
> > > >
> > > > Please let me know if you think the aforementioned fix can be applied 
> > > > to the next release version of netCDF.
> > > >
> > > > Thank you.
> > > >
> > > > Zachary Richard
> > > > Software/Test Engineer
> > > > Land SIPS Software Integration
> > > > address@hidden
> > > > Office Phone: (301) 867-2059
> > > > Cell Phone:    (302) 245-6170
> > > >
> > > >
> > >
> > > =Dennis Heimbigner
> > > Unidata
> > >
> >
> > =Dennis Heimbigner
> > Unidata
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: KJJ-291289
> > Department: Support netCDF
> > Priority: Normal
> > Status: Open
> > ===================
> > NOTE: All email exchanges with Unidata User Support are recorded in the 
> > Unidata inquiry tracking system and then made publicly available through 
> > the web.  If you do not want to have your interactions made available in 
> > this way, you must let us know in each email you send to us.
> >
> >
> >
> >
> 
> =Dennis Heimbigner
> Unidata
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: KJJ-291289
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.