-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function NC_check_nulls crashes with segfault for more than 1 var #1273
Comments
Ah, glad that someone else noticed it, too. I was surprised that I seemed to be the first one, but I wasn't able to find your issue or pull request. Thanks for your work. 😉 |
These changes have been merged into master. Check out the latest master and make sure it works for you, and if so, please close this issue. |
Could you possibly use your influence to get various package managers to move to 4.6.3? Apparently, macports just moved to 4.6.2 on March 9 and now lots of GMT users (who depend on the netcdf library) get various crashes. Is there any workaround other than getting 4.6.3 or reverting to 4.6.1? |
By crash, do you mean the subject of this issue? |
Looking at the code, It appears that if you specify a stride array (as all ones), |
1 similar comment
Looking at the code, It appears that if you specify a stride array (as all ones), |
Yes, here is a typical backtrace:
presumably NC_get_varm ens up calling NC_check_nulls which sets of the bug as described above. If I downgrade to 4.6.1 the problem goes away. |
I can see we are calling nc_put_varm_float with a stride of NULL. So are you saying we should pass a size_t stride[5] = {1, 1, 1, 1, 1} instead? |
Yes, you might try that since that error apparently is only |
Also, I am curious. Do you actually need to use put_varm instead of put_vars? |
Not 100% sure (the guy who did that part is in Germany) but think so. At any rate, passing the ones avoids the crash so I will go with that. Thanks! |
BTW, you only need a single vector of ones of length NC_MAX_VAR_DIMS |
Thanks, this problem is happening when reading 2-d slices from grids and they are of max 5 dimensions (same as size and count arrays) so I can get away with only 5. |
Macports updated to netcdf 4.6.3 on March 23 from ticket 58212. This resolves the original issue with NC_check_nulls. I think you can close this issue. It would be helpful for users needing Macports fixes and updates to start their own ticket, or to add a comment to an existing ticket. The Macports organization tends to be slow to respond, and a show of interest helps. |
ParaView crashed for me while working with netcdf files. I was able to track this down to an error in libnetcdf in this line:
netcdf-c/libdispatch/dvar.c
Line 705 in 98e6384
stride
is a pointer to a list of integers and not a list of pointers to integers. So we need to dereference the pointer first with braces:(*stride)[i] = 1;
After changing this locally for me, everything works fine with ParaView. 😃
I will open a PR for this.
The text was updated successfully, but these errors were encountered: