bugGNU Octave - Bugs: bug #49600, Error in the...


bug #49600: Error in the unwind_protect_cleanup section of print.m

Submitter:  Guillaume <gyom>
Submitted:  Mon 14 Nov 2016 12:55:04 PM UTC
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 16 Nov 2016 06:35:32 PM UTC, comment #4: 

I pushed Pantxo's cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/219c70d2ba28).  I made two small changes.

Change #1 : indexing is faster than deleting

    hobj(strncmp (get (hobj, "type"), "ui", 2)) = [];


    hobj = hobj(! strncmp (get (hobj, "type"), "ui", 2));

Change #2 : No need to repeat file name in commit message when multiple things were done to it.

* print.m: initialize nfig variable at the beginning of the unwind_protect block
* print.m: remove ui* objects from the list of axes children
* print.m: consistently use "end" keyword to index prop array
* print.m: increment nfig after each "set" operation on "units" properties


* print.m: Initialize nfig variable at beginning of the unwind_protect block.
Remove ui* objects from the list of axes children.
Consistently use "end" keyword to index prop array.
Increment nfig after each "set" operation on "units" properties.

Rik <rik5>
Group administrator
Tue 15 Nov 2016 05:11:30 PM UTC, comment #3: 

Thanks Pantxo, with your patch the error disappeared.

Guillaume <gyom>
Mon 14 Nov 2016 10:24:30 PM UTC, comment #2: 


I attached a patch in which I addressed the two issues:

  • don't change the ui* objects units
  • declare nfig soon and paranoiacally increment after each set operation

(file #38965)

Pantxo Diribarne <pantxo>
Group Member
Mon 14 Nov 2016 02:12:55 PM UTC, comment #1: 

Here is a way to reproduce the error:


This points out to another bug where print.m tries to change the "units" property of the uicontrol to "data" and fails; print('-noui') being not implemented yet.

Guillaume <gyom>
Mon 14 Nov 2016 12:55:04 PM UTC, original submission:  

If, for some reasons, a call to 'print' fails, I observe the error message:

'nfig' undefined near line 510 column 15

and looking at print.m, it indeed seems that if an error occurs before the nfig variable is defined (lines 393, 396) in the unwind_protect section, the subsequent cleanup will fail.

Guillaume <gyom>


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

Attach Files:

Attached Files
file #38965:  unwind.patch added by pantxo (4KiB - text/x-diff)


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 pantxo (Updated the item)
  • -email is unavailable- added by gyom (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-16 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-11-14 pantxo Attached File- Added unwind.patch, #38965
        StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code