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

[netCDF #IVN-676408]: Problems with netCDF files in IDL



> I had a look at the strace file I sent you yesterday.  This is the
> section at the end of writing the netCDF file, and where my program
> detects that an error has been returned and prints the error message:
> 
> 
> 
> write(7,
> "\377\300\377\336\0009\0d\0B\0\f\377\340\377\365\0E\0#\377\300\377\300\3
> 77\346\377\341\377\341\377\351"..., 8192) = 8192
> 
> lseek(7, 0, SEEK_CUR)                   = 4030316544
> 
> lseek(7, 4030324736, SEEK_SET)          = 4030324736
> 
> read(7, "", 8192)                       = 0
> 
> lseek(7, 0, SEEK_CUR)                   = 4030324736
> 
> lseek(7, 4030316544, SEEK_SET)          = 4030316544
> 
> write(7,
> "\0<\0\26\377\236\377{\377\326\0<\0\r\377\302\0\n\0\r\377\340\377\364\0\
> 6\377\343\377\235\377\255"..., 8192) = 8192
> 
> lseek(7, 0, SEEK_CUR)                   = 4030324736
> 
> lseek(7, 4030332928, SEEK_SET)          = 4030332928
> 
> read(7, "", 8192)                       = 0
> 
> lseek(7, 0, SEEK_CUR)                   = 4030332928
> 
> lseek(7, 4030324736, SEEK_SET)          = 4030324736
> 
> write(7,
> "\377\345\377\361\377\347\377\313\377\337\0\t\377\356\377\312\0\33\0\30\
> 377\277\377\356\0D\0\30\377\334\377\333"..., 8192) = 8192
> 
> lseek(7, 0, SEEK_CUR)                   = 4030332928
> 
> lseek(7, 4030341120, SEEK_SET)          = 4030341120
> 
> read(7, "", 8192)                       = 0
> 
> --- SIGALRM (Alarm clock) @ 0 (0) ---
> 
> read(5, 0x1443734, 4096)                = -1 EAGAIN (Resource
> temporarily unavailable)
> 
> read(5, 0x1443734, 4096)                = -1 EAGAIN (Resource
> temporarily unavailable)
> 
> poll([{fd=5, events=POLLIN}], 1, 0)     = 0
> 
> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={2, 0}}, NULL) = 0
> 
> rt_sigreturn(0)                         = 16521112
> 
> lseek(7, 0, SEEK_CUR)                   = 4030341120
> 
> lseek(7, 4030332928, SEEK_SET)          = 4030332928
> 
> write(7,
> "\0006\0\n\377\277\377\212\377\307\0\37\0B\0.\377\325\377\230\377\354\0F
> \0\t\377\334\0\30\0O"..., 12324) = 12324
> 
> fstat(7, {st_mode=S_IFREG|0644, st_size=4030345252, ...}) = 0
> 
> close(7)                                = 0
> 
> write(1, "Error calling ncdf_varput: NCDF_"..., 57) = 57
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "FILE_ID         LONG      =     "..., 40) = 40
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "VOL_ID          LONG      =     "..., 40) = 40
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "VOLUME          INT       = Arra"..., 51) = 51
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "OFFSET          INT       = Arra"..., 36) = 36
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "COUNT           LONG      = Arra"..., 36) = 36
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "STRIDE          INT       = Arra"..., 36) = 36
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "offset=       0       0       0", 31) = 31
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, " count=", 7)                  = 7
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "        1392        1392        "..., 36) = 36
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, " stride=", 8)                 = 8
> 
> write(1, "\r\n", 2)                     = 2
> 
> write(1, "       1       1       1", 24) = 24
> 
> write(1, "\r\n", 2)                     = 2
> 
> brk(0x27a7000)                          = 0x27a7000
> 
> munmap(0x7f3082e06000, 4030345216)      = 0
> 
> 
> 
> Note that fd=7 is the netCDF file being written to.  The write(),
> fstat() and close() calls seem to have worked with no error.  The
> read(7, "", 8192) call returned 0.  I don't know if that is expected or
> not.
> 
> 
> 
> I searched through the file for all write(7, calls and none seemed to
> return an error.
> 
> 
> 
> So why is ncdf_varput returning an error, and why is the data in the
> file bad?
> 
>

Are you using lseek instead of lseek64?

In windows code, something like this should be triggered in the netcdf.h file:
#include <io.h>
#include <process.h>
#define lseek _lseeki64
#define off_t __int64
#define _off_t __int64
#define _OFF_T_DEFINED

The lseek function cannot work past 2 GB boundary...

Ed


Ticket Details
===================
Ticket ID: IVN-676408
Department: Support netCDF
Priority: Critical
Status: Closed