bugGNU Octave - Bugs: bug #60174, debug_on_interrupt broken since...


bug #60174: debug_on_interrupt broken since version 4.4

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Fri 05 Mar 2021 12:38:24 PM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Mon 22 Nov 2021 08:02:04 PM UTC, comment #10: 

I have my doubts that this feature ever worked 100% correctly.  It probably stopped functioning at all when we switched to using exceptions to handle interrupts and errors instead of setjmp/longjmp.

RE comment #8: how does it work for you?  It doesn't work for me.

Something like the attached change might be a starting point, but my limited testing shows that there are definitely problems with this change so I think it will have to wait until after version 7.

Setting release to "dev".

(file #52325)

John W. Eaton <jwe>
Group administrator
Sun 21 Nov 2021 09:20:51 PM UTC, comment #9: 

@anonumous: How did you test the functionality? When testing the same way as in comment #0, using the toto.m function, I obtain the same result: after CTRL+C Octave returns to the prompt rather than the debugger.

Pantxo Diribarne <pantxo>
Group Member
Sat 20 Nov 2021 11:05:58 PM UTC, comment #8: 

This works properly on Octave 7 on Linux now. If it has been fixed, can this bug report be closed?

Sat 06 Mar 2021 08:12:30 PM UTC, comment #7: 

Broken on Windows is probably an artifact of the fact that Ctrl+C handling has always been difficult on Windows.

Rik <rik5>
Group administrator
Sat 06 Mar 2021 12:56:46 PM UTC, comment #6: 

It doesn't work for me with Octave 4.2.2 on Windows 10. Maybe it was broken on that platform for a different reason.

Markus Mützel <mmuetzel>
Group administrator
Fri 05 Mar 2021 06:59:40 PM UTC, comment #5: 

I bracketed the regression.  It works with octave-4.2.2 and fails with octave-4.4.1.

Rik <rik5>
Group administrator
Fri 05 Mar 2021 05:23:05 PM UTC, comment #4: 

I went back to version 3.8.2 and it worked there.

Rik <rik5>
Group administrator
Fri 05 Mar 2021 04:09:56 PM UTC, comment #3: 

I'm pretty sure this is a regression.  I think I remember having used this in my own code a long time ago.  But, maybe it was back in the 3.X series.

Rik <rik5>
Group administrator
Fri 05 Mar 2021 04:09:22 PM UTC, comment #2: 

The idea is to enter the debugger at the next available point after the interrupt is noticed by the interpreter.  But I don't think it has worked properly for a long time, probably since we started throwing exceptions to interrupt the interpreter.

John W. Eaton <jwe>
Group administrator
Fri 05 Mar 2021 03:32:34 PM UTC, comment #1: 

Same on Windows 10 with Octave 6.2.0, 5.2.0, 4.4.1, and 4.2.2.
No difference between GUI or CLI.

Either it doesn't work on that platform, or it doesn't work since a long time, or I don't understand what it should do.

Markus Mützel <mmuetzel>
Group administrator
Fri 05 Mar 2021 12:38:24 PM UTC, original submission:  

I recently discovered the existence of debug_on_interrupt which I wanted to use as a way to interrupt temporarily a calculation and inspect variables before proceeding.

Unfortunately I was not able to have it work: whether debug_on_interrupt is true or false, Ctrl+C interrupts the script and returns to the prompt. For example I saved the following function in a file toto.m (which attached to this report), and then ran it but Ctrl+C interrupts it rather than leading to debug prompt.

function retval = toto (input1, input2)
  debug_on_interrupt (true, "local");
  while (true)
    a = 2;

Pantxo Diribarne <pantxo>
Group Member


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

Attach Files:

Attached Files
file #50992:  toto.m added by pantxo (127B - text/x-objcsrc)


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 jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-22 jwe Attached File- Added debug-on-interrupt-patch.txt, #52325
        Release6.2.0 dev
    2021-03-06 rik5 Summarydebug_on_interrupt does not change the effect of Ctrl+C debug_on_interrupt broken since version 4.4
    2021-03-05 rik5 StatusNone Confirmed
    2021-03-05 rik5 Item GroupIncorrect Result Regression
    2021-03-05 mmuetzel Operating SystemGNU/Linux Any
    2021-03-05 pantxo Attached File- Added toto.m, #50992

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code