bugGNU Octave - Bugs: bug #60813, GUI crashes when quitting debug...


bug #60813: GUI crashes when quitting debug mode from "run selection"

Submitted by:  Markus Mützel <mmuetzel>
Submitted on:  Wed 23 Jun 2021 05:26:51 PM UTC  
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  John W. Eaton <jwe>
Originator Name:  Open/Closed:  Closed
Release:  6.2.90 Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Sun 04 Jul 2021 11:30:37 AM UTC, comment #4: 

Thank you. That seems to fix the original issue for me.

Closing as fixed.

Markus Mützel <mmuetzel>
Project Member
Fri 02 Jul 2021 02:08:05 PM UTC, comment #3: 

I pushed the following two changesets on stable and then merged with default:


I did this in two steps because the real fix is the second one to catch quit_debug_exception in the main evaluation loop.  But that required either exposing that exception outside of the evaluator, which I didn't want to do, or moving the main evaluation loop to the evaluator.  That had already been done on the default branch, so also decided to do that on stable in a separate change.

Marking as ready for test.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Thu 24 Jun 2021 04:27:05 PM UTC, comment #2: 

Not to say that we'd need to do the same. Just as a point of reference in Matlab:
If I type `for i=1:8` at the command prompt and hit enter, the prompt advances to the next line without showing the ">> ". If I then select `disp(i)` in the editor and hit the F9 key (for "run selection"), "disp(i)" is displayed at the command prompt. But nothing else happens.
If I then enter `end` at the command prompt and hit enter, the numbers 1 to 9 are printed and the command prompt shows the ">> " again.

For the example in comment #0, I expected the debugger to stop and to return from the debug prompt to the command prompt (without crash). That is also what happens in Matlab for a similar sequence of commands.

Markus Mützel <mmuetzel>
Project Member
Wed 23 Jun 2021 06:01:04 PM UTC, comment #1: 

The problem is that the quit_debug_exception that is thrown is not caught when executing code this way.  It does work properly when using the new terminal widget, but not with the current one.

This issue is related to the one I brought up in the meeting yesterday with user expectations when executing code selections.  currently, we try to execute the equivalent command as if it had been typed in the command window.  We do this by saving any pending input at the command prompt then simulating a command being entered at the prompt.  The idea is to have the command echoed at the prompt followed by any output it produces and then for any previously pending input to be displayed again.  Is that the behavior Matlab users expect?  It seems reasonable, but the way we handle it may need to be redesigned.

I will at least try to come up with a fix to prevent this kind of crash.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Wed 23 Jun 2021 05:26:51 PM UTC, original submission:  

When using dbquit while running a command with "run selection" (F9 in the editor), the Octave GUI crashes hard to the command line.

Steps to reproduce:
- Open some file in the editor, e.g. `edit delanayn`
- Add a stop point somewhere in that file, e.g. in line 99.
- Use "run selection" to call that function, e.g. scroll down to the first test and execute `x = [-1, 0; 0, 1; 1, 0; 0, -1; 0, 0];`. Then, mark `delaunayn (x)` and hit the F9 key.
- While Octave is waiting on the debug prompt, click on the stop icon (the read square in the editor) or execute `dbquit` from the prompt.

That reliably crashes the GUI for me to the prompt.
"gdb" doesn't catch the crash.
Same on Windows and Linux with the release candidate 6.2.90.

Markus Mützel <mmuetzel>
Project Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-07-04 mmuetzel StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2021-07-02 jwe StatusConfirmed => Ready For Test
    2021-06-23 jwe StatusNone => Confirmed
        Assigned toNone => jwe

    Back to the top

    Powered by Savane 3.7