Project

General

Profile

Seg fault trying to use maskregion on GFS GRIB2 files

Added by Don Morton about 9 years ago

Hello, I am very new to CDO, though have some experience with grib-api, wgrib, wgrib2, etc.

I'm trying to extract a region from a global NCEP GFS file and it seg-faults. When I run with strace I see mention of a missing grib_api kwbc table, which suggests to me some translation for NCEP data. It suggests missing kwbc tables, but I'm not convinced that's the actual problem:

$ strace cdo maskregion,myregion GF15021600 t.gr
.
.
.
open("/opt/grib-api-1.13.0/share/grib_api/definitions/grib2/tables/2/5.6.table", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=2159, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fef585c9000
read(5, "# CODE TABLE 5.6, Order of Spati"..., 4096) = 2159
read(5, "", 4096) = 0
close(5) = 0
munmap(0x7fef585c9000, 4096) = 0
brk(0x1e9c000) = 0x1e9c000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x110} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

Version information:

$ cdo -V
Climate Data Operators version 1.6.6 (http://code.zmaw.de/projects/cdo)
Compiled: by root on alaskawx (x86_64-unknown-linux-gnu) Mar 7 2015 01:01:03
Compiler: gcc -std=gnu99 -g -O2 -fopenmp
version: gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Features: PTHREADS OpenMP Z SSE2
Libraries:
Filetypes: srv ext ieg grb grb2 nc
CDI library version : 1.6.6 of Mar 7 2015 01:00:52
CGRIBEX library version : 1.7.0 of Sep 30 2014 13:27:33
GRIB_API library version : 1.13.0
netCDF library version : 4.1.3 of Feb 24 2014 21:05:37 $
HDF5 library version : 1.8.13
SERVICE library version : 1.3.2 of Mar 7 2015 01:00:32
EXTRA library version : 1.3.2 of Mar 7 2015 01:00:25
IEG library version : 1.3.3 of Mar 7 2015 01:00:29
FILE library version : 1.8.2 of Mar 7 2015 01:00:25

The myregions file is very simple:

10 45
10 55
20 55
20 45

I have been able to extract this region from these files using wgrib2, but by default that changes the lats to SN, and I need NS, so there's an extra step involved. Was wondering if CDO would be a little cleaner.

I am also attaching a simple GRIB2 file.

My apologies for being so new at this. I see lots of seg faults reported when I do searches on CDO, and I don't know if there may be simple tests for me to do, or if I am running across a bug.


Replies (2)

RE: Seg fault trying to use maskregion on GFS GRIB2 files - Added by Jaison-Thomas Ambadan about 9 years ago

Similar problem/issue with CDO v1.6.6 reported earlier. Here is Bug #5351 report by Uwe Schulzweida.

Bug #5351 (New): segfaults when writing grib2 files
Writing GRIB2 files with CDO results in a segmentation fault. Affected CDO versions are 1.6.5.2 and 1.6.6.
See also CDO user forum topic: https://code.zmaw.de/boards/1/topics/3145?r=3150

the bug seems fixed in the latest version: https://code.zmaw.de/versions/293

RE: Seg fault trying to use maskregion on GFS GRIB2 files - Added by Don Morton about 9 years ago

Thank you very much for your reply. I installed CDO v1.6.7 and am now able to process these files (maskregion isn't masking for me the way I would expect, but I'll look deeper into that and post again if I need to. invertlat works, so I'm much farther along than before).

I had naively assumed that 1.6.6 was the last "stable" version since I saw an announcement out for it, but not 1.6.7.

    (1-2/2)