bugGNU Octave - Bugs: bug #47927, Ctrl+C crashes Octave on MacOS


bug #47927: Ctrl+C crashes Octave on MacOS

Submitter:  Ben Abbott <bpabbott>
Submitted:  Mon 16 May 2016 12:11:44 AM UTC
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Fri 09 Mar 2018 03:02:56 PM UTC, comment #16: 

On MacOS, ctrl-C behaves as expected from a non-active command line and when stuck in an infinite loop. I think this can be closed.

Ben Abbott <bpabbott>
Group Member
Thu 08 Mar 2018 09:44:59 PM UTC, comment #15: 

OK, but this bug report and my question is about the behavior on MacOS.

John W. Eaton <jwe>
Group administrator
Thu 08 Mar 2018 09:33:22 PM UTC, comment #14: 

As far I know, it was fixed in version 4.2.1.
No more problems here (using Slackware 14.2).

Fellype do Nascimento <fellype>
Thu 08 Mar 2018 08:49:33 PM UTC, comment #13: 

Is this still an issue for the current dev sources?  Can this report be closed?

John W. Eaton <jwe>
Group administrator
Tue 02 May 2017 07:27:42 PM UTC, comment #12: 

I can confirm that the Ctrl+C still crashes Octave GUI in MacOS with 4.0.3. The about window states: Octave was configured for "x86_64-apple-darwin14.5.0".

It doesn't crash the octave-cli, and works as expected (prints ^C, creates new line.).

I tested re-assigning the Ctrl-C in Preferences>>Shortcuts to something harmless, but that did not solve the problem.

However just tested 4.2.1 installed through brew, for which Ctrl-C does not crash the GUI. I just wanted to write it here so that others can try to upgrade if they are having issues with earlier versions.

Batuhan Osmanoglu <bosmanoglu>
Fri 20 Jan 2017 07:30:10 PM UTC, comment #11: 

Fellype - your observation looks like bug #49609. Take a look at that report and help debug if you can.

Mike Miller <mtmiller>
Group Member
Fri 20 Jan 2017 07:07:00 PM UTC, comment #10: 

I have a more critical problem here...
I'm running octave-4.2.0 on Slackware 14.2, with KDE 4.14.
When I type ctrl+c in the octave gui, it acts like a ctrl+alt+backspace and try to restart the X.  An error message is displayed and the octave-gui window still open until you click on the OK button of the error message.
Bizarre :-O

Fellype do Nascimento <fellype>
Wed 31 Aug 2016 12:05:14 AM UTC, comment #9: 

I recently upgraded from Mac OS 10.10 to 10.11. Since the upgrade the gui build with Fink doesn't work for me. That is likely due to some changes to clang, which I can likely figure out, but haven't attempted yet.

In any event, a 4.0.3 build using homebrew does run for me.

Ben Abbott <bpabbott>
Group Member
Tue 30 Aug 2016 08:47:50 PM UTC, comment #8: 

I spoke too soon, all seams to be taken care of at the end of QTerminal.cc.
Sorry for the noise.

Pantxo Diribarne <pantxo>
Group Member
Tue 30 Aug 2016 08:26:07 PM UTC, comment #7: 

@Ben: about comment #6, are you running pure cli or "--no-gui"?

I wanted to comment on the suspicious code below (from TerminalView.cc):

void TerminalView::copyClipboard(bool extra_interrupt)
  if ( !_screenWindow || !hasFocus())

  QString text = _screenWindow->selectedText(_preserveLineBreaks);

  if (text.isEmpty ())
      if (! extra_interrupt)
        emit interrupt_signal ();

In Octave Ctrl+C is ubiquitous:

  • it is the default shortcut for "copy to clipboard" on all platforms but Mac. On Mac I'd expect CTRL+C not to be caught by Octave (as copyClipboard is CMD+C).

@Ben: does CMD+C have any effect in the terminal? in the terminal preferences tab, is the option "Disable global shortcuts ..." checked? Can you try to change the shortcut for copyClipboard to CTRL+C, and eventually play with the above option?

  • in the command window it means "interrupt unless text selected". 

Instead of watching copyClipboard events, we should watch actual CTRL+C keyboard events and decide what to do if CTRL+C is actually the shortcut for copyClipboard.

Pantxo Diribarne <pantxo>
Group Member
Tue 09 Aug 2016 12:26:23 AM UTC, comment #6: 

ugh ... the gui no longer comes up for me. Even so, ctrl-c doesn't terminate Octave.

If I run the cli, and hit ctrl-c several times, I'm able to trigger an ASAN error and if I continue I get "panic: Abort trap: 6 -- stopping myself..."

Ben Abbott <bpabbott>
Group Member
Mon 08 Aug 2016 08:40:29 PM UTC, comment #5: 

@Ben: Can you check whether Ctrl+C still crashes the MacOS GUI?

Rik <rik5>
Group administrator
Wed 25 May 2016 12:42:44 PM UTC, comment #4: 

Possibly related to similar Ctrl-C crashing on Windows, able to reproduce consistently when calling the pager (less)

Nicholas Jankowski <nrjank>
Group Member
Mon 16 May 2016 04:12:12 PM UTC, comment #3: 

I checked 4.0.2. It also crashes for me.

Ben Abbott <bpabbott>
Group Member
Mon 16 May 2016 09:59:03 AM UTC, comment #2: 

I can't reproduce this on Linux, so I've added "on MacOS" to the summary.

The log says that it is accessing a NULL pointer within the readline library itself, in rl_read_key.

Thread 5 seems to be at the same point as Thread 0, the one that crashed, until the innermost stack frame.  Thread 5 is performing a __select, whereas Thread 0 is in rl_read_key.

It seem odd.  Would you be able to do a code bisection to find where it started?

Lachlan Andrew <lachlan>
Mon 16 May 2016 12:15:12 AM UTC, comment #1: 

When the gui crashes, I'm able to save a log. It is also attached.

(file #37170)

Ben Abbott <bpabbott>
Group Member
Mon 16 May 2016 12:11:44 AM UTC, original submission:  

Running the gui, Ctrl+C crashes Octave.

Running with --no-gui Ctrl+C followed by a CR crashes Octave.

When it crashes a octave-workspace file is produced. I've attached it.

Ben Abbott <bpabbott>
Group Member


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

Attach Files:

Attached Files
file #37170:  crash.log added by bpabbott (61KiB - application/octet-stream)
file #37169:  octave-workspace added by bpabbott (209B - application/octet-stream)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by bosmanoglu (Posted a comment)
  • -email is unavailable- added by fellype (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by bpabbott (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-03 mtmiller Carbon-CopyRemoved 80942 -
    2018-03-09 jwe StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2018-03-08 jwe StatusNone Need Info
    2017-01-24 pantxo Dependencies- bugs #50140 is dependent
    2017-01-22 rik5 Carbon-CopyRemoved 72865 -
    2016-07-01 rik5 Severity3 - Normal 4 - Important
    2016-05-16 lachlan SummaryCtrl+C crashes Octave Ctrl+C crashes Octave on MacOS
    2016-05-16 bpabbott Attached File- Added crash.log, #37170
    2016-05-16 bpabbott Attached File- Added octave-workspace, #37169

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code