When concatenating along a record dimension with non-time units, e.g. after using ncpdq to permute longitude into the record dimension for concatenation, ncrcat v4.0.8 crashes inside libudunits2. Removing the record dimension's units, or changing them to something like "days since 0001-01-01 00:00:00", gives no crash.
Output of `uname -a` on my platform:
Linux an003 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
Demo of the bug:
#!/bin/csh -f
# This script produces the following output:
#
# ncrcat 4.0.8:
# *** glibc detected *** /usr/local/nco-4.0.8/bin/ncrcat: double free or corruption (fasttop): 0x0000000015332de0 ***
# ======= Backtrace: =========
# /lib64/libc.so.6[0x2ae9857cf45f]
# /lib64/libc.so.6(cfree+0x4b)[0x2ae9857cf8bb]
# /app/udunits-2.1.19/lib/libudunits2.so.0[0x2ae985428478]
# /app/udunits-2.1.19/lib/libudunits2.so.0(ut_free+0x25)[0x2ae985429cb5]
# /usr/local/nco-4.0.8/lib/libnco-4.0.8.so(nco_cln_clc_dff+0x14b)[0x2ae9849762eb]
# /usr/local/nco-4.0.8/lib/libnco-4.0.8.so(nco_cln_clc_org+0xd5)[0x2ae984975765]
# /usr/local/nco-4.0.8/lib/libnco-4.0.8.so(nco_lmt_evl+0x426)[0x2ae984986676]
# /usr/local/nco-4.0.8/bin/ncrcat[0x405d83]
# /lib64/libc.so.6(__libc_start_main+0xf4)[0x2ae98577a994]
# /usr/local/nco-4.0.8/bin/ncrcat[0x4041b9]
# ...
ncgen -o f1.nc << EOF
netcdf f1 {
dimensions:
lon = UNLIMITED ; // (1 currently)
variables:
float temp(lon) ;
temp:missing_value = -1.e+10f ;
float lon(lon) ;
lon:units = "degrees_E" ;
data:
temp = 13.99574 ;
lon = -278.5 ;
}
EOF
ncgen -o f2.nc << EOF
netcdf f2 {
dimensions:
lon = UNLIMITED ; // (1 currently)
variables:
float temp(lon) ;
temp:missing_value = -1.e+10f ;
float lon(lon) ;
lon:units = "degrees_E" ;
data:
temp = 14.30086 ;
lon = -188.5 ;
}
EOF
ncrcat -O -h f1.nc f2.nc f.nc
Thank you for this report. I have reproduced the bug and am working on a solution.
I have not forgotten this bug. Neither have I worked enough on it. I will make it a priority when the new programmer arrives...
Thanks for reporting this and for your patience. Code patch is now committed and will be in next stable release.
cz