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

[netCDF #CKA-677320]: NF_CREATE crash



Hi Ansley,

> Using the source from this URL,
> 
> ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-test.tar.gz
> 
> I'm seeing a problem with NF_CREATE. The call is this, with
> cdftype=NF_CLASSIC_MODEL and with clobber_mode set to either
> NF_NOCLOBBER or NF_CLOBBER. The call is made by program ferret_c, and
> its result is below:
> 
> cdfstat = NF_CREATE(cdfname, OR(clobber_mode,cdftype), cdfid)
> 
> ferret_c: nc4file.c:395: NC4_create: Assertion `0' failed.
> Abort
> 
> 
> Setting cdftype to NF_NETCDF4 and making the same call lets me
> successfully create and write to the file.

I can't reproduce this problem using gfortran.  What happens when you
use the function IOR() instead of OR() ?, as in:

   cdfstat = NF_CREATE(cdfname, IOR(clobber_mode,cdftype), cdfid)

That's the intended way to pass the bitwise combination of flags to
the library.  Both OR and IOR work for me in gfortran, but using the
OR() function is deprecated, as it's a non-standard GNU extension
rather than a standard intrinsic function that you probably intended.

It looks like we need a better way to handle this potential problem
with user input to NF_CREATE().

Thanks for reporting the problem!

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: CKA-677320
Department: Support netCDF
Priority: Normal
Status: Closed