Re: [netcdfgroup] a possible problem in libsrc/posixio.c

Cedric Roux wrote:
This is speculation of course, and it will be
hard for me to reproduce the error, so if on

Well not that hard after all.

On the test machine I have, stat() says the disk's blocksize is 4096.
Using 'strace' I see the writes done by netcdf go by blocks of
size 8192. (This might be important to reproduce the
problem.)

Doing an 'ulimit -f 13' and running my program gives
the error. -f takes the number of blocks the program
is allowed to write.

Here comes the error's message, just in case someone
digs the web for it...
-----
posixio.c:251: px_pgin: Assertion `*posp == ((off_t)(-1)) || *posp == lseek(nciop->fd, 0, 1)' failed.
-----

You might be able to reproduce the problem. Just check
your disk's blocksize and use strace to get the size
of the writes done by netcdf (for if they match maybe
the problem won't pop up).

Best regards,
Cédric.

PS: the program below (not my usual coding style)
exhibits the problem.

I do an 'ulimit -f 2' and runs the program which then shows:

a.out: posixio.c:207: px_pgout: Assertion `*posp == ((off_t)(-1)) || *posp == lseek(nciop->fd, 0, 1)' failed.

(so this time it's in px_pgout, not px_pgin)

-----
#include <netcdf.h>

int main(void)
{
  int ncid;
  int dimid;
  int id;
  double d[256];
  nc_create("test.nc", 0, &ncid);
  nc_def_dim(ncid, "d", 256, &dimid);
  nc_def_var(ncid, "v", NC_DOUBLE, 1, &dimid, &id);
  nc_enddef(ncid);
  nc_put_var_double(ncid, id, d);
  nc_close(ncid);
  return 0;
}
-----



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