bugGNU Octave - Bugs: bug #60692, Octave hangs when GUI editor file...


bug #60692: Octave hangs when GUI editor file is saved during shutdown

Submitted by:  Torsten Lilge <ttl>
Submitted on:  Fri 28 May 2021 09:08:01 PM UTC  
Category:  GUI Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Ready For Test Assigned to:  Torsten Lilge <ttl>
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


( Jump to the original submission)

Wed 09 Jun 2021 05:33:00 AM UTC, comment #14: 

Works for me.


Dmitri A. Sergatskov <dasergatskov>
Wed 09 Jun 2021 04:35:22 AM UTC, comment #13: 

It seemed to work for me on stable too, so I pushed the following change, grafted from dev:


John W. Eaton <jwe>
Project Administrator
Tue 08 Jun 2021 09:16:19 PM UTC, comment #12: 

Bisecting on dev pointed to this change as the one that fixed the problem:


I'm testing now on stable.  If I can also reproduce the problem there and this change fixes it for me, I'll graft it on to the stable branch.

John W. Eaton <jwe>
Project Administrator
Mon 07 Jun 2021 10:51:01 AM UTC, comment #11: 

I can't reproduce it with 6.2.90 (stable prerelease) on Windows.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 07 Jun 2021 05:15:05 AM UTC, comment #10: 

Up to now, I wasn't able to reproduce this on the stable branch. But if the stable branch is really affected, then this should be fixed before the 6.3 release.

cc'ing jwe

Torsten Lilge <ttl>
Project MemberIn charge of this item.
Sun 06 Jun 2021 08:59:43 PM UTC, comment #9: 

I cannot crash it with existing file. I.e. if I open t1.m and add b=2 to it and then quit, it asks to save the file and then just quit. This is with stable on Centos. I cannot crash dev on fedora
with neither old or new file.


Dmitri A. Sergatskov <dasergatskov>
Sun 06 Jun 2021 08:50:25 PM UTC, comment #8: 

Intriguing, I can reliably reproduce it on Fedora 34 with a dev from ~2 or 3 weeks ago.
OTOH, you manage to reproduce it with a not-yet-existing .m file, I couldn't.

Philip Nienhuis <philipnienhuis>
Project Member
Sun 06 Jun 2021 07:41:08 PM UTC, comment #7: 

I cannot reproduce this problem on Fedora 34 with current dev.


Dmitri A. Sergatskov <dasergatskov>
Sun 06 Jun 2021 07:36:15 PM UTC, comment #6: 

I get a sig11 in Centos8 (with current stable 6.3 pre-release)
That is what I did:
1. start octave --gui
2. click on Editor Tab, typed some octave commands (a=1)
3. Click on Command "tab", typed quit at octave prompt.
   pop up windows asked if I want to save or cancel changes in
   unnamed file.
4. Choose Save. Got Save File dialog window. Typed t1.m
   octave crashed with signal 11.
Backtrace is below:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000010f5c in ?? ()
[Current thread is 1 (Thread 0x7feeeb985c80 (LWP 440564))]
Thread 1 (Thread 0x7feeeb985c80 (LWP 440564)):
#0  0x0000000000010f5c in  ()
#1  0x00007feee7d446d6 in QFileDialog::accept() () at /lib64/libQt5Widgets.so.5
#2  0x00007feee6cdcbd0 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#3  0x00007feebde5b1e5 in QGtk3FileDialogHelper::onAccepted() () at /usr/lib64/qt5/plugins/platformthemes/libqgnomeplatform.so
#4  0x00007feee6cdcbd0 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
#5  0x00007feeb7a133bd in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#6  0x00007feeb7a26945 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#7  0x00007feeb7a2fa56 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#8  0x00007feeb7a30093 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#9  0x00007feeb7a13616 in _g_closure_invoke_va () at /lib64/libgobject-2.0.so.0
#10 0x00007feeb7a2fa9c in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#11 0x00007feeb7a30093 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#12 0x00007feebd43a072 in button_activate_timeout () at /lib64/libgtk-3.so.0
#13 0x00007feebd0358fc in gdk_threads_dispatch () at /lib64/libgdk-3.so.0
#14 0x00007feed8e5d331 in g_timeout_dispatch () at /lib64/libglib-2.0.so.0
#15 0x00007feed8e5c87d in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#16 0x00007feed8e5cc38 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#17 0x00007feed8e5cf62 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#18 0x00007feebd4ad2f7 in gtk_dialog_run () at /lib64/libgtk-3.so.0
#19 0x00007feebde5d510 in QGtk3Dialog::exec() () at /usr/lib64/qt5/plugins/platformthemes/libqgnomeplatform.so
#20 0x00007feee7d350de in QDialog::exec() () at /lib64/libQt5Widgets.so.5
#21 0x00007feeeb28cbe2 in octave::file_editor_tab::show_dialog(QDialog*, bool) (this=0x27b70d0, dlg=0x289e310, modal=true) at ../libgui/src/m-editor/file-editor-tab.cc:1717
#22 0x00007feeeb29040a in octave::file_editor_tab::save_file_as(bool) (this=0x27b70d0, remove_on_success=false) at ../libgui/src/m-editor/file-editor-tab.cc:2387
#23 0x00007feeeb28f4ac in octave::file_editor_tab::save_file(QString const&, bool, bool) (this=0x27b70d0, saveFileName=..., remove_on_success=false, restore_breakpoints=false) at ../libgui/src/m-editor/file-editor-tab.cc:2113
#24 0x00007feeeb28cf34 in octave::file_editor_tab::check_file_modified(bool) (this=0x27b70d0, remove=false) at ../libgui/src/m-editor/file-editor-tab.cc:1766
#25 0x00007feeeb2a1a4f in octave::file_editor::check_closing() (this=0x21be720) at ../libgui/src/m-editor/file-editor.cc:485
#26 0x00007feeeb2cbf43 in octave::main_window::confirm_shutdown() (this=0x1ab2500) at ../libgui/src/main-window.cc:306
#27 0x00007feeeb2f77c3 in octave::gui_qobject::confirm_shutdown() (this=0x7ffe7ee44810) at ../libgui/src/octave-qobject.cc:393
#28 0x00007feeeb2fb5b2 in octave::qt_interpreter_events::confirm_shutdown_octave() (this=0x19b5b70) at ../libgui/src/qt-interpreter-events.cc:571
#29 0x00007feeeb39878e in octave::qt_interpreter_events::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x19b5b70, _c=QMetaObject::InvokeMetaMethod, _id=29, _a=0x7fee742e8a98) at libgui/src/moc-qt-interpreter-events.cc:249
#30 0x00007feee6cd5ff3 in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#31 0x00007feee7b381e2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#32 0x00007feee7b3ef90 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#33 0x00007feeeb2f68ab in octave::octave_qapplication::notify(QObject*, QEvent*) (this=0x189d400, receiver=0x19b5b70, ev=0x7fee742e8a50) at ../libgui/src/octave-qobject.cc:136
#34 0x00007feee6ca9712 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#35 0x00007feee6cac501 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib64/libQt5Core.so.5
#36 0x00007feee6cfded7 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5Core.so.5
#37 0x00007feed8e5c87d in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#38 0x00007feed8e5cc38 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#39 0x00007feed8e5ccd0 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#40 0x00007feee6cfdc84 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#41 0x00007feee6ca840b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#42 0x00007feee6cb0864 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#43 0x00007feeeb2f7341 in octave::base_qobject::exec() (this=0x7ffe7ee44810) at ../libgui/src/octave-qobject.cc:284
#44 0x00007feeeb30494e in octave::qt_application::execute() (this=0x7ffe7ee44980) at ../libgui/src/qt-application.cc:68
#45 0x0000000000401a4d in main(int, char**) (argc=9, argv=0x7ffe7ee44ca8) at ../src/main-gui.cc:106

