-
Notifications
You must be signed in to change notification settings - Fork 262
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
NC_DISKLESS returns garbage data for certain files #401
Comments
@WardF if you wouldn't mind looking at this it would really help, I'm kinda heavily invested in getting in-mem working and ran into this with regular |
btw, have a fix in #400, however not sure why it works with that fix. |
I will take a look; I was out of town for the past week but will start digging into this shortly. |
It may be relevant that your test file foo.nc is cdf5 format. |
Just a note; your example program is incomplete, insofar as I'll try to recreate this in straight C in the meantime, and will also take a look at pull request #400. I'm pleased to have a fix although I'd be loathe to include it until we're sure why it works :). |
whoops, sorry, fixed |
Thanks; replicated on my end, and using |
ok updated code again with what I just ran. Just re-tried with NC_CDF5 and didn't make a difference, I'm 90% sure the issue is related the the code called by |
Thanks; I suspect you're right. I've asked @DennisHeimbigner to take a look at #400 since he wrote the code, but I've confirmed that it corrects this issue. I'm going to write a plain C test that we can incorporate into our unit testing and, once that is done and @DennisHeimbigner has given his input/ok, I will merge in the fix. Thanks very much for your help diagnosing and correcting this! |
no problem! I'm really curious why this "fixes" it. Anxious to hear @DennisHeimbigner's investigation :) I'm really excited now that I can drop scipy. I gave up on it after finding yet another bug and realized they had >800 open issues. |
I did not investigations and confirmed the problem. I tried three different
|
One more thing. Can you look at your config.h file and see if |
doesn't look like it
|
Interestingly enough, when I try to run this test from a straight C program
integrated into the unit tests, the issue disappears. Investigating
further.
…On Tue, May 2, 2017 at 2:17 PM, Alexander Mohr ***@***.***> wrote:
doesn't look like it
brew install homebrew/science/netcdf
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).
No changes to formulae.
==> Installing netcdf from homebrew/science
==> Downloading https://homebrew.bintray.com/bottles-science/netcdf-4.4.1.1_4.sierra.bottle.tar.gz
Already downloaded: /Users/amohr/Library/Caches/Homebrew/netcdf-4.4.1.1_4.sierra.bottle.tar.gz
==> Pouring netcdf-4.4.1.1_4.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/netcdf/4.4.1.1_4: 66 files, 2.3MB
***@***.***:~/dev/thehesiod/netcdf4-python/netCDF4$ rgrep /usr/local/Cellar/netcdf/4.4.1.1_4/include "HAVE_MREMAP|HAVE_MMAP"
***@***.***:~/dev/thehesiod/netcdf4-python/netCDF4$
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#401 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEH-UmZovQ8b0a_Qy_61R_xbWZaaqs5Hks5r149igaJpZM4NNiV->
.
|
The test file can be seen here: https://github.com/Unidata/netcdf-c/blob/ghpull-400/nc_test/tst_diskless_mem.c If you build w/ diskless and then run the test manually, you should see the contents of the array printed to standard out. The plan was to do an explicit test for value range, but when I run this code I don't see any error as expected. Note that your pull request has not been integrated into this branch yet; I expect to see a failure, so that I can confirm the failure goes away when the pull request is merged. |
perhaps you don't have enough test data? I'm guessing it happens when it crosses some boundary. |
I'm using the data you provided. I generated the file from your |
probably will need to debug the code where it does repro I guess |
Yes; I'm just making notes here to myself as much as anything. Since I can recreate the issue (and it sounds like Dennis can as well), just need to figure out why it goes away in this circumstance. So perhaps not as straight forward as one would hope. |
Does the test as written fail for you on your system?
…On Tue, May 2, 2017 at 2:34 PM, Alexander Mohr ***@***.***> wrote:
probably will need to debug the code where it does repro I guess
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#401 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEH-UjZo1ff8xNbvdVyGGgMxQpQH2j24ks5r15NZgaJpZM4NNiV->
.
|
using
and running it, doesn't seem to reproduce any garbage data. |
Ok, additional information. Running the test program provided against the |
foo.nc was generated with |
This is tickling something at the back of my mind, but I'll need to think a little bit and dig through closed issues. I assume that netcdf4-python was using the latest release, 4.4.1.1. I'd be curious to see if this issue occurred with a file generated by netcdf4-python against the current |
It's interesting that the same file, generated with the C library (sameness confirmed by comparing ncdump output) does not exhibit this issue. It's not necessarily informative, but interesting. |
Attaching the version of |
Is your generated file also CDF5?
…On 5/2/2017 3:04 PM, Ward Fisher wrote:
It's interesting that the same file, generated with the C library
(sameness confirmed by comparing ncdump output) does not exhibit this
issue. It's not necessarily informative, but interesting.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#401 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA3P2zEobfZzm05_B9xghpvBG96LATXjks5r15pGgaJpZM4NNiV->.
|
I'll try to generate a CDF3 version to see if we get the same issue |
Good catch Dennis; no, it is not, it is Given that #400 seems to fix the issue, perhaps looking at that (3 changes, I believe?) it will provide some insight into what's going wrong? It doesn't for me since I'm less familiar with the code but it would be where I'd start. |
ya, verified doesn't happen with classic I generated |
Problem identified. In all of the ncio code in libsrc, |
Fixed by pr #403 |
Closing issue as it was fixed as outlined by Dennis. |
using the latest netcdf-c from master,
NC_DISKLESS
mode can return garbage data for certain files.With the following file:
foo.zip
and the following code:
note there's no errors, however rows > 100 return garbage, row 100 looks like:
whereas row 101 looks like:
opening the same file with
nc_open
does not return corrupt data.The text was updated successfully, but these errors were encountered: