jmp75 / ncdf4

Interface to Unidata netCDF (version 4 or earlier) format data
http://dwpierce.com/software
0 stars 0 forks source link

netCDF file creation (or file reopening) fails using ncSwift::sncCreate #1

Open jmp75 opened 10 years ago

jmp75 commented 10 years ago

Occurs from R 3.1 Windows 64 bits, NOT 32 bits.

Using the vignette of ncSwift, without modifications in it, but with more recent version derived from ncdf4 1.12, sncCreate fails with

Unhandled exception at 0x000000006C7EEABD (R.dll) in Rgui.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

Rsx_nc4_get_vara_int
    setAttrib( sx_retval, R_NamesSymbol, sx_retnames );

This occurs in the function sncCreate when reopening the netCDF file in write mode

    nc <- ncdf4::nc_open(fname, write=TRUE, readunlim=FALSE)    
jmp75 commented 10 years ago

Issue is still present after merging the changes from ncdf4 1.13 from the origin repo.

jmp75 commented 10 years ago

Made some progress, by replacing the call to setAttrib with a custom version. But put the crash to another operation then. The dreaded access violation occured in setAttrib when calling isString(name). Also, after defining such that R internals are also included, tapping directly into name->sxpinfo.type failed. Also, the debugger is unable to "see" the values in the structs (but can if run in 32 bits, consistent with no crash occuring).

So, is this a case of compiling with VCpp against Mingw compiled R binaries that works mostly but not sometimes (and what does that say about rClr then?? the latter is still reliable, why).

Links of potential interest, Similar sounding symptoms with HDF5

Mingw FAQ