Dmitri A. Sergatskov <dasergatskov>
Sun 06 Jun 2021 07:31:50 PM UTC, comment #5: 

Just tried on Fedora and Mageia: same results.
On Mageia & Windows I checked the file size: indeed empty.

Another thing: this issue only occurs with .m files. With other file types (no .m extension) the bug doesn't show up.

Could the parser be involved? AFAICR that usually checks the file's syntax before trying to save, so that'll work only on .m files. Could it be invoked in a way the GUI doesn't expect?

I see the file dialog only in case of a not-yet-existing file, at a time the file extension isn't known yet.
I can reproduce the bug only with pre-existing .m files.

Maybe add JWE to the cc list?

Philip Nienhuis <philipnienhuis>
Project Member
Sun 06 Jun 2021 07:21:00 PM UTC, comment #4: 

Maybe we have different issues then? Although you see a file dialog (which should not be the case), does the system remain responsive?

Torsten Lilge <ttl>
Project MemberIn charge of this item.
Sun 06 Jun 2021 07:04:41 PM UTC, comment #3: 

Yes I can, only when choosing "Save" and having a pre-existing modified-but-not-yet-saved file in the GUI editor.
Just typing some text and quitting Octave, choosing "Save" goes to the Save dialog.
Does this help narrowing down the issue?

Shall I try on Linux as well? I have both Fedora 34 and Mageia-8

Philip Nienhuis <philipnienhuis>
Project Member
Fri 04 Jun 2021 07:31:47 PM UTC, comment #2: 

@Philip, can you reliably reproduce this bug? On my systems, the issue is only showing up from time to time and up to now, never when I had gdb activated.

When the issue occurs, I get heavy disk activity and the current Gnome session is completely unresponsive. I have to open a terminal session in order to kill octave and gnome-shell. After the automatic restart of gnome-shell I can continue working. However, and this is really weird, my mail client (evolution) remains unresponsive after this happened.

Torsten Lilge <ttl>
Project MemberIn charge of this item.
Sat 29 May 2021 08:06:31 PM UTC, comment #1: 

Confirmed on Windows, OS -> Any.
Hangs only when choosing "Save". CPU utilization was just one core,  not 100 %.
I tried a version I crossbuilt on April 14 that I still had installed: it has the same issue, so this is not a recent bug.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 28 May 2021 09:08:01 PM UTC, original submission:  

When shutting down Octave GUI with an open, modified editor file a dialog pops up asking whether the changes should be discarded, saved or whether exiting should be canceled. When choosing "save", octave hangs with 100% CPU and killing octave leaves an empty file even if the file was not empty before the modifications.

Torsten Lilge <ttl>
Project MemberIn charge of this item.


(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 ttl
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by ttl (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-06-09 jwe StatusConfirmed => Ready For Test
    2021-06-07 ttl Carbon-Copy- => Added jwe
    2021-06-06 philipnienhuis Carbon-Copy- => Added philipnienhuis
    2021-05-29 philipnienhuis StatusNone => Confirmed
        Operating SystemGNU/Linux => Any

    Back to the top

    Powered by Savane 3.6