mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
133 stars 73 forks source link

mate-terminal crashes on Fedora #314

Closed truboxl closed 4 years ago

truboxl commented 4 years ago

Expected behaviour

Not crashing mate-terminal

Actual behaviour

Crashes mate-terminal

Steps to reproduce the behaviour

 Jia Yuan Lo 2018-11-05 17:14:50 UTC

 Description of problem:
 1. Open mate-terminal
 2. Edit -> Profile Preferences
 3. Title and Command
 4. Change When the command exits: "Exit the terminal" to "Hold the terminal open"
 5. Close editing profile window
 6. Close mate-terminal
 7. Crash

 Ben Greear 2018-12-14 18:36:00 UTC

 Similar problem has been detected:

 I was closing a mate terminal window and then it crashed,
 and of course brought down all 20 or 30 terminals I had open on multiple desktops
 and all the applications I had opened through them!

 Ben Greear 2018-12-14 19:06:37 UTC

 I am thinking a partial work-round might be the mate-terminal --disable-factory option

 That way, at least only one window should crash at a time.

 Bernd Schemmer 2019-12-10 09:28:52 UTC

 Description of problem:
 opened a ssh session via Launcher on the MATE Desktop using the command:

 /usr/bin/mate-terminal  --profile="LNX installserver2" --disable-factory

 Everything is fine ; the session works. But closing the session using the Close button
 of the window always crashes the mate-terminal process

 Without the parameter "--disable-factory" for the mate-terminal all other instances
 of mate-terminal wiill also crash.

 The error only occurs for Fedora running in a VirtualBox machines . It's reproducable
 in two Virtual Box machines. 
 The error is there since a long time now - installing the current patches for Fedora
 many times in the last month
 did not fix that bug yet. The last "yum update" was done today - also without fixing
 the bug.

 The error does not happen in Fedora installed on bare metal (Thinkpad T540p)

MATE general version

1.20.1-2

Package version

1.20.1-2

Linux Distribution

Fedora 30 Fedora 31

Link to downstream report of your Distribution

https://bugzilla.redhat.com/show_bug.cgi?id=1781564

raveit65 commented 4 years ago

@rbuj Are you interests to help a bit with this report from redhat bugzilla? I have no idea what can causes this issue.

raveit65 commented 4 years ago

MATE general version

1.20.1-2 Package version

1.20.1-2

Wrong, all fedora versions are using mate-1.22. But issue is confirmed with 1.22 by me.

truboxl commented 4 years ago

Wrong, all fedora versions are using mate-1.22. But issue is confirmed with 1.22 by me.

The issue was first appeared on 1.20.1-2 so yeah good luck tracing from 1.22, and you could have just edit it... you know...

rbuj commented 4 years ago

@raveit65 configure, build & install mate-terminal (master branch) with debugging features on Fedora:

$ ./autogen.sh --prefix=/usr --enable-debug && make && sudo make install

launch mate-terminal with debugging messages / get backtrace

$ MATE_TERMINAL_DEBUG=all gdb $(which mate-terminal) -batch -ex "set logging on" -ex run -ex bt -ex quit
- or -
$ MATE_TERMINAL_DEBUG=all mate-terminal
$ gdb -p $(pgrep -U $USER -x mate-terminal) -batch -ex "set logging on" -ex continue -ex bt -ex quit

segfault on terminal-screen.c:1982, backtrace line: #1

Thread 1 "mate-terminal" hit Breakpoint 1, terminal_screen_child_exited (terminal=0x10942f0, status=9) at terminal-screen.c:1982
1982                    gtk_box_pack_start (GTK_BOX (terminal_screen_container_get_from_screen (screen)),
[Switching to thread 12 (Thread 0x7fc0bcff7700 (LWP 4418))](running)

Thread 1 "mate-terminal" received signal SIGSEGV, Segmentation fault.
0x00007fc0d3c76eca in gtk_box_pack () from /lib64/libgtk-3.so.0

backtrace

#0  0x00007fc0d3c76eca in gtk_box_pack () at /lib64/libgtk-3.so.0
#1  0x000000000042bfb1 in terminal_screen_child_exited (terminal=0x10942f0, status=9) at terminal-screen.c:1982
#2  0x00007fc0d3631742 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#3  0x00007fc0d3644d94 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#4  0x00007fc0d364e34e in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#5  0x00007fc0d364e973 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#6  0x00007fc0d45287ab in vte::platform::Widget::dispose() () at /lib64/libvte-2.91.so.0
#7  0x00007fc0d4511437 in vte_terminal_dispose(_GObject*) () at /lib64/libvte-2.91.so.0
#8  0x0000000000428bf8 in terminal_screen_dispose (object=0x10942f0) at terminal-screen.c:636
#9  0x00007fc0d3638496 in g_object_run_dispose () at /lib64/libgobject-2.0.so.0
#10 0x00007fc0d3c76920 in gtk_box_forall () at /lib64/libgtk-3.so.0
#11 0x00007fc0d3cc2e3a in gtk_container_destroy () at /lib64/libgtk-3.so.0
#12 0x00007fc0d3631648 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#13 0x00007fc0d36457e5 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#14 0x00007fc0d364e34e in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#15 0x00007fc0d364e973 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#16 0x00007fc0d3ee0d80 in gtk_widget_dispose () at /lib64/libgtk-3.so.0
#17 0x00007fc0d3638496 in g_object_run_dispose () at /lib64/libgobject-2.0.so.0
#18 0x00007fc0d3c76969 in gtk_box_forall () at /lib64/libgtk-3.so.0
#19 0x00007fc0d3cc2e3a in gtk_container_destroy () at /lib64/libgtk-3.so.0
#20 0x00007fc0d3631648 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#21 0x00007fc0d36457e5 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#22 0x00007fc0d364e34e in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#23 0x00007fc0d364e973 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#24 0x00007fc0d3ee0d80 in gtk_widget_dispose () at /lib64/libgtk-3.so.0
#25 0x00007fc0d3638496 in g_object_run_dispose () at /lib64/libgobject-2.0.so.0
#26 0x00007fc0d3db6026 in gtk_notebook_forall () at /lib64/libgtk-3.so.0
#27 0x00007fc0d3cc2e3a in gtk_container_destroy () at /lib64/libgtk-3.so.0
#28 0x00007fc0d3631648 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#29 0x00007fc0d36457e5 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#30 0x00007fc0d364e34e in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#31 0x00007fc0d364e973 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#32 0x00007fc0d3ee0d80 in gtk_widget_dispose () at /lib64/libgtk-3.so.0
#33 0x00007fc0d3638496 in g_object_run_dispose () at /lib64/libgobject-2.0.so.0
#34 0x00007fc0d3c76969 in gtk_box_forall () at /lib64/libgtk-3.so.0
#35 0x00007fc0d3cc2e3a in gtk_container_destroy () at /lib64/libgtk-3.so.0
#36 0x00007fc0d3631648 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#37 0x00007fc0d36457e5 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#38 0x00007fc0d364e34e in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#39 0x00007fc0d364e973 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#40 0x00007fc0d3ee0d80 in gtk_widget_dispose () at /lib64/libgtk-3.so.0
#41 0x00007fc0d3638496 in g_object_run_dispose () at /lib64/libgobject-2.0.so.0
#42 0x00007fc0d3eed2e9 in gtk_window_forall () at /lib64/libgtk-3.so.0
#43 0x00007fc0d3cc2e3a in gtk_container_destroy () at /lib64/libgtk-3.so.0
#44 0x00007fc0d3631742 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#45 0x00007fc0d36457e5 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#46 0x00007fc0d364e34e in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#47 0x00007fc0d364e973 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#48 0x00007fc0d3ee0d80 in gtk_widget_dispose () at /lib64/libgtk-3.so.0
#49 0x00007fc0d3ef464c in gtk_window_dispose () at /lib64/libgtk-3.so.0
#50 0x000000000043816e in terminal_window_dispose (object=0xd6a330) at terminal-window.c:2408
#51 0x00007fc0d3638496 in g_object_run_dispose () at /lib64/libgobject-2.0.so.0
#52 0x00007fc0d3d94ee5 in gtk_main_do_event () at /lib64/libgtk-3.so.0
#53 0x00007fc0d3a7ef79 in _gdk_event_emit () at /lib64/libgdk-3.so.0
#54 0x00007fc0d3ab2086 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
#55 0x00007fc0d3549ecd in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#56 0x00007fc0d354a260 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#57 0x00007fc0d354a593 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#58 0x00007fc0d3d93f5d in gtk_main () at /lib64/libgtk-3.so.0
#59 0x0000000000418913 in main (argc=1, argv=0x7ffca0a3c998) at terminal.c:636

possible cause

GTK_BOX (terminal_screen_container_get_from_screen (screen)) returns a wrong value 0x0.

VirtualBox_Fedora 30_10_12_2019_19_10_01

VTE with debugging messages on Fedora

$ sudo dnf builddep -y vte291
$ sudo dnf install -y meson
$ git clone https://gitlab.gnome.org/GNOME/vte
$ cd vte 
$ meson _build --prefix=/usr -Ddebugg=true
$ ninja -C _build 
$ sudo ninja -C _build install

VTE debugging messages

VTE_DEBUG=all mate-terminal
rbuj commented 4 years ago

At this moment, if a command or a shell script is not executed from the terminal, it causes a segfault when the terminal window is closed and the user enabled Hold the terminal open. Moreover, If the user didn't set the --disable-factory option, it will close all terminals.

However, you can run a command or a shell script on a terminal window, and hold the window open when the command or the shell script ended its execution, for instance by using caja.

First, set When command exits: Hold the terminal open on the Editing Profile dialog.

Screenshot at 2019-12-11 17-32-15

Next, choose Open on right-click from caja.

Screenshot at 2019-12-11 17-34-32

Finally click on Run in Terminal button.

Screenshot at 2019-12-11 17-35-03

Result: the terminal has not been closed after 7z (shell script) finished its run.

Screenshot at 2019-12-11 17-35-42

raveit65 commented 4 years ago

@truboxl Are you able to test https://github.com/mate-desktop/mate-terminal/commit/e8b5b063c14f28acf3b84284c48011e9dc8f47d2 ? Or do you need a ready compiled RPM for testing? Which fedora version are you actual use?

truboxl commented 4 years ago

@raveit65 Need a compiled RPM for test. Using Fedora 31.

raveit65 commented 4 years ago

@truboxl Test build with a fix for f30 and f31. Please test and let me know if this fixes the problem. https://koji.fedoraproject.org/koji/taskinfo?taskID=39493000 https://koji.fedoraproject.org/koji/taskinfo?taskID=39493002

truboxl commented 4 years ago

@raveit65 I can confirm mate-terminal-1.22.1-3.fc31 is working as expected. Crash is no longer reproducible.