This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Florian, > it seems to be impossible adding the attribute _FillValue to an existing > netCDF4 file or changing an existing attribute with this name. NetCDF > segfaults because of a NULL-pointer access (NC_DIM_INFO_T) in > var_create_dataset(). > > Note: The same works fine with classic file. > > Find attached the debugger output and a C-example to reproduce this > failure. Thanks for reporting this bug and providing a simple example with which it can be demonstrated. I've duplicated the problem here, but don't have a fix for it yet. I've also entered it into our issues tracking system here: https://www.unidata.ucar.edu/jira/browse/NCF-187 in case you want to follow status of this bug, which I hope we'll fix before the 4.3 release. --Russ > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000014 > 0x00000001000a8cfd in var_create_dataset (grp=0x100938fa0, var=0x100943350, > write_dimid=0) at nc4hdf.c:1387 > 1387 if (var->dim[d]->unlimited) > (gdb) bt > #0 0x00000001000a8cfd in var_create_dataset (grp=0x100938fa0, > var=0x100943350, write_dimid=0) at nc4hdf.c:1387 > #1 0x00000001000aac1d in write_var (var=0x100943350, grp=0x100938fa0, > write_dimid=0) at nc4hdf.c:2222 > #2 0x00000001000ab68d in nc4_rec_write_metadata (grp=0x100938fa0) at > nc4hdf.c:2485 > #3 0x000000010009accc in sync_netcdf4_file (h5=0x10093fe90) at nc4file.c:2884 > #4 0x000000010009aec0 in close_netcdf4_file (h5=0x10093fe90, abort=0) at > nc4file.c:2950 > #5 0x000000010009b213 in NC4_close (ncid=65536) at nc4file.c:3079 > #6 0x0000000100008e24 in nc_close (ncid=65536) at dfile.c:1049 > #7 0x0000000100000e54 in main () at nc4test3.c:66 > (gdb) p *var > $1 = { > name = 0x100943430 "var_name", > hdf5_name = 0x0, > ndims = 1, > dimids = 0x1009429b0, > dim = 0x1009428f0, > varid = 0, > natts = 0, > next = 0x0, > prev = 0x0, > dirty = 1, > created = 1, > written_to = 0, > dimscale_attached = 0x1009435e0, > type_info = 0x100943550, > xtype = 5, > hdf_datasetid = 83886081, > att = 0x1009434d0, > no_fill = 0, > fill_value = 0x1009435d0, > chunksizes = 0x0, > contiguous = 1, > parallel_access = 0, > dimscale = 0, > dimscale_hdf5_objids = 0x1009435f0, > deflate = 0, > deflate_level = 0, > shuffle = 0, > fletcher32 = 0, > options_mask = 0, > pixels_per_block = 0, > chunk_cache_size = 1048576, > chunk_cache_nelems = 521, > chunk_cache_preemption = 0.75, > sdsid = 0, > hdf4_data_type = 0, > diskless_data = 0x0 > } > (gdb) p *var->dim > $2 = (NC_DIM_INFO_T *) 0x0 > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: KLM-754067 Department: Support netCDF Priority: Normal Status: Closed