This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>From: "MPCS" <address@hidden> >Organization: ? >Keywords: 199406282011.AA16469 netCDF ncredef Valerio, >A small, but annoying bug crept up today: > >If you create a file (which is then of course in define mode) and try to >execute an ncredef, instead of receiving a -1, the program aborts with a stack >dump. The error occurs in the following piece of code in ncredef (file.c): > > if( handle->flags & NC_INDEF) /* in define mode already */ > { > NC *stash = STASH(cdfid) ; > NCadvise(NC_EINDEFINE, "%s: in define mode aleady", > stash->path) ; > return(-1) ; > } > >The *stash is returned null and the NCadvise crashes. > >The above steps might seem useless, except that one of our functions is called >both after an nccreate and an ncopen, and we were trying to check the mode of >the file. I'll change it to use the ncopenmode that I've written and already >reported to you a few weeks ago. > >P.S.: if ncopts is set to 0, NCadvise apparently just leaves and everything is >smooth. Our netCDF expert, Russ Rew is out of the office until July 5. I am forwarding this message to him so that he can take a look after he returns. Tom Yoksas