segfault reading netcdf file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

segfault reading netcdf file

Muhali
With the current octave tip and the most recent octcdf package the following program generates a segfault. My system is Ubuntu 12.04 x86_64. debug output is attached.

--------
pkg load octcdf
ncfile = "http://ensemblesrt3.dmi.dk/cgi-bin/nph-dods/data/ERA40/METNO/25km/DM/METNOHIRHAM_CTR_ERA40_DM_25km_1971-1980_huss.nc.gz"
nc = netcdf(ncfile, "r") ;
x = nc{"huss"}(:) ;
--------


Program received signal SIGSEGV, Segmentation fault.
buildcachenode34 (nccomm=0xd72820, constraint=0x75d130, varlist=0xe91b50, cachep=0x7fffffffc8b8, isprefetch=0) at cache.c:231
231    cache->cachesize -= node->xdrsize;
(gdb) where
#0  buildcachenode34 (nccomm=0xd72820, constraint=0x75d130, varlist=0xe91b50, cachep=0x7fffffffc8b8, isprefetch=0) at cache.c:231
#1  0x00007fffea516304 in nc3d_getvarx (ncid=<optimized out>, varid=4, startp=<optimized out>, countp=<optimized out>, stridep=<optimized out>, data=0x7fffc8d4a010, dsttype0=5)
    at getvara3.c:192
#2  0x00007fffea4e7596 in NC_get_vars (ncid=65536, varid=8, start=0xe91f30, edges=0xe91f60, stride=0xe91f90, value=<optimized out>, memtype=5) at var.c:762
#3  0x00007fffea4ed00c in nc_get_vars_float (ncid=65536, varid=8, start=0xe91f30, edges=0xe91f60, stride=0xe91f90, value=0x7fffc8d4a010) at var.c:2446
#4  0x00007fffea803458 in ov_nc_get_vars (ncid=65536, varid=8, ranges=..., nctype=5) at ov-netcdf.cc:774
#5  0x00007fffea80ae1a in octave_ncvar::subsref (this=0x75d050, type=..., idx=...) at ov-ncvar.cc:366
#6  0x00007ffff745dd5b in subsref (idx=..., type=..., this=<optimized out>) at ./octave-value/ov.h:397
#7  octave_value::next_subsref (this=0x7fffffffd3f0, type=..., idx=..., skip=1) at octave-value/ov.cc:1290
#8  0x00007fffea80620b in octave_ncfile::subsref (this=0xd56020, type=..., idx=...) at ov-ncfile.cc:374
#9  0x00007ffff7457a2e in octave_value::subsref (this=<optimized out>, type=..., idx=..., nargout=<optimized out>) at octave-value/ov.cc:1264
#10 0x00007ffff7457a85 in octave_value::subsref (this=<optimized out>, type=..., idx=..., nargout=<optimized out>, lvalue_list=<optimized out>) at octave-value/ov.cc:1277
#11 0x00007ffff74c219d in tree_index_expression::rvalue (this=0xc90520, nargout=1, lvalue_list=0x0) at parse-tree/pt-idx.cc:414
#12 0x00007ffff74c292b in tree_index_expression::rvalue (this=<optimized out>, nargout=<optimized out>) at parse-tree/pt-idx.cc:284
#13 0x00007ffff74bee14 in tree_index_expression::rvalue1 (this=0xc90520, nargout=1) at parse-tree/pt-idx.cc:425
#14 0x00007ffff74aa502 in tree_simple_assignment::rvalue1 (this=0x770c20) at parse-tree/pt-assign.cc:211
#15 0x00007ffff74b7ad3 in tree_evaluator::visit_statement (this=<optimized out>, stmt=...) at parse-tree/pt-eval.cc:747
#16 0x00007ffff74b73f1 in visit_statement_list (lst=..., this=0x7ffff7dd3958) at parse-tree/pt-eval.cc:797
#17 tree_evaluator::visit_statement_list (this=0x7ffff7dd3958, lst=...) at parse-tree/pt-eval.cc:778
#18 0x00007ffff744e4cd in octave_user_script::do_multi_index_op (this=0xca9b60, nargout=<optimized out>, args=...) at octave-value/ov-usr-fcn.cc:141
#19 0x00007ffff74f8486 in source_file (file_name=..., context=..., verbose=false, require_file=true, warn_for=...) at oct-parse.yy:4019
#20 0x00007ffff74f88b0 in Fsource (args=...) at oct-parse.yy:4126
#21 0x00007ffff73b3529 in octave_builtin::do_multi_index_op (this=0x67e2a0, nargout=0, args=..., lvalue_list=0x0) at octave-value/ov-builtin.cc:131
#22 0x00007ffff73b2305 in octave_builtin::subsref (this=0x67e2a0, type=..., idx=..., nargout=0, lvalue_list=0x0) at octave-value/ov-builtin.cc:64
#23 0x00007ffff73b2ffc in octave_builtin::subsref (this=<optimized out>, type=..., idx=..., nargout=<optimized out>) at octave-value/ov-builtin.cc:47
#24 0x00007ffff7457a18 in octave_value::subsref (this=<optimized out>, type=..., idx=..., nargout=<optimized out>) at octave-value/ov.cc:1266
#25 0x00007ffff7457a85 in octave_value::subsref (this=<optimized out>, type=..., idx=..., nargout=<optimized out>, lvalue_list=<optimized out>) at octave-value/ov.cc:1277
#26 0x00007ffff74c219d in tree_index_expression::rvalue (this=0x75f2a0, nargout=0, lvalue_list=0x0) at parse-tree/pt-idx.cc:414
#27 0x00007ffff74c292b in tree_index_expression::rvalue (this=<optimized out>, nargout=<optimized out>) at parse-tree/pt-idx.cc:284
#28 0x00007ffff74bee14 in tree_index_expression::rvalue1 (this=0x75f2a0, nargout=0) at parse-tree/pt-idx.cc:425
#29 0x00007ffff74b7ad3 in tree_evaluator::visit_statement (this=<optimized out>, stmt=...) at parse-tree/pt-eval.cc:747
#30 0x00007ffff74b73f1 in visit_statement_list (lst=..., this=0x7ffff7dd3958) at parse-tree/pt-eval.cc:797
#31 tree_evaluator::visit_statement_list (this=0x7ffff7dd3958, lst=...) at parse-tree/pt-eval.cc:778
#32 0x00007ffff77bb1f7 in main_loop () at interpfcn/toplev.cc:595
#33 0x00007ffff70c2305 in octave_execute_interpreter () at octave.cc:1021
#34 0x00007ffff677f76d in __libc_start_main (main=0x4007b0 <main(int, char**)>, argc=1, ubp_av=0x7fffffffe9c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fffffffe9b8) at libc-start.c:226
#35 0x0000000000400831 in _start ()
Reply | Threaded
Open this post in threaded view
|

[SOLVED] Re: segfault reading netcdf file

Muhali
This post was updated on .
Muhali wrote
With the current octave tip and the most recent octcdf package the following program generates a segfault. My system is Ubuntu 12.04 x86_64. debug output is attached.
Solved. No segfault with the newest libnetcdf (4.2.1.1).