bugGNU Octave - Bugs: bug #46038, Crash when uicontrol's callback...


bug #46038: Crash when uicontrol's callback returns an error

Submitter:  Guillaume <gyom>
Submitted:  Wed 23 Sep 2015 01:17:05 PM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume 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

Sat 03 Oct 2015 07:33:09 PM UTC, comment #8: 

Jwe just pushed the patch for exception handling that fixes this bug:

Closing report as fixed

Pantxo Diribarne <pantxo>
Group Member
Tue 29 Sep 2015 08:22:27 PM UTC, comment #7: 

When running the original script in octave-cli I get

>> bug46038
>> error: err
error: octave_base_value::matrix_value(): wrong type argument '<unknown type>'
error: A(I,J): row index out of bounds; value 1 out of bound 0
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete

Using jwe's patch, there is no segfault, both in Unix (Ubuntu)
and in windows-7 (mxe-octave)

Avinoam Kalma <avinoam>
Group Member
Sat 26 Sep 2015 02:58:37 PM UTC, comment #6: 

I can confirm that I see no segfault when using jwe's patch. After clicking the button, the error is displayed in the command window and the interpreter returns to prompt gracefully. This is great!

Pantxo Diribarne <pantxo>
Group Member
Fri 25 Sep 2015 06:33:16 PM UTC, comment #5: 

Interestingly, I can no longer trigger this bug if I use jwe's experimental re-write of the core to use exception handling for errors.  I posted about my success on the maintainer's list and I think it very likely that he will commit his patch to core shortly.

If you want to see if it works for you I've attached the patch to this report.  You will need a working development build tree.  Then,

# In source tree
patch -p1 < exception-error-diffs-v3.txt

The exact sequence I used to produce the error before the patch was

run-octave -f
F = figure;
h = uicontrol(F,...

# Click on OK button
# Click on Canvas object (center of window)

(file #34979)

Rik <rik5>
Group administrator
Fri 25 Sep 2015 05:56:05 AM UTC, comment #4: 

In Octave 4.0 the bug is present also so it is definitely not related to bug #45540. The crash has to be triggered by a click inside the canvas (or moving the window) after a click on the offending button.

Pantxo Diribarne <pantxo>
Group Member
Thu 24 Sep 2015 05:52:27 PM UTC, comment #3: 

I observed the segfault on three different computers - not sure it's related to bug #45540 as I don't observe the problems reported there.

This makes the chasing of small bugs in uixxx functions (the ones that trigger an error but not a segfault) harder has they are then 'automatically' followed by a segfault.

I hadn't even noticed that uicontrol() was undocumented - I'll try to see if I can help there.

Guillaume <gyom>
Thu 24 Sep 2015 09:00:11 AM UTC, comment #2: 

Wait, I can confirm the segfault if I hover the figure canvas with the mouse cursor after pushing the button?  This could be related to bug #45540.

Pantxo Diribarne <pantxo>
Group Member
Thu 24 Sep 2015 08:52:32 AM UTC, comment #1: 


I can't confirm the bug neither in Octave 4.0 nor in dev. Clicking the button triggers an error. The only small issue is that I have to press a key (e.g. return) for the prompt to be displayed.

BTW, (sorry to spam this report), I notice that you have frequently reported bugs against uicontrol. My conclusion is that you may be one of the users who best know how this function works (and is supposed to). As you probably noticed, it is currently undocumented as all the uixxx functions. Would you by any chance have time to write the documentation for uicontrol (at least for what works as expected)?

Pantxo Diribarne <pantxo>
Group Member
Wed 23 Sep 2015 01:17:05 PM UTC, original submission:  

Run the following:

F = figure;
h = uicontrol(F,...

and press the OK button - the error message is displayed and Octave crashes when the mouse is moved away from the button.

Guillaume <gyom>


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

Attach Files:

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -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
    2015-10-03 pantxo StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-09-25 rik5 Attached File- Added exception-error-diffs-v3.txt, #34979
    2015-09-24 pantxo StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code