Skip to content
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

assertion() when opening a non-nczarr zarr dataset in nczarr mode #2061

Closed
rouault opened this issue Aug 9, 2021 · 2 comments · Fixed by #2066
Closed

assertion() when opening a non-nczarr zarr dataset in nczarr mode #2061

rouault opened this issue Aug 9, 2021 · 2 comments · Fixed by #2066

Comments

@rouault
Copy link
Contributor

rouault commented Aug 9, 2021

netcdf git at 84f0696, Ubuntu 20.04

on the attached zarr dataset groups_regular.zarr.zip (after unzipping it),

$ gdb --args ncdump/ncdump  "file://groups_regular.zarr#mode=nczarr,file"
(gdb) r
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f0cd3d in define_vars (file=0x5555555c8840, grp=0x5555555d0550, varnames=0x5555555d7410) at /home/even/netcdf-c/libnczarr/zsync.c:1514
1514	   	    assert((NCJsort(jncvar) == NCJ_DICT));
(gdb) bt
#0  0x00007ffff7f0cd3d in define_vars (file=0x5555555c8840, grp=0x5555555d0550, varnames=0x5555555d7410) at /home/even/netcdf-c/libnczarr/zsync.c:1514
#1  0x00007ffff7f0b928 in define_grp (file=0x5555555c8840, grp=0x5555555d0550) at /home/even/netcdf-c/libnczarr/zsync.c:1139
#2  0x00007ffff7f0d3c4 in define_subgrps (file=0x5555555c8840, grp=0x5555555c8910, subgrpnames=0x5555555cfcb0) at /home/even/netcdf-c/libnczarr/zsync.c:1607
#3  0x00007ffff7f0b948 in define_grp (file=0x5555555c8840, grp=0x5555555c8910) at /home/even/netcdf-c/libnczarr/zsync.c:1142
#4  0x00007ffff7f0b67c in ncz_read_file (file=0x5555555c8840) at /home/even/netcdf-c/libnczarr/zsync.c:1051
#5  0x00007ffff7f07ad9 in ncz_open_file (path=0x5555555c80f0 "file://groups_regular.zarr#mode=nczarr,file", mode=4096, controls=0x5555555c8170, ncid=65536) at /home/even/netcdf-c/libnczarr/zopen.c:106
#6  0x00007ffff7f07c73 in NCZ_open (path=0x5555555c80f0 "file://groups_regular.zarr#mode=nczarr,file", mode=4096, basepe=0, chunksizehintp=0x0, parameters=0x0, dispatch=0x7ffff7fb08e0 <NCZ_dispatcher>, 
    ncid=65536) at /home/even/netcdf-c/libnczarr/zopen.c:183
#7  0x00007ffff7e27ee4 in NC_open (path0=0x55555558c940 "file://groups_regular.zarr#mode=nczarr,file", omode=4096, basepe=0, chunksizehintp=0x0, useparallel=0, parameters=0x0, ncidp=0x7fffffffcdf4)
    at /home/even/netcdf-c/libdispatch/dfile.c:2128
#8  0x00007ffff7e26c07 in nc_open (path=0x55555558c940 "file://groups_regular.zarr#mode=nczarr,file", omode=0, ncidp=0x7fffffffcdf4) at /home/even/netcdf-c/libdispatch/dfile.c:657
#9  0x000055555555e141 in main (argc=1, argv=0x7fffffffdf40) at /home/even/netcdf-c/ncdump/ncdump.c:2423
@DennisHeimbigner
Copy link
Collaborator

How did you generate that file?

@rouault
Copy link
Contributor Author

rouault commented Aug 9, 2021

How did you generate that file?

nccopy groups.h5 "file://groups_regular.zarr#mode=zarr,file" with groups.h5 from https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/data/hdf5/groups.h5?raw=true

DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this issue Aug 9, 2021
re: Issues Unidata#2063, Unidata#2062, Unidata#2061, Unidata#2059

1. Support "fill_value: null" (Unidata#2063).
2. Handle the dtype case "|u1" (Unidata#2062).
3. When writing a pure Zarr format file, some nczarr attributes inadvertently crept in (Unidata#2061).
4. If there is no fill value, then the .zarray fill_value key should have the value null rather than left out (Unidata#2059).

Hat tip: Even Rouault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants