Skip to content

netCDF fails on zarr file with variable length array #2516

@JamiePringle

Description

@JamiePringle

On netcdf 4.8.1 when I try to use ncdump to print a zarr file with a variable length (jagged) array, it crashes with a segmentation fault. On 4.9.0 on a mac, the same command hangs indefinitely. The zarr files have no compression, this is a separate issue from #2484 . The attached code creates two zarr data stores. The first, ExampleNoVlen.zarr just has a simple array, and ncdump 'file://ExampleNoVlen.zarr#mode=nczarr,zarr' produces

netcdf ExampleNoVlen {
dimensions:
	.zdim_5 = 5 ;
variables:
	double x(.zdim_5) ;
data:

 x = 0, 1, 2, 3, 4 ;
}

The second data store created, ExampleVlen.zarr, when printed with ncdump 'file://ExampleVlen.zarr#mode=nczarr,zarr'`, dies with a segmentation fault. When the file is loaded with python and zarr, printing the variable x produces

In [2]: data=zarr.open('ExampleVlen.zarr')

In [3]: data.x[:]
Out[3]: 
array([array([], dtype=float64), array([0.]), array([0., 1.]),
       array([0., 1., 2.]), array([0., 1., 2., 3.])], dtype=object)

The code to produce the two files in python with zarr is attached.

Thanks,
Jamie Pringle

break_ZarrNetCDF.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions