Project

General

Profile

cdo 1.6.4 buffer overflow detected

Added by Martin Jury over 8 years ago

Dear all,

I just tried to perfrom some cdo operations on certain files and encountered a similar error as described in:
[[https://code.zmaw.de/boards/1/topics/3147]]

Oddly the error so far only appered when calling cdo sinfo, other cdo operations like selyear are working fine.

Though I have not reinstalled nor updated cdo and the error just appears on certain files:

cdo -V

Climate Data Operators version 1.6.4 (http://code.zmaw.de/projects/cdo)
Compiled: by buildd on brahms (x86_64-unknown-linux-gnu) Oct 16 2014 13:09:38
Compiler: gcc -std=gnu99 -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
version: gcc (Debian 4.9.1-17) 4.9.1
Features: PTHREADS OpenMP NC4 OPeNDAP Z JASPER PROJ.4 MAGICS
Libraries: proj/4.8
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.6.4 of Oct 16 2014 13:09:17
GRIB_API library version : 1.10.4
netCDF library version : 4.1.3 of Oct 3 2014 13:49:32 $
HDF5 library version : 1.8.13
SERVICE library version : 1.3.2 of Oct 16 2014 13:08:54
EXTRA library version : 1.3.2 of Oct 16 2014 13:08:45
IEG library version : 1.3.2 of Oct 16 2014 13:08:51
FILE library version : 1.8.2 of Oct 16 2014 13:08:45

When I intend to process this netcdf4 files I encounter the following error:

File format : netCDF4
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID * buffer overflow detected *: cdo terminated ======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x731ff)[0x7ff3e41fe1ff]
/lib/x86_64-linux-gnu/libc.so.6(_fortify_fail+0x37)[0x7ff3e42814c7]
/lib/x86_64-linux-gnu/libc.so.6(+0xf46e0)[0x7ff3e427f6e0]
cdo[0x49339e]
cdo[0x40c381]
/lib/x86_64-linux-gnu/libc.so.6(
_libc_start_main+0xf5)[0x7ff3e41acb45]
cdo[0x40d214] ======= Memory map: ========

also followed by a list of library links ending with

7fffb421e000-7fffb4272000 rw-p 00000000 00:00 0                          [stack]
7fffb42d0000-7fffb42d2000 r-xp 00000000 00:00 0 [vdso]
7fffb42d2000-7fffb42d4000 r--p 00000000 00:00 0 [vvar]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
1 : unknown Aborted

The output of nc-config --all is as follows:

This netCDF 4.1.3 has been built with the following features:
--cc        -> gcc
--cflags -> -I/usr/include -DgFortran
--libs -> -L/usr/lib -lnetcdf
--cxx       -> g++
--has-c++ -> yes
--fc        -> gfortran
--fflags -> -g -O2 -I/usr/include
--flibs -> -L/usr/lib -lnetcdff -lnetcdf
--has-f77 -> yes
--has-f90 -> yes
--has-dap   > yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> no
--has-pnetcdf
> no
--has-szlib ->
--prefix    > /usr
--includedir
> /usr/include
--version -> netCDF 4.1.3

I attached the error log and a snippet of the concerning netcdf files.

Can you please help me figure that out what is cousing this error. It may be quite similar to
[[https://code.zmaw.de/boards/1/topics/3147]]

Thanks!!
Martin


Replies (1)

RE: cdo 1.6.4 buffer overflow detected - Added by Ralf Mueller over 8 years ago

Hi!

I cannot reproduce this behaviour with the current release and with 1.6.4 linked to recent netcdf version:

Climate Data Operators version 1.6.4 (http://code.zmaw.de/projects/cdo)
Compiled: by ram on luthien (x86_64-unknown-linux-gnu) Nov 23 2015 10:37:58
Compiler: gcc -g -O2 -fopenmp 
 version: gcc (GCC) 5.2.0
Features: PTHREADS OpenMP NC4 Z FFTW3
Libraries:
Filetypes: srv ext ieg grb nc nc2 nc4 nc4c 
     CDI library version : 1.6.4 of Nov 23 2015 10:37:53
 CGRIBEX library version : 1.6.4 of Jun 27 2014 14:00:04
  netCDF library version : 4.3.3.1 of Oct 28 2015 01:20:54 $
 SERVICE library version : 1.3.2 of Nov 23 2015 10:37:51
   EXTRA library version : 1.3.2 of Nov 23 2015 10:37:51
     IEG library version : 1.3.2 of Nov 23 2015 10:37:51
    FILE library version : 1.8.2 of Nov 23 2015 10:37:51

It might might be, that netcdf-4.1.3 hast some problems, but that's just guessing. I recommend updating both netcdf and cdo. In order to get closer to what's really happening, you should let the gdb debugger run you call.

btw.: There are pre-built debian packages for cdo

hth
ralf

    (1-1/1)