pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.59k stars 1.08k forks source link

Segmentation fault when reading example GRIB file with xarray #4472

Closed jdassink closed 6 months ago

jdassink commented 4 years ago

When running the following example case from https://github.com/ecmwf/cfgrib, my iPython session crashes when using encodes version 2.18.0.

import xarray as xr
ds = xr.open_dataset('era5-levels-members.grib', engine='cfgrib')

returns: zsh: segmentation fault ipython

I noticed that the problem doesn't occur when running encodes version 2.17.0 instead of version 2.18.0

Environment:

INSTALLED VERSIONS

commit: None python: 3.7.6 | packaged by conda-forge | (default, Mar 5 2020, 15:03:29) [Clang 9.0.1 ] python-bits: 64 OS: Darwin OS-release: 19.5.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: None LOCALE: None.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.7.4

xarray: 0.16.1 pandas: 1.0.1 numpy: 1.18.1 scipy: 1.4.1 netCDF4: 1.5.4 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.2.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: 0.9.8.4 iris: None bottleneck: 1.3.2 dask: 2.20.0 distributed: 2.25.0 matplotlib: 3.2.0 cartopy: 0.18.0 seaborn: None numbagg: None pint: None setuptools: 49.6.0.post20200814 pip: 20.2.2 conda: None pytest: None IPython: 7.13.0 sphinx: None

raybellwaves commented 3 years ago

Works ok for me on my mac

conda create -n test_env python=3.8 --y
conda activate test_env
conda install -c conda-forge xarray cfgrib ipython
wget http://download.ecmwf.int/test-data/cfgrib/era5-levels-members.grib

ipython
import xarray as xr
ds = xr.open_dataset('era5-levels-members.grib', engine='cfgrib')
Screen Shot 2021-02-16 at 6 20 32 AM
kmuehlbauer commented 6 months ago

If this is still an issue with recent eccodes/xarray, please reopen with updated environment information.