-
Notifications
You must be signed in to change notification settings - Fork 267
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
Undefined behavior in ncx.c, nc_test #2796
Comments
Tagging @wkliao as a relevant expert/resource. Any insight is greatly appreciated :) |
Follow up: Note that there are other files reporting |
I cannot duplicate this error. Is it possible to get github actions or appveyor to cause the error |
@DennisHeimbigner I do not expect it will be easy to recreate as it is the result of undefined behavior; I can only get it to manifest under specific circumstances locally. Instead, on Linux, try this from the top level netcdf-c directory: $ mkdir build && cd build You'll have to make adjustments for your local environment, library paths and whatnot, but you should see a whole screed of undefined behavior warnings. Before I go too far trying to fix these, we have a backlog of PR's that I want to go through and merge; a few are related to eliminating warnings, so I am going to take a look at those first. |
Does #2800 resolve this issue? I do not see errors and I am using
and gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 However, I do see the followings in ncdump test.
|
It appears to, yes @wkliao. Thanks! |
We are currently seeing a failure in
nc_test
under the latest version ofVisual Studio
; the most recent update has resulted in this issue coming to light. Previously, it would run just fun. Currently, we only see the failure when running build typeRelease
; build typesDebug
andRelWithDebInfo
report success. The failure in this environment is 'value read not value expected' forCDF5
tests.These failures are a red herring, and symptomatic, I believe, of a larger issue
In trying to debug this, I've compiled
nc_test
with-fsanitize=undefined
usingclang
onMacOS
, and then runningnc_test
. Output is attached, but as we can see, there are a number of instances wherencx.c
relies on undefined behavior.The issues are straight forward, but the sticking point is that
ncx.c
is generated fromncx.m4
, and I am not anm4
wizard; I'm working through it to see what's going on and how to address some of these issues, but it is possible that somebody more familiar withm4
may see the solution faster. @DennisHeimbignerOutput from
nc_test
with-fsanitize=undefined
attached.The text was updated successfully, but these errors were encountered: