bugGNU Octave - Bugs: bug #31815, speed demos no longer work since...

 
 

bug #31815: speed demos no longer work since version 3.2.3

Submitted by:  Rik <rik5>
Submitted on:  Tue 07 Dec 2010 01:10:18 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 1 - LaterItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/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.

 

Sat 08 Oct 2011 05:05:40 PM UTC, comment #3:

The original reported issue, speed demos not working, has been fixed in this changeset (13283:5d3d802c772e).

Rik <rik5>
Project Administrator
Fri 10 Dec 2010 11:15:06 PM UTC, comment #2:

I'm intrigued, but not surprised, that you had a few crashes during the testing. There is a memory leak somewhere in the parser dealing with functions which I found by running fntests.m under valgrind. The small function you attached to this bug report also provokes a memory leak when run under valgrind. I will report those experiences at bug report #31644 which deals with memory leaks.

Perhaps an easier path than re-writing demo.m would be to re-write speed.m? We generally use demo code where it is not possible to use test code, such as the plots. Here, we could promote one of the demo blocks into the texinfo section just as an example, delete the other, and write a %!test block to ensure that speed.m works.

This supposes that there are not too many other instances of demos with subfunctions. If there are then I suppose the correct approach is to deal with demo.m and subfunctions.

Rik <rik5>
Project Administrator
Thu 09 Dec 2010 06:52:26 PM UTC, comment #1:

The demo function creates a string that wraps all of the demo code in a function called _demo_, evals that string to create a function, then calls _demo_. In the olden times, the nested functions weren't treated as nested or subfunctions, so they were installed globally. And the type function was a built-in function that could reconstruct and display functions that were not defined in files (by reconstructing the program text from the parse tree information). Now we have subfunctions and the type function is a .m file that can't seem to handle anything but files.

Note this simpler examples of failure (save the fucntion to a file and execute the primary function):

For this, I see exist returning 2 (function from a file) but type can't print it because it doesn't know anything about how to find the subfunction.

I'm not sure what the right behavior is.

What does Matlab do for this function? Is there a way to find out if a subfunction exists? I guess the question doesn't make much sense if you think of subfunctions as private and that they are statically defined (so there is really no need to ask). What about the type function? Does Matlab have any way to display the text of a subfunction that is in scope?

What should Octave do, given that it is already different from Matlab in that it allows functions to be constructed at the command line and by evaluating a character string?

Should we just rewrite demo instead of trying to fix Octave so that the current demo code work?

Even if we just avoid the problem by rewriting the demo function, we may still have some issues to deal with. I noticed some crashes when I was trying to debug what was happening. For example, removing the "type build_orig" and "type build" lines from the first speed demo, then running "demo speed" caused a crash for me.

John W. Eaton <jwe>
Project Administrator
Tue 07 Dec 2010 01:10:18 AM UTC, original submission:

The speed.m demos define functions so they can not be called using the ordinary syntax for demos. Instead, one evals the example code itself using:
This code used to work in version 3.0.5, but is broken in version 3.2.3 and beyond.

The error is message is
'build_orig' is the first function defined in the example code.

Rik <rik5>
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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Oct 2011 05:05:40 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 28 Sep 2011 07:15:31 PM UTCrik5Priority5 - Normal=>1 - Later

    Back to the top


    Powered by Savane 3.1-cleanup1