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 Zarr dataset with "dtype":"|u1" #2062

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

assertion() when opening a Zarr dataset with "dtype":"|u1" #2062

rouault opened this issue Aug 9, 2021 · 0 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 byte.zarr.zip (after unzipping it),

$ gdb --args ncdump/ncdump "file:///tmp/byte.zarr#mode=zarr,file"
(gdb) r
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7bf3859 in __GI_abort () at abort.c:79
#2  0x00007ffff7bf3729 in __assert_fail_base (fmt=0x7ffff7d89588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff7f831f0 "type && type->format_type_info != NULL", 
    file=0x7ffff7f83128 "/home/even/netcdf-c/libnczarr/zclose.c", line=225, function=<optimized out>) at assert.c:92
#3  0x00007ffff7c04f36 in __GI___assert_fail (assertion=0x7ffff7f831f0 "type && type->format_type_info != NULL", file=0x7ffff7f83128 "/home/even/netcdf-c/libnczarr/zclose.c", line=225, 
    function=0x7ffff7f83258 <__PRETTY_FUNCTION__.9091> "zclose_type") at assert.c:101
#4  0x00007ffff7effedc in zclose_type (type=0x0) at /home/even/netcdf-c/libnczarr/zclose.c:225
#5  0x00007ffff7effd11 in zclose_vars (grp=0x5555555c8990) at /home/even/netcdf-c/libnczarr/zclose.c:172
#6  0x00007ffff7effa16 in zclose_group (grp=0x5555555c8990) at /home/even/netcdf-c/libnczarr/zclose.c:91
#7  0x00007ffff7eff891 in ncz_close_file (file=0x5555555c88c0, abort=1) at /home/even/netcdf-c/libnczarr/zclose.c:44
#8  0x00007ffff7f07b6f in ncz_open_file (path=0x5555555c80f0 "file:///tmp/byte.zarr#mode=zarr,file,nczarr", mode=4096, controls=0x5555555c87d0, ncid=65536) at /home/even/netcdf-c/libnczarr/zopen.c:127
#9  0x00007ffff7f07c73 in NCZ_open (path=0x5555555c80f0 "file:///tmp/byte.zarr#mode=zarr,file,nczarr", mode=4096, basepe=0, chunksizehintp=0x0, parameters=0x0, dispatch=0x7ffff7fb08e0 <NCZ_dispatcher>, 
    ncid=65536) at /home/even/netcdf-c/libnczarr/zopen.c:183
#10 0x00007ffff7e27ee4 in NC_open (path0=0x55555558c940 "file:///tmp/byte.zarr#mode=zarr,file", omode=4096, basepe=0, chunksizehintp=0x0, useparallel=0, parameters=0x0, ncidp=0x7fffffffce04)
    at /home/even/netcdf-c/libdispatch/dfile.c:2128
#11 0x00007ffff7e26c07 in nc_open (path=0x55555558c940 "file:///tmp/byte.zarr#mode=zarr,file", omode=0, ncidp=0x7fffffffce04) at /home/even/netcdf-c/libdispatch/dfile.c:657
#12 0x000055555555e141 in main (argc=1, argv=0x7fffffffdf50) at /home/even/netcdf-c/ncdump/ncdump.c:2423

This is due to "dtype":"|u1", which is valid. Changing it to "<u1" works around the issue

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.

1 participant