You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I have found a bug in the NetCDF C library, and I'm not sure of the best way to report it. I found your names on the Unidata staff listing.
It is related to NCF-187, (Fix bug resulting in segmentation violation when trying to add a _FillValue attribute to a variable in an existing netCDF-4 file defined without it.), which Russ Rew had fixed/closed about a year ago. We were seeing the SEGV in our software as well -- that no longer happens with NetCDF 4.4.0. However, now any previously existing attributes associated with the preexisting variable are wiped out, with only the newly added _FillValue attribute remaining.
I've traced rather extensively through the NetCDF and underlying HDF5 codes, and think I know why this happens. I don't have a good solution however:
i) The new _FillValue attribute is correctly added to the linked list of attributes associated with the variable (stackTrace0). It is marked as "dirty", and the variable itself is marked as having a new fill_value (fill_val_changed).
ii) When the file is closed, because "fill_val_changed" has been set, it is decided that the enitre variable ("dataset" in HDF5 parlance?) needs to be rewritten (stackTrace1).
iii) After the dataset is written, the list of attributes associated with the variable is traversed and attributes marked as "dirty" are added to the new dataset. However, only the newly added _FillValue has been marked as such, and consequently it is the only one written to the dataset (stackTrace2)
I hope this helps, and please let me know if I can help further.
Thanks!
The text was updated successfully, but these errors were encountered:
I've updated nc4hdf.c:write_var() so that when a variable has been created and the fill value changed (triggering a variable rewrite), all extant attributes associated with the var are flagged dirty ensuring that they are copied over. Tagging @DennisHeimbigner in case I'm missing something obvious.
Originally reported to Unidata via Email:
I believe I have found a bug in the NetCDF C library, and I'm not sure of the best way to report it. I found your names on the Unidata staff listing.
It is related to NCF-187, (Fix bug resulting in segmentation violation when trying to add a _FillValue attribute to a variable in an existing netCDF-4 file defined without it.), which Russ Rew had fixed/closed about a year ago. We were seeing the SEGV in our software as well -- that no longer happens with NetCDF 4.4.0. However, now any previously existing attributes associated with the preexisting variable are wiped out, with only the newly added _FillValue attribute remaining.
I've traced rather extensively through the NetCDF and underlying HDF5 codes, and think I know why this happens. I don't have a good solution however:
i) The new _FillValue attribute is correctly added to the linked list of attributes associated with the variable (stackTrace0). It is marked as "dirty", and the variable itself is marked as having a new fill_value (fill_val_changed).
ii) When the file is closed, because "fill_val_changed" has been set, it is decided that the enitre variable ("dataset" in HDF5 parlance?) needs to be rewritten (stackTrace1).
iii) After the dataset is written, the list of attributes associated with the variable is traversed and attributes marked as "dirty" are added to the new dataset. However, only the newly added _FillValue has been marked as such, and consequently it is the only one written to the dataset (stackTrace2)
I hope this helps, and please let me know if I can help further.
Thanks!
The text was updated successfully, but these errors were encountered: