-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
netcdf: segmentation fault when creating a file in a non-existing directory #11918
Comments
@mjwoods Would you like to provide any information about this issue? |
Is hopefully fixed with PR #11920. |
Thanks for prompt action. I confirm that mingw-w64-x86_64-netcdf-4.9.0-2-any.pkg.tar.zst fixes the issue. I assume you're going to forward upstream the patch ? Another "issue" I found is that upstream netCDF changed again their mind about filename encoding. In netCDF 4.8, filenames were expected to be in UTF-8 (previously was in current ANSI code page). And now with 4.9 they switched back to expected them to be in the current ANSI code page (a side effect or intended consequence of Unidata/netcdf-c#2277 I cannot really say). Sigh... But I'll take it as a "feature" which I've adopted my software to, and I hope they won't change again their mind in 4.10... |
Tried to upstream the change. But they seem to have elaborate requirements for contributions. If you already went through that process, feel free to submit a PR to them. |
I've already submited PRs, but don't recall the CLA thing was in place (or maybe I just don't remember). Looking quickly, it seems it is just a matter of clicking on a few buttons to accept the CLA. I could do it if that's not practical for you |
Yes, please do. Those pages don't want to load correctly for me. (And I don't understand why they want to collect my address, phone number, ...) |
hum, I guess I need you to transfer copyright of your contribution to me so I have the legal right to contribute it under the CLA. Just a comment here will do for me :-) |
I thought I already gave the permission with the comments here. But to be completely explicit with no room of doubt: |
It looks like on some platforms (e.g., MinGW) errno isn't set when opening a file failed. That combination of a file id <0 and errno still 0 leads to a segmentation fault later on. A possible solution to avoid that segfault is to set the status to ENOENT if errno is unexpectedly 0. That leads to the error ("No such file or directory") that was reportedly emitted before version 4.9.0. See also this report downstream: msys2/MINGW-packages#11918
This is a regression due to the update to 4.9.0 done in #11879. Previous 4.8.1-4 package errors out cleanly. Issue found on the GDAL autotest continuous integration (cf OSGeo/gdal#5970)
where byte_no_cf.nc is in the attached zip (but true for any netCDF file).
byte_no_cf.nc.zip
vs
The text was updated successfully, but these errors were encountered: