-
Notifications
You must be signed in to change notification settings - Fork 264
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
OpenDAP hang on Mingw-w64 #2083
Comments
In case it helps, here is a backtrace from gdb after interrupting the hanging ncdump example given earlier. To trigger the hang, the package was built with
|
Looking at the string.h file shown in the backtrace above, I noticed that line 117 is as follows:
The macro |
I assume it works because adding that -D flag
My guess is that there is some .h file that defines __CRT_INLINE |
Hi Dennis, Thanks for your comment. I suppose this could be an issue for the mingw-w64 team, but there may be something special about the way netcdf is using the string functions, so it seemed worthwhile to ask here first. Any clues you can offer will be helpful. The __CRT_INLINE macro is defined in the file C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h, as follows:
|
Well "strcasecmp" is conditionally defined in ncconfigure.h. |
That was a good hint @DennisHeimbigner . I was able to patch netcdf-4.7.4 so that the redefinitions of |
pacman -S mingw64/mingw-w64-x86_64-netcdf
)ncdump
ncdump -hs https://cida.usgs.gov/thredds/dodsC/stageiv_combined
The problem appears to be triggered by compiler optimisations. I have tested gcc-8, gcc-10 and clang-12, and the hang occurs for all of them with the default optimizations chosen by CMake. The hang does NOT occur with optimisation at
-O1
or lower.Looking more closely at the optimization options for gcc, I found a specific optimization that causes the problem:
-foptimize-sibling-calls
. OpenDAP appears to work correctly if the package is compiled with-O3 -fno-optimize-sibling-calls
.Although there seems to be a workaround, it would be better to understand the root cause of the problem, which is why I am reporting it here.
The text was updated successfully, but these errors were encountered: