bugGNU Octave - Bugs: bug #29960, seg-fault caused by feval(f,aa{:})

 
 

bug #29960: seg-fault caused by feval(f,aa{:})

Submitted by:  Alois Schlögl <schloegl>
Submitted on:  Tue 25 May 2010 08:09:01 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: Jaroslav Hajek <highegg>
Originator Name: Alois SchlöglOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 26 May 2010 10:06:14 AM UTC, comment #3:

fixed by
http://hg.savannah.gnu.org/hgweb/octave/rev/8baff2aceabc

thanks for reporting

Jaroslav Hajek <highegg>In charge of this item.
Tue 25 May 2010 10:11:14 PM UTC, comment #2:

Backtrace from current tip

Program received signal SIGSEGV, Segmentation fault.
0x00000035a72a59d3 in std::string::length() const () from /usr/lib/libstdc++.so.6
(gdb) bt
#0 0x00000035a72a59d3 in std::string::length() const () from /usr/lib/libstdc++.so.6
#1 0x00007ffff75fa806 in string_vector::max_length (this=0x7fffffffc470) at ../liboctave/str-vec.h:80
#2 0x00007ffff6742db1 in charMatrix (this=0x7fffffffc070, s=...) at chMatrix.cc:79
#3 0x00007ffff7707c90 in charNDArray (this=0x7fffffffc0f0, s=...) at ../liboctave/chNDArray.h:57
#4 0x00007ffff7725326 in octave_char_matrix (this=0xca4800, s=...) at ov-ch-mat.h:78
#5 0x00007ffff772566d in octave_char_matrix_str (this=0xca4800, s=...) at ov-str-mat.h:79
#6 0x00007ffff772582d in octave_char_matrix_sq_str (this=0xca4800, s=...) at ov-str-mat.h:204
#7 0x00007ffff76fc18e in octave_value (this=0x7fffffffc280, s=..., type=39 '\'') at ov.cc:809
#8 0x00007ffff76f5f02 in octave_user_function::bind_automatic_vars (this=0x6aa2b0, arg_names=..., nargin=3, nargout=0, va_args=...)
at ov-usr-fcn.cc:528
#9 0x00007ffff76f555a in octave_user_function::do_multi_index_op (this=0x6aa2b0, nargout=0, args=...) at ov-usr-fcn.cc:395
#10 0x00007ffff76ffe4a in octave_value::do_multi_index_op (this=0x7fffffffc610, nargout=0, idx=...) at ov.cc:1244
#11 0x00007ffff755d666 in feval (name=..., args=..., nargout=0) at oct-parse.yy:4104
#12 0x00007ffff755da82 in feval (args=..., nargout=0) at oct-parse.yy:4169
#13 0x00007ffff755dcce in Ffeval (args=..., nargout=0) at oct-parse.yy:4212
#14 0x00007ffff76703af in octave_builtin::do_multi_index_op (this=0x74e238, nargout=0, args=...) at ov-builtin.cc:107
#15 0x00007ffff767010d in octave_builtin::subsref (this=0x74e238, type=..., idx=..., nargout=0) at ov-builtin.cc:55
#16 0x00007ffff76ff9fe in octave_value::subsref (this=0x7fffffffcda0, type=..., idx=..., nargout=0) at ov.cc:1190
#17 0x00007ffff778836d in tree_index_expression::rvalue (this=0xcbe180, nargout=0) at pt-idx.cc:401
#18 0x00007ffff778850a in tree_index_expression::rvalue1 (this=0xcbe180, nargout=0) at pt-idx.cc:412
#19 0x00007ffff7781b13 in tree_evaluator::visit_statement (this=0x7ffff7ff9118, stmt=...) at pt-eval.cc:722
#20 0x00007ffff779ddf2 in tree_statement::accept (this=0xcca2e0, tw=...) at pt-stmt.cc:152
#21 0x00007ffff7781cfe in tree_evaluator::visit_statement_list (this=0x7ffff7ff9118, lst=...) at pt-eval.cc:758
#22 0x00007ffff779e1a0 in tree_statement_list::accept (this=0xcca300, tw=...) at pt-stmt.cc:216
#23 0x00007ffff7612433 in main_loop () at toplev.cc:575
#24 0x00007ffff75ce24a in octave_main (argc=6, argv=0x7fffffffd2f8, embedded=0) at octave.cc:882
#25 0x00000000004008f9 in main (argc=6, argv=0x7fffffffd2f8) at main.c:35

Rik <rik5>
Project Administrator
Tue 25 May 2010 09:36:37 PM UTC, comment #1:

Confirmed with hg tip (10657:c6833d31f34e) running on GNU/Linux system.

Rik <rik5>
Project Administrator
Tue 25 May 2010 08:09:01 PM UTC, original submission:

Some testing functions in on octave-forge/main/optim are failing with a segmentation fault. I tried to identify the the problem and could reduce the problem to the following test case.

clear
clear functions

function v = ff(x,y,t)
v = x'*y;
endfunction

aa{1}=[1;2];
aa{2}=[2;3];
aa{3}=1;
f = 'ff';

feval (f, aa{1}, aa{2}, aa{3}) # is fine

feval (f, aa{:}) # segmentation fault,

The last command "feval(f,aa{:})" causes a segmentation fault, while the previous one works fine.

Alois

Alois Schlögl <schloegl>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by highegg (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by schloegl (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 26 May 2010 10:06:14 AM UTChigheggCategoryNone=>Interpreter
      StatusConfirmed=>Fixed
      Assigned toNone=>highegg
      Open/ClosedOpen=>Closed
    Tue 25 May 2010 09:36:37 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1