mate-desktop / mate-media

Media tools for MATE
https://mate-desktop.org
GNU General Public License v2.0
19 stars 25 forks source link

mate-volume-control-status-icon SEGV #159

Closed joakim-tjernlund closed 1 year ago

joakim-tjernlund commented 4 years ago

Steps to reproduce the behaviour

Not sure but I see this a lot when using BlueTooth(BT) headset. Either it happens when you connect/disconnect the HS or when start/close an audio chat in teams/pidgin. I have seen this with USB hs too but not that often

MATE general version

1.22

Package version

1.22.2

Linux Distribution

Gentoo

Link to downstream report of your Distribution

None

joakim-tjernlund commented 4 years ago

Backtrace etc. mate-icon.txt

phodopus42 commented 4 years ago

I'm getting the same issue on Fedora.

Please see https://bugzilla.redhat.com/show_bug.cgi?id=1820673 for the downstream bug.

I can't discern any particular patterns of use that cause this.

First time: I unplugged a USB headset, clicked on the microphone icon, and it crashed.

Second time: I right-clicked on the volume control icon to open the menu.

Third time: I used the scroll-wheel to change the volume level.

The only common factor is a mouse input event on the icon.

I'm happy to try to build a custom package, or attach a debugger. However, it's a very unpredictable bug.

joakim-tjernlund commented 4 years ago

I am 1.24 now and still see the same issue now and then.

joakim-tjernlund commented 4 years ago

Any news?

schmolch commented 4 years ago

This POS is crashing multiple times a day on any of my 3 systems.

lukefromdc commented 4 years ago

Possible workaround for 1.24: Add the new "volume control" applet to the panel and remove mate-volume-control-status-icon ("volume control") from startup applications by unchecking that entry in the mate-control-center "Startup Applications" dialog. If you still get a crash,then the problem is in code common to both of them or even in libmatemixer. I've never seen this crash but it could be hardware-dependent

yeezy69 commented 3 years ago

Same for me, while connecting any bluetooth speaker or headphones the mate-volume-control-status-icon randomly crashes after disconnecting.

Archlinux mate-media 1.24.1-1

Hope this helps, thank you.

$ gdb mate-volume-control-status-icon
GNU gdb (GDB) 10.1
Reading symbols from mate-volume-control-status-icon...
(No debugging symbols found in mate-volume-control-status-icon)
(gdb) run
Starting program: /usr/bin/mate-volume-control-status-icon 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

(mate-volume-control-status-icon:31013): Gtk-WARNING **: 21:54:31.481: Calling gtk_widget_realize() on a widget that isn't inside a toplevel window is not going to work very well. Widgets must be inside a toplevel container before realizing them.

(mate-volume-control-status-icon:31013): GLib-GObject-CRITICAL **: 21:54:31.481: g_object_ref: assertion 'G_IS_OBJECT (object)' failed

(mate-volume-control-status-icon:31013): Gdk-CRITICAL **: 21:54:31.482: gdk_window_get_scale_factor: assertion 'GDK_IS_WINDOW (window)' failed
**
Gtk:ERROR:../gtk/gtk/gtkwidget.c:5871:gtk_widget_get_frame_clock: assertion failed: (window != NULL)
Bail out! Gtk:ERROR:../gtk/gtk/gtkwidget.c:5871:gtk_widget_get_frame_clock: assertion failed: (window != NULL)

Thread 1 "mate-volume-con" received signal SIGABRT, Aborted.
0x00007ffff7018ef5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7018ef5 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff7002862 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff71c6084 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff722185d in g_assertion_message_expr () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff7969637 in  () at /usr/lib/libgtk-3.so.0
#5  0x00007ffff796f58d in gtk_widget_realize () at /usr/lib/libgtk-3.so.0
#6  0x00007ffff796f779 in gtk_widget_map () at /usr/lib/libgtk-3.so.0
#7  0x00007ffff76f1ef0 in  () at /usr/lib/libgtk-3.so.0
#8  0x00007ffff7740231 in  () at /usr/lib/libgtk-3.so.0
#9  0x00007ffff730d7f3 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff730e210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#11 0x00007ffff796f719 in gtk_widget_map () at /usr/lib/libgtk-3.so.0
#12 0x00007ffff798a599 in  () at /usr/lib/libgtk-3.so.0
#13 0x00007ffff730e096 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#14 0x00007ffff730e210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#15 0x00007ffff796f719 in gtk_widget_map () at /usr/lib/libgtk-3.so.0
#16 0x00007ffff798e812 in  () at /usr/lib/libgtk-3.so.0
#17 0x00007ffff72f0ddf in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#18 0x00007ffff7319c2c in  () at /usr/lib/libgobject-2.0.so.0
#19 0x00007ffff730dcad in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#20 0x00007ffff730e210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#21 0x00007ffff7970147 in gtk_widget_show () at /usr/lib/libgtk-3.so.0
#22 0x00007ffff792c510 in  () at /usr/lib/libgtk-3.so.0
#23 0x00007ffff792c709 in  () at /usr/lib/libgtk-3.so.0
#24 0x00007ffff756b89c in  () at /usr/lib/libgdk-3.so.0
#25 0x00007ffff71fd614 in  () at /usr/lib/libglib-2.0.so.0
#26 0x00007ffff71fcf30 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#27 0x00007ffff7250b59 in  () at /usr/lib/libglib-2.0.so.0
#28 0x00007ffff71fc593 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#29 0x00007ffff781358f in gtk_main () at /usr/lib/libgtk-3.so.0
#30 0x00005555555591b9 in main ()
(gdb) quit
cwendling commented 3 years ago

BTW I confirm this through a colleague of mine on 1.20's mate-volume-control-applet (which is possibly the old name of the status icon?). We for the moment worked around it in a fairly ugly fashion by restarting the binary if it crashes.

The backtrace is very similar, and IIUC it's when trying to show the tooltip. Steps to reproduce are the same as well, play with your bluetooth headset or so, and after a couple tries it crashes. I couldn't debug this properly as I don't have the hardware myself, so I only dug a little, but no luck.

yeezy69 commented 3 years ago

Right, I noticed that the applet occasionally crashed on mouseover (tooltip), after bluetooth connect / disconnect. However, it also crashes without a mouseover.

muesli4 commented 1 year ago

It is a bit hard to debug the main loop and I don't have it compiled without optimizations. However, I was able to run it in gdb and it ran into that condition. From what I can see the following is happening (I was printing out some of the widgets with p):

gtk_main
g_main_loop_run
g_main_context_iterate
g_main_context_dispatch
g_main_dispatch
g_timeout_dispatch
gdk_threads_dispatch
tooltip_popup_timeout
gtk_tooltip_show_tooltip
gtk_tooltip_position: tooltip = GtkTooltip
gtk_window_show: widget = GtkTooltipWindow
gtk_widget_map: widget = GtkTooltipWindow
gtk_window_map: widget = GtkTooltipWindow
gtk_widget_map: child = GtkBox
...
gtk_widget_realize: widget = GtkLabel
gtk_widget_get_frame_clock: widget = GtkLabel

gtkwidget.c:5875: g_assert (window != NULL);

So it tries to show the tooltip which recursively sends events (map, realize) through all widgets and in the label it tries to get the frame clock from the window. The window is NULL for some reason.

I added a coredump and a backtrace in debug-information.zip.

I am also not sure whether that is connected but every time this happens I loose network for a short amount of time and I have pulseaudio running on a different machine:

[20. Dez 15:44] r8169 0000:04:00.0 enp4s0: Link is Down
[  +3,071099] r8169 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control rx/tx
[  +2,953061] usb 3-1.1: reset high-speed USB device number 4 using xhci_hcd
muesli4 commented 1 year ago

I assume that:

are all duplicates of this issue.

lukefromdc commented 1 year ago

By any chance is this crash appearing only with the tray on a bottom panel? The tooltip does not appear (would be offscreen) with the tray icon OR with the panel applet on a bottom panel. None of the tooltips work on a bottom panel

muesli4 commented 1 year ago

By any chance is this crash appearing only with the tray on a bottom panel? The tooltip does not appear (would be offscreen) with the tray icon OR with the panel applet on a bottom panel. None of the tooltips work on a bottom panel

No. The status icon is on my top panel. However, I've seen some weird behavior in the past that the tool tip was very far on the left side but still visible in those cases. Maybe there is some glitch related to the position.

But there must be something else going on. Because the widget is clearly realized if it is reaching that code but the parent is probably not (since the GdkWindow is not set). Maybe that is good enough for a gtk bug report already.

lukefromdc commented 1 year ago

I found that bottom panel tooltips do in fact work-so long as the mouse is not dragged all the way to the very bottom row of pixels.

yeezy69 commented 1 year ago

Archlinux mate-media 1.26.0-1: Unfortunately, the applet still crashes.

j6b72 commented 1 year ago

I also notice this (arch, also 1.26.0-1).

Full log, from start to end (probably only the last few lines are relevant):

(mate-volume-control-status-icon:93422): Gdk-CRITICAL **: 21:15:52.817: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed

(mate-volume-control-status-icon:93422): Gtk-WARNING **: 18:46:41.818: Calling gtk_widget_realize() on a widget that isn't inside a toplevel window is not going to work very well. Widgets must be inside a toplevel container before realizing them.

(mate-volume-control-status-icon:93422): GLib-GObject-CRITICAL **: 18:46:41.818: g_object_ref: assertion 'G_IS_OBJECT (object)' failed

(mate-volume-control-status-icon:93422): Gdk-CRITICAL **: 18:46:41.818: gdk_window_get_scale_factor: assertion 'GDK_IS_WINDOW (window)' failed
**
Gtk:ERROR:../gtk/gtk/gtkwidget.c:5875:gtk_widget_get_frame_clock: assertion failed: (window != NULL)
Bail out! Gtk:ERROR:../gtk/gtk/gtkwidget.c:5875:gtk_widget_get_frame_clock: assertion failed: (window != NULL)
Abgebrochen (Speicherabzug geschrieben)

("Abgebrochen (Speicherabzug geschrieben)" is german for "segfault (core dumped)".)

Every time this happens I just resort to starting tmux and running the applet within so I don't have to keep the terminal open, but it's still annoying. Can I do anything to help you solve this faster, like setting certain debug options?

raveit65 commented 1 year ago

There are different reasons for crashing the applet. For all who have a crash when unplug/plug a device please test https://github.com/mate-desktop/libmatemixer/pull/40 and give feedback.

joakim-tjernlund commented 1 year ago

Added here, time will tell if the crashes are gone.

raveit65 commented 1 year ago

The issue with plug/unplug a device should be solved by https://github.com/mate-desktop/libmatemixer/commit/e9995a70b1ff951cca3471894db2c289d9b0e4f9 New 1.26 release is coming.