bugGNU Octave - Bugs: bug #32408, segfault when sourcing function...

 
 

bug #32408: segfault when sourcing function files that contain subfunctions

Submitter:  John W. Eaton <jwe>
Submitted:  Thu 10 Feb 2011 08:29:50 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 26 Jul 2012 03:18:37 PM UTC, comment #2: 

OK, I'm closing this report since the segfault can't happen now.

John W. Eaton <jwe>
Group administrator
Mon 23 Jul 2012 07:02:18 PM UTC, comment #1: 

John, is this a problem anymore? 

The exact sequence of operations necessary to reproduce the bug no longer seems to work because nested functions have been added and a parse error is encountered so that the 'source' command never completes.  This effectively prevents the segfault from occurring later on.

Rik <rik5>
Group administrator
Thu 10 Feb 2011 08:29:50 AM UTC, original submission:  

Given the following function with subfunctions in foo.m:


function foo ()
  sub1 ();

function sub1 ()
  disp ('foo>sub1');
  sub2 ();

function sub2 ()
  disp ('foo>sub2');


executing


source ("foo.m")
source ("foo.m")


will cause Octave to segfault on the second call to source.

GDB backtrace:


#0  0x0000000000000000 in ?? ()
#1  0x00007ffff705ba0f in ~octave_value (this=0x7fffffffc170,
    __in_chrg=<value optimized out>) at /home/jwe/src/octave/src/ov.h:310
#2  0x00007ffff730b915 in finish_function (ret_list=0x0, fcn=0x6ab1e8, lc=0x0)
    at oct-parse.yy:2957
#3  0x00007ffff7306dfc in octave_parse () at oct-parse.yy:1365
#4  0x00007ffff730cff1 in parse_fcn_file (ff=..., dispatch_type=...,
    force_script=true, require_file=true, warn_for=...) at oct-parse.yy:3586
#5  0x00007ffff730f291 in source_file (file_name=..., context=...,
    verbose=false, require_file=true, warn_for=...) at oct-parse.yy:3992
#6  0x00007ffff730fb8d in Fsource (args=...) at oct-parse.yy:4114
#7  0x00007ffff742935d in octave_builtin::do_multi_index_op (this=0x766530,
    nargout=0, args=..., lvalue_list=0x0)
    at /home/jwe/src/octave/src/ov-builtin.cc:128
#8  0x00007ffff7429031 in octave_builtin::subsref (this=0x766530, type=...,
    idx=..., nargout=0, lvalue_list=0x0)
    at /home/jwe/src/octave/src/ov-builtin.cc:63
#9  0x00007ffff7428f1d in octave_builtin::subsref (this=0x766530, type=...,
    idx=..., nargout=0) at /home/jwe/src/octave/src/ov-builtin.cc:46
#10 0x00007ffff74cddea in octave_value::subsref (this=0x7fffffffd270,
    type=..., idx=..., nargout=0) at /home/jwe/src/octave/src/ov.cc:1201
#11 0x00007ffff74cde78 in octave_value::subsref (this=0x7fffffffd270,
    type=..., idx=..., nargout=0, lvalue_list=0x0)
    at /home/jwe/src/octave/src/ov.cc:1212
#12 0x00007ffff7560c26 in tree_index_expression::rvalue (this=0x9f0170,
    nargout=0, lvalue_list=0x0) at /home/jwe/src/octave/src/pt-idx.cc:407
#13 0x00007ffff75601dc in tree_index_expression::rvalue (this=0x9f0170,
    nargout=0) at /home/jwe/src/octave/src/pt-idx.cc:277
#14 0x00007ffff7560dc6 in tree_index_expression::rvalue1 (this=0x9f0170,
    nargout=0) at /home/jwe/src/octave/src/pt-idx.cc:418
#15 0x00007ffff755a411 in tree_evaluator::visit_statement (
    this=0x7ffff7ddd9f8, stmt=...) at /home/jwe/src/octave/src/pt-eval.cc:737
#16 0x00007ffff75789b0 in tree_statement::accept (this=0xc8ef80, tw=...)
    at /home/jwe/src/octave/src/pt-stmt.cc:151
#17 0x00007ffff755a5fe in tree_evaluator::visit_statement_list (
    this=0x7ffff7ddd9f8, lst=...) at /home/jwe/src/octave/src/pt-eval.cc:773
#18 0x00007ffff7578d62 in tree_statement_list::accept (this=0xc90070, tw=...)
    at /home/jwe/src/octave/src/pt-stmt.cc:215
#19 0x00007ffff73c87f4 in main_loop ()
    at /home/jwe/src/octave/src/toplev.cc:573
#20 0x00007ffff7380eb8 in octave_main (argc=6, argv=0x7fffffffd9e8, embedded=0)
    at /home/jwe/src/octave/src/octave.cc:935
#21 0x00000000004008a9 in main (argc=6, argv=0x7fffffffd9e8)
    at /home/jwe/src/octave/src/main.c:35


John W. Eaton <jwe>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-26 jwe StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2012-07-23 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code