bugGNU Octave - Bugs: bug #36146, Failed assertion in interpreter...

 
 

bug #36146: Failed assertion in interpreter with anonymous functions

Submitter:  Rik <rik5>
Submitted:  Tue 10 Apr 2012 11:00:07 PM UTC
   
 
Category:  Interpreter Severity:  4 - Important
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
   

Jump to the original submission

Sun 23 Jun 2013 11:28:43 PM UTC, comment #9: 

This seems to have been fixed sometime in the last few months.  Closing report.

Rik <rik5>
Group administrator
Fri 15 Mar 2013 04:00:51 PM UTC, comment #8: 

Confirmed.  The new parser behavior has been corrected and a newline will terminate an anonymous function call.  But, the problem with an anonymous function over multiple lines is still there.

Rik <rik5>
Group administrator
Fri 15 Mar 2013 05:47:24 AM UTC, comment #7: 

But, the original assertion failure is still there.

Michael Godfrey <godfrey>
Group Member
Fri 15 Mar 2013 05:43:13 AM UTC, comment #6: 

Fixed by new patch from John.

Michael Godfrey <godfrey>
Group Member
Fri 15 Mar 2013 05:12:16 AM UTC, comment #5: 

With latest:
[pbdsl3:octave] hg id
e608de76742c tip

I get new fail in gzip when running make check
test/fntests.log snip attached.

(file #27606)

Michael Godfrey <godfrey>
Group Member
Fri 15 Mar 2013 03:58:42 AM UTC, comment #4: 

I think the following changeset fixes the problem with line endings and anonymous functions.

http://hg.savannah.gnu.org/hgweb/octave/rev/e608de76742c

The following changeset was also needed because now the body of an anonymous function is treated like any other expression and can't span multiple lines unless it is enclosed in parens or a continuation marker is used.

http://hg.savannah.gnu.org/hgweb/octave/rev/e7f6c479ce1c

John W. Eaton <jwe>
Group administrator
Thu 14 Mar 2013 03:26:10 PM UTC, comment #3: 

The new parser, which is causing an assertion failure on some platforms with functions defined on the command line, exhibits this bug in a new way.

With a recent tip (a4af67e0d22c), I now get the following


 f = @(x) x*(1)
> ;
,: interpfcn/symtab.h:2039: static void symbol_table::set_curr_fcn(octave_user_function*, int): Assertion `scope != xtop_scope && scope != xglobal_scope' failed.
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Abort


Another change, which may be a red herring, is that I had to add a semicolon on the next line to tell the parser that input was complete.  Previously the newline was enough as the function definition was complete.


Rik <rik5>
Group administrator
Wed 11 Apr 2012 05:41:56 PM UTC, comment #2: 

A small consolation indeed.

Rik <rik5>
Group administrator
Wed 11 Apr 2012 01:46:11 PM UTC, comment #1: 

This isn't a segfault. It's a failed assertion. Still a crash, but at least it's not UB. :-)

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Tue 10 Apr 2012 11:00:07 PM UTC, original submission:  

Sample code to reproduce the problem:


f = @(x) x*(1)
f =

@(x) x * (1)

octave:2> f = @(x) x*(
> 1)
/m: symtab.h:1923: static void symbol_table::set_curr_fcn(octave_user_function*, int): Assertion `scope != xtop_scope && scope != xglobal_scope' failed.
panic: Aborted -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete
Abort


The first example works.  The second which extends across a newline does not.  It is not necessary to run them in this order.  Running just the newline version causes a segfault in all versions I have available for testing from 3.2.4 to the current tip.

Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27606:  new_f added by godfrey (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by godfrey (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by rik5 (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-06-23 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2013-03-15 godfrey Attached File- Added new_f, #27606
    2013-03-14 rik5 Carbon-Copy- Added jwe
    2012-04-14 rik5 StatusNone Confirmed
    2012-04-11 jordigh SummarySegfault in interpreter with anonymous functions Failed assertion in interpreter with anonymous functions

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code