Description of problem: octcdf makes octave crash when an opendap url is opened due to a name conflict in netcdf and ncurses. Version-Release number of selected component (if applicable): octave-octcdf-1.1.2-2.el6.x86_64 octave-3.4.3-1.el6.x86_64 netcdf-4.1.1-3.el6.2.x86_64 How reproducible: Steps to Reproduce: 1. in a terminal, run octave --eval "ncdump('http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz');" Actual results: Segmentation fault (core dumped) Expected results: netcdf dump starting with % dimensions nc('time') = 1857; ... Additional info: The function dapparse from the netcdf library calls attrset. However instead of calling its own attrset function, the attrset function from libncurses is called (see gdb stack trace below). libncurses is used by octave but not by octcdf. As a workaround one can start octave as the following: LD_PRELOAD=/usr/lib64/libnetcdf.so.6 octave The function attrset from netcdf was renamed dap_attrset in version netcdf 4.1.2. So later version of netcdf should not have this issue. The segmentation fault could be reproduced with a minimal .oct file calling simply status = nc_open("http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz",NC_NOWRITE,&ncid); gdb stack trace (gdb) where #0 0x0000003db900a71f in attrset () from /lib64/libncurses.so.5 #1 0x00002b7752d99cf9 in dapparse () from /usr/lib64/libnetcdf.so.6 #2 0x00002b7752d8a41a in DAPparse () from /usr/lib64/libnetcdf.so.6 #3 0x00002b7752d97f9c in ocfetch () from /usr/lib64/libnetcdf.so.6 #4 0x00002b7752d884ca in oc_fetch () from /usr/lib64/libnetcdf.so.6 #5 0x00002b7752d9a585 in dap_oc_fetch () from /usr/lib64/libnetcdf.so.6 #6 0x00002b7752da5e8e in fetchtemplatemetadata3 () from /usr/lib64/libnetcdf.so.6 #7 0x00002b7752da7271 in nc3d_open () from /usr/lib64/libnetcdf.so.6 #8 0x00002b7752d5e4e3 in l4nc_open_file () from /usr/lib64/libnetcdf.so.6 #9 0x00002b7752dab6a8 in nc4d_open_file () from /usr/lib64/libnetcdf.so.6 #10 0x00002b7752d5bd2f in nc_open () from /usr/lib64/libnetcdf.so.6
Thank you for the wonderfully detailed bug report! Now, how to fix it. Unfortunately, netcdf has been pretty sloppy with handling ABI changes.
Dear Orion, I'm not sure what can be done to fix this issue (besides changing netcdf). If changing netcdf (renaming attrset or upgrading) would be possible, the attrset function is not declared in the header file of netcdf. So it is quite unlikely that any user code depend on this function (while attreset is actually declared in ncurses.h). The main purpose of my bug report was to document this issue for user running into the same issue.
netcdf-4.1.1-3.el6.3 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/netcdf-4.1.1-3.el6.3
Okay, I back-ported the function renames from 4.1.2 and submitted an update. Please test that and let me know how it works.
Package netcdf-4.1.1-3.el6.3: * should fix your issue, * was pushed to the Fedora EPEL 6 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing netcdf-4.1.1-3.el6.3' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2013-0759/netcdf-4.1.1-3.el6.3 then log in and leave karma (feedback).
Thanks a lot Orion! This update fixes the opendap issue.
netcdf-4.1.1-3.el6.3 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.