Bug 924467 - octcdf makes octave crash when an opendap url is opened (with work around)
Summary: octcdf makes octave crash when an opendap url is opened (with work around)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: netcdf
Version: el6
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Deji Akingunola
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-21 20:29 UTC by Alexander
Modified: 2013-04-07 01:27 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-04-07 01:27:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alexander 2013-03-21 20:29:36 UTC
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

Comment 1 Orion Poplawski 2013-03-21 21:10:14 UTC
Thank you for the wonderfully detailed bug report!  Now, how to fix it.  Unfortunately, netcdf has been pretty sloppy with handling ABI changes.

Comment 2 Alexander 2013-03-22 10:28:41 UTC
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.

Comment 3 Fedora Update System 2013-03-22 19:19:01 UTC
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

Comment 4 Orion Poplawski 2013-03-22 19:21:10 UTC
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.

Comment 5 Fedora Update System 2013-03-23 18:16:11 UTC
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).

Comment 6 Alexander 2013-04-03 08:49:58 UTC
Thanks a lot Orion! This update fixes the opendap issue.

Comment 7 Fedora Update System 2013-04-07 01:27:31 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.