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

Re: bug in ncredef



>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