Project

General

Profile

segfaults when accessing grib2 files

Added by Thorsten Riess over 9 years ago

Hi,
I've got a problem using cdo with grib2 files.
My setup: Ubuntu 14.04 (amd64), tested cdo versions: 1.6.2 (from the repository), 1.6.5.2, 1.6.6

Simple test case:
cdo -f grb2 copy grb_in.grib2 grb_out.grib2
results in a segmentation fault (using a GFS grib file, any other grib file I tried gives the same result).

Backtrace:
#0 0x00007ffff56f9d6a in ?? () from /usr/lib/libgrib_api.so.0
#1 0x00007ffff56fa2ee in grib_find_accessor () from /usr/lib/libgrib_api.so.0
#2 0x00007ffff56fd126 in grib_get_long () from /usr/lib/libgrib_api.so.0
#3 0x00007ffff7b6feb5 in gribapiEncode () from /usr/lib/x86_64-linux-gnu/libcdi.so.0
#4 0x00007ffff7b642ce in ?? () from /usr/lib/x86_64-linux-gnu/libcdi.so.0
#5 0x00007ffff7b645fb in grb_write_var_slice () from /usr/lib/x86_64-linux-gnu/libcdi.so.0
#6 0x00007ffff7b64a5e in grb_write_record () from /usr/lib/x86_64-linux-gnu/libcdi.so.0
#7 0x00007ffff7b76cb7 in ?? () from /usr/lib/x86_64-linux-gnu/libcdi.so.0
#8 0x00007ffff7b76dc4 in streamWriteRecord () from /usr/lib/x86_64-linux-gnu/libcdi.so.0
#9 0x0000000000587b83 in ?? ()
#10 0x00000000004241aa in ?? ()
#11 0x000000000040ec13 in ?? ()
#12 0x00007ffff59bfec5 in __libc_start_main (main=0x40e86a, argc=6, argv=0x7fffffffdc48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdc38) at libc-start.c:287
#13 0x000000000040b3f9 in ?? ()

I've also tried different versions of grib-api (1.9.9 to 1.12.3), same result for all of them.

For comparison, the cdo version in the Ubuntu 12.04 repositories (1.5.3 with grib-api 1.9.9) seems to work.

Unfortunately, remapping grib files also results in segfaults. Temporary workaround: convert the grib file to nc (which works) and then remap. However, for gme grids this is not possible, here I have to use grib -> ext -> nc + manual grid definition.

Any help is appreciated!
Thanks,
Thorsten.


Replies (2)

RE: segfaults when accessing grib2 files - Added by Uwe Schulzweida over 9 years ago

Hi Thorsten,

Thanks for the information, this is definitely a bug in CDO. I will fix this problem as son as possible.

Cheers,
Uwe

RE: segfaults when accessing grib2 files - Added by Thorsten Riess over 9 years ago

Great, thank you very much!
Cheers,
Thorsten.

    (1-2/2)