ncecat segfaults after update to 4.3.6

Developers
2013-10-09
2013-10-17
  • Hi,
    I just updated from nco 4.0.8 to 4.3.6 and suddenly ncecat segfaults with an error message:

    The two files look like this:

    jang@pc3059:~/tmp/nco_error$ ncdump -h Day01.nc
    netcdf Day01 {
    dimensions:
    latitude = 161 ;
    longitude = 320 ;
    variables:
    int time_in ;
    time_in:long_name = "time" ;
    time_in:units = "hours since 1900-01-01 00:00:0.0" ;
    double ssaod550(latitude, longitude) ;
    ssaod550:_FillValue = -32767. ;
    ssaod550:long_name = "Sea Salt Aerosol Optical Depth at 550nm" ;
    ssaod550:missing_value = -32767s ;
    ssaod550:units = "~" ;
    float latitude(latitude) ;
    latitude:units = "degrees_north" ;
    latitude:long_name = "latitude" ;
    float longitude(longitude) ;
    longitude:units = "degrees_east" ;
    longitude:long_name = "longitude" ;

    // global attributes:
    :history = "Wed Oct  9 07:54:34 2013: ncwa -a time -O -o Daily_003.nc temp.nc\n",
    "Wed Oct  9 07:54:34 2013: ncecat -O -u time -n 8,2,1 Daily_003_01.nc temp.nc\n",
    "Wed Oct  9 07:54:17 2013: ncap2 -o TS_00017.nc -O -s time_in=990603 TS_00017.nc\n",
    "Wed Oct  9 07:54:17 2013: ncap2 -o prototype.nc -O -s ssaod550(:,:)=-32767 prototype.nc\n",
    "Wed Oct  9 07:54:17 2013: ncrename -O -v time,time_in temp2.nc\n",
    "Wed Oct  9 07:54:17 2013: ncwa -a time -O -o temp2.nc temp2.nc\n",
    "Wed Oct  9 07:54:17 2013: ncks -F -O -d time,40 temp.nc temp2.nc\n",
    "Wed Oct  9 07:54:15 2013: ncpdq -U -O -o temp.nc ../download/20131008/ssaod550_20131008.nc\n",
    "2013-10-08 19:19:28 GMT by grib_to_netcdf-1.10.4" ;
    :nco_openmp_thread_number = 1 ;
    :Conventions = "CF-1.0" ;
    :NCO = "4.3.6" ;
    }

    jang@pc3059:~/tmp/nco_error$ ncdump -h Day02.nc
    netcdf Day02 {
    dimensions:
    latitude = 161 ;
    longitude = 320 ;
    variables:
    float latitude(latitude) ;
    latitude:units = "degrees_north" ;
    latitude:long_name = "latitude" ;
    float longitude(longitude) ;
    longitude:units = "degrees_east" ;
    longitude:long_name = "longitude" ;
    double ssaod550(latitude, longitude) ;
    ssaod550:_FillValue = -32767. ;
    ssaod550:missing_value = -32767s ;
    ssaod550:units = "-" ;
    ssaod550:long_name = "Sea Salt Aerosol Optical Depth at 550nm" ;
    int time_in ;
    time_in:units = "hours since 1900-01-01 00:00:0.0" ;
    time_in:long_name = "time" ;

    // global attributes:
    :history = "Wed Oct  9 07:54:34 2013: ncwa -a time -O -o Daily_004.nc temp.nc\n",
    "Wed Oct  9 07:54:34 2013: ncecat -O -u time -n 8,2,1 Daily_004_01.nc temp.nc\n",
    "Wed Oct  9 07:47:35 2013: ncrename -O -v time,time_in temp2.nc\n",
    "Wed Oct  9 07:47:35 2013: ncwa -a time -O -o temp2.nc temp2.nc\n",
    "Wed Oct  9 07:47:35 2013: ncks -F -O -d time,1 temp.nc temp2.nc\n",
    "Wed Oct  9 07:47:35 2013: ncpdq -U -O -o temp.nc ../download/20130104/ssaod550_20130104.nc\n",
    "2013-01-04 20:57:27 GMT by mars2netcdf-0.92" ;
    :nco_openmp_thread_number = 1 ;
    :Conventions = "CF-1.0" ;
    :NCO = "4.3.6" ;
    }

    The command I am using is this:

    ncecat -O -u time -n 2,2,1 Day01.nc od550ss.2013.nc

    With nco 4.0.8 everything works as expected.

    The difference is only the order of the variables (coming from a different way of producing them; one is actual data, one a prototype filled with NaNs). If the order is the same ncecat works as exoected. Is this a new feature or a bug?

    Thanks for your help!

    Jan

     
  • Charlie Zender
    Charlie Zender
    2013-10-09

    Jan,
    Thank you for this report. It has the depressing tonality of a bug that slipped through our extensive regression tests :)
    The order of variables should make no difference to the user, yet it is one of those things must be carefully handled
    by the application. When we rewrote ncecat, it's possible the ordering checker was broken. Would you please post those
    files, or smaller versions of them that demonstrate the same problem, on a public website so I can verify the problem?
    Thanks,
    cz

     
  • Charlie Zender
    Charlie Zender
    2013-10-09

    Jan, no need to post your files. i can reproduce the ncecat problem with the three commands that follow. we will fix this ASAP and post here when fix has been committed. cz

          ncks -O    -v time,one ~/nco/data/in.nc ~/foo1.nc
          ncks -O -a -v one,time ~/nco/data/in.nc ~/foo2.nc
          ncecat -O -p ~ foo1.nc foo2.nc ~/foo3.nc
    
     
  • Charlie Zender
    Charlie Zender
    2013-10-09

    Jan,
    I have committed a fix to this problem. If you can, please install the latest snapshot and let us know whether the fix works for you. If installing snapshots is not your cup of tea, be assured that this will be in the next release, NCO 4.3.7, probably within a month.
    cz

     
  • Hi Zender,

    I have updated to the lated cvs version and recompiled and it works now again.

    Thanks for your great work. It really makes my work much easier.

    Jan