bugGNU Octave - Bugs: bug #41756, assert wrongly returning no error

 
 

bug #41756: assert wrongly returning no error

Submitted by:  John Hunt <huntj>
Submitted on:  Sun 02 Mar 2014 08:15:39 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.0Operating 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 05 Mar 2014 05:38:59 AM UTC, comment #4:

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/9472e3c8f43e

This change seems to fix the problem for me. The diff is only large because it indents most of the function. It really just adds an unwind_protect block to handle resetting the value of call_depth.

John W. Eaton <jwe>
Project Administrator
Wed 05 Mar 2014 05:35:20 AM UTC, comment #3:

seems like a job for unwind_protect; please let me know if you think that wouldn't work for some reason. thx.

Felipe G. Nievinski <fgnievinski>
Wed 05 Mar 2014 04:22:22 AM UTC, comment #2:

This is a regression from 3.6.4. The problem appears to be in the m-file assert.m. There is a persistent variable call_depth which is used to keep track of recursion in the function. When Ctrl+C interrupts assert the variable is left in an incorrect state. Using 'clear -f assert' will re-initialize the call_depth variable and bring back the correct behavior.

Long term, either the code needs to change not to use this style or Ctrl+C needs to be trapped by assert so that it can re-initialize the call_depth variable.

The following code is somewhat simpler and reproduces the problem.

Rik <rik5>
Project Administrator
Sun 02 Mar 2014 08:24:31 PM UTC, comment #1:

This is indeed related to a Ctrl-C during a long assert.
Here is how to reproduce.

John Hunt <huntj>
Sun 02 Mar 2014 08:15:39 PM UTC, original submission:

A weird behavior, probably due to a Ctrl-C during a long test,
and perhaps related to persistent variables in assert.
Can not be reproduced in a fresh octave session.

It seems that the error messages are evaluated, although not printed, since when there are differences the elapsed time is longer.

John Hunt <huntj>

 

(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 fgnievinski (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by huntj (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
    Wed 05 Mar 2014 05:38:59 AM UTCjweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 05 Mar 2014 04:22:22 AM UTCrik5Item GroupIncorrect Result=>Regression
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1