Using NetCDF 4.1.1 crashes program

Jun 9, 2011 at 1:45 PM

Hi

We would like to upgrade SDS which uses NetCDF 4.0.1 to SDS with NetCDF 4.1.1. However, it does not work.

I spent much time to investigate the issue and has no clue....

This is the exception that I go,which occurs always with method nc_close:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Do you have any idea? 

Jun 9, 2011 at 2:27 PM

 

DataSet ds = DataSet.Open(@"C:\data_11.nc");
            ds.IsAutocommitEnabled = false;
            ds.Metadata["Convention"] = "fewfwfw";
            ds.Metadata["history"] = new string[] { "jfwejo wjfoiwej" };
            ds.Commit();
            ds.Add<int>("config");
            ds.Commit();
            ds.Add<DateTime>("time", "time");
            ds.Commit();
            ds.Add<int>("HAHA", "fefwrr");
            ds.Commit();
            ds.Add<int>("HAHAa");
            ds.Commit();

 

This is the code I used... Exception throws when it executes ds.Add<DateTime>("time","time").

I also logged the NetCDF Method invocations (excludes get and inq methods):

NetCDF.nc_create(C:\data_11.nc,NC_NETCDF4,out 65536);
NetCDF.nc_enddef(65536);
NetCDF.nc_close(65536);
NetCDF.nc_open(C:\data_11.nc,NC_WRITE,out 65536);
NetCDF.nc_redef(65536);
NetCDF.nc_enddef(65536);
NetCDF.nc_redef(65536);
NetCDF.nc_put_att_text(65536, -1, Convention,7,35747816);
NetCDF.nc_put_att_string(65536, -1, history,1,System.String[]);
NetCDF.nc_put_att_text(65536, -1, _dataSetAttTypeMap,24,35750504);
NetCDF.nc_enddef(65536);
NetCDF.nc_sync(65536);
NetCDF.nc_close(65536);
NetCDF.nc_open(C:\data_11.nc,NC_WRITE,out 65536);
NetCDF.nc_def_var(65536, config, NC_INT, 0, System.Int32[],out 0);
NetCDF.nc_redef(65536);
NetCDF.nc_enddef(65536);
NetCDF.nc_redef(65536);
NetCDF.nc_put_att_text(65536, 0, Name,6,35769308);
NetCDF.nc_enddef(65536);
NetCDF.nc_sync(65536);
NetCDF.nc_close(65536);
A first chance exception of type 'System.AccessViolationException' occurred in Microsoft.Research.Science.Data.NetCDF4.dll
The thread '' (0x2204) has exited with code 0 (0x0).

Developer
Jun 9, 2011 at 2:34 PM

Hi Chris,

This upgrade is also interesting for us; we will investigate the issue.

 

Regards,

Dmitry.