bugGNU Octave - Bugs: bug #33981, function in %!demo block leads to...

 
 

bug #33981: function in %!demo block leads to crash

Submitted by:  John W. Eaton <jwe>
Submitted on:  Wed 10 Aug 2011 03:52:39 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: jweOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Thu 02 Aug 2012 12:40:25 AM UTC, comment #6:

Functions in demo blocks are allowed now that support for nested functions has been added to Octave. The code which tested and prevented declaring functions in demo blocks has been removed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/dda73cb60ac5).

Rik <rik5>
Project Administrator
Wed 01 Aug 2012 04:48:51 PM UTC, comment #5:

That change seems OK to me.

Thanks.

John W. Eaton <jwe>
Project Administrator
Wed 01 Aug 2012 04:45:31 PM UTC, comment #4:

John, the issue in this bug report has gone away thanks to support for nested functions. I am thinking of removing the code which tests for the presence of a function within a demo block and reports an error if a function is found. Is there any objection?

I think I will leave the code which checks for functions in %!test blocks so that there is still a preference to use the %!function/%!endfunction syntax. I think forcing the programmer to be explicit about creating a shared test function is not a bad idea.

Rik <rik5>
Project Administrator
Mon 19 Dec 2011 02:25:07 AM UTC, comment #3:

I have committed a changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/80bda7c4f012) which prevents embedded functions within %!test and %!demo blocks. This will stop the segmentation faults and the warning message points directs coders to the syntax which does work (%!function/%!endfunction). The root cause fix is still to address how subfunctions are handled in Octave.

Rik <rik5>
Project Administrator
Thu 11 Aug 2011 12:40:11 PM UTC, comment #2:

Thanks. I thought I had seen something like this report earlier, but I didn't search for it. I've linked these two bug reports.

John W. Eaton <jwe>
Project Administrator
Thu 11 Aug 2011 05:21:14 AM UTC, comment #1:

The same happens id 'test' is used instead of 'demo':

I think this bug is related to the one reported in

http://savannah.gnu.org/bugs/?32843

here is the backtrace of the crash in this case:

Carlo de Falco <cdf>
Project Member
Wed 10 Aug 2011 03:52:39 PM UTC, original submission:

Given a demo block in a .m file that contains a function definition, executing demo for that .m file three times will crash Octave. The demo block can be as simple as

Here is a stack trace of the crash:

John W. Eaton <jwe>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by cdf (Posted a comment)
  • -unavailable- added by jwe (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Aug 2012 12:40:25 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 19 Dec 2011 02:25:07 AM UTCrik5Summaryfunction in demo block leads to crash=>function in %!demo block leads to crash
    Thu 11 Aug 2011 12:38:41 PM UTCjweDependencies-=>Depends on bugs #32843

    Back to the top


    Powered by Savane 3.1-cleanup1