mate-desktop / mate-panel

MATE panel
https://mate-desktop.org
GNU General Public License v2.0
184 stars 115 forks source link

SEGFAULT when StatusNotifier is Used. #686

Closed oblongau closed 6 years ago

oblongau commented 6 years ago

Expected behaviour

No segfault. Notification area to be updated, presumably to show calibre icon.

Actual behaviour

Popup saying, "Notification Area" has quit unexpectedly. If you reload a panel object, it will automatically be added back to the panel." The network connection/speaker etc. icons are then not showing. If I click "Reload" then they reappear. There is no indication there that calibre is running, but it is actually properly running in the background.

dmesg has this entry: notification-ar[17348]: segfault at 22 ip 00007f90aed14268 sp 00007ffeda1f5bc0 error 6 in libglib-2.0.so.0.4800.2[7f90aecf4000+10f000]

/var/log/syslog has:

` Dec 1 07:27:09 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:17348): status-notifier-watcher-WARNING **: Status Notifier Item with bus name 'org.kde.StatusNotifierItem-18318-1' and object path '/StatusNotifierItem' is already registered

Dec 1 07:27:09 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:17348): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -1 and height 15

Dec 1 07:27:09 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:17348): GLib-GIO-WARNING **: Received property Version with type i does not match expected type u in the expected interface

Dec 1 07:27:09 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:17348): GLib-CRITICAL **: the GVariant format string '(i@a{sv}@av)' has a type of '(ia{sv}av)' but the given value has a type of '(ia{sv}a(ia{sv}av))'

Dec 1 07:27:09 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:17348): GLib-CRITICAL **: g_variant_get: assertion 'valid_format_string (format_string, TRUE, value)' failed

Dec 1 07:27:09 bob-mint kernel: [44554.934631] notification-ar[17348]: segfault at 22 ip 00007f90aed14268 sp 00007ffeda1f5bc0 error 6 in libglib-2.0.so.0.4800.2[7f90aecf4000+10f000]

Dec 1 07:27:12 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:18359): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -1 and height 15 `

Steps to reproduce the behaviour

Using dconf-editor, set org>mate>panel>general>enable-sni-support

This fault occurs when trying to run calibre to start minimized to system tray. (https://manual.calibre-ebook.com/generated/en/calibre.html)

In Control Centre|Startup Applications "calibre --start-in-tray" is the command.

Or, with calibre not running in background, running "calibre --start-in-tray" results in the same error and behaviour.

MATE general version

1.18.0

Package version

mate-desktop is 1.18.0-+sonya mate-panel is 1.18.6-1+sonya

Linux Distribution

Release Linux Mint 18.3 Sylvia 64-bit Kernel Linux 4.10.0-40-generic x86_64 MATE 1.18.0

Link to downstream report of your Distribution

monsta commented 6 years ago

Backtrace:

(gdb) bt full
#0  0x00007fef7b5f1c4c in g_variant_ref (value=0x6e61697261765f67) at ../../../../glib/gvariant-core.c:661
        _g_boolean_var_ = <optimized out>
#1  0x00007fef7b5f20dd in g_variant_get_child_value (value=0x7ffd60670090, index_=0) at ../../../../glib/gvariant-core.c:985
        child = <optimized out>
        __func__ = "g_variant_get_child_value"
#2  0x00007fef7b5f08c4 in g_variant_iter_next (iter=iter@entry=0x7ffd6066ffa0, format_string=<optimized out>, 
    format_string@entry=0x55a75a327bb2 "{&sv}") at ../../../../glib/gvariant.c:5635
        value = <optimized out>
        __func__ = "g_variant_iter_next"
#3  0x000055a75a326614 in sn_dbus_menu_item_update_props (item=item@entry=0x55a75bc76f50, props=props@entry=0x7ffd60670090)
    at sn-dbus-menu-item.c:282
        iter = 
            {x = {140726220816528, 3404456409, 0, 0, 140726220816520, 140666543831902, 94177287414488, 3579507750, 1, 140666546553561, 757451354288, 140666546547952, 94177287313920, 94177288824784, 144, 140666543425092}}
        prop = 0x7ffd6066ffa0 "\220"
        value = 0xcaebe1d95728a500
#4  0x000055a75a315b01 in layout_update_item (props=0x7ffd60670090, id=3404456409, gtk_menu=0x0, menu=0x55a75bbc06a0 [SnDBusMenu])
    at sn-dbus-menu.c:112
        item = 0x55a75bc76f50
        id = 3404456409
        props = 0x7ffd60670090
        items = 0x7fef60014830
        iter = 
            {x = {140666084608080, 140666544180064, 140666544171336, 3404456409, 5, 94177287643424, 94177287696208, 140666084608048, 0, 140666084608080, 94177286948512, 140666543743210, 94177286948512, 140666543742827, 94177287696208, 5757248768}}
        child = <optimized out>
#5  0x000055a75a315b01 in layout_parse (menu=menu@entry=0x55a75bbc06a0 [SnDBusMenu], layout=layout@entry=0x0, gtk_menu=gtk_menu@entry=0x0)
    at sn-dbus-menu.c:131
        id = 3404456409
        props = 0x7ffd60670090
        items = 0x7fef60014830
        iter = 
            {x = {140666084608080, 140666544180064, 140666544171336, 3404456409, 5, 94177287643424, 94177287696208, 140666084608048, 0, 140666084608080, 94177286948512, 140666543743210, 94177286948512, 140666543742827, 94177287696208, 5757248768}}
        child = <optimized out>
#6  0x000055a75a315a8a in layout_parse (menu=menu@entry=0x55a75bbc06a0 [SnDBusMenu], layout=layout@entry=0x7fef60016e10, gtk_menu=gtk_menu@entry=0x55a75bbc06a0 [SnDBusMenu]) at sn-dbus-menu.c:141
        value = 0x0
        id = 3404456409
        props = 0x55a75ba20e40
        items = 0x7fef60014830
        iter = 
            {x = {140666084608048, 1, 0, 0, 0, 140726220816880, 140726220817176, 3579507750, 0, 140666084608080, 94177286948512, 14066654374---Type <return> to continue, or q <return> to quit---
3210, 94177286948512, 140666543742827, 140726220817172, 140666543736384}}
        child = 0x7fef60016e10
#7  0x000055a75a315a8a in layout_parse (menu=menu@entry=0x55a75bbc06a0 [SnDBusMenu], layout=<optimized out>, gtk_menu=<optimized out>)
    at sn-dbus-menu.c:141
        value = 0x7fef60016e10
        id = 0
        props = 0x7fef600180a0
        items = 0x55a75ba20e10
        iter = 
            {x = {94177285246480, 4, 0, 0, 94177283842740, 140666151638720, 140666084616800, 3579507750, 0, 94177284896128, 140666546410112, 140666549690416, 0, 94177284305104, 140726220817184, 140666084616800}}
        child = 0x7fef60014830
#8  0x000055a75a31640c in get_layout_cb (source_object=0x55a75b9cb580 [SnDBusMenuGenProxy], res=<optimized out>, user_data=<optimized out>)
    at sn-dbus-menu.c:180
        layout = 0x55a75ba20e40
        revision = 0
        error = 0x0
        menu = 0x55a75bbc06a0 [SnDBusMenu]
#9  0x00007fef7bb5e203 in g_task_return_now (task=0x55a75b93b0d0 [GTask]) at ../../../../gio/gtask.c:1145
#10 0x00007fef7bb5ec26 in g_task_return (task=0x55a75b93b0d0 [GTask], type=<optimized out>) at ../../../../gio/gtask.c:1203
        source = 0x7fef60023200
#11 0x00007fef7bb9d06b in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x55a75b93b0d0)
    at ../../../../gio/gdbusproxy.c:2589
        data = <optimized out>
        task = 0x55a75b93b0d0 [GTask]
        value = 0x7fef60016a60
        error = 0x0
        fd_list = 0x0
#12 0x00007fef7bb5e203 in g_task_return_now (task=0x55a75b9471f0 [GTask]) at ../../../../gio/gtask.c:1145
#13 0x00007fef7bb5ec26 in g_task_return (task=0x55a75b9471f0 [GTask], type=<optimized out>) at ../../../../gio/gtask.c:1203
        source = 0x7fef60023200
#14 0x00007fef7bb91cd2 in g_dbus_connection_call_done (source=<optimized out>, result=0x7fef60004410, user_data=0x55a75b9471f0)
    at ../../../../gio/gdbusconnection.c:5722
        connection = <optimized out>
        task = 0x55a75b9471f0 [GTask]
        state = 0x55a75b99aee0
        error = 0x0
        reply = 0x55a75bcc4280 [GDBusMessage]
        value = <optimized out>
#15 0x00007fef7bb5e203 in g_task_return_now (task=0x7fef60004410 [GTask]) at ../../../../gio/gtask.c:1145
#16 0x00007fef7bb5e239 in complete_in_idle_cb (task=0x7fef60004410) at ../../../../gio/gtask.c:1159
#17 0x00007fef7b5b5e25 in g_main_dispatch (context=0x55a75b8e5b30) at ../../../../glib/gmain.c:3148
        dispatch = 0x7fef7b5b2760 <g_idle_dispatch>
---Type <return> to continue, or q <return> to quit---
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x7fef60004410
        callback = 0x7fef7bb5e230 <complete_in_idle_cb>
        cb_funcs = 0x7fef7b87d280 <g_source_callback_funcs>
        cb_data = 0x7fef60003f50
        need_destroy = <optimized out>
        source = 0x7fef60023200
        current = 0x55a75b913010
        i = 0
#18 0x00007fef7b5b5e25 in g_main_context_dispatch (context=context@entry=0x55a75b8e5b30) at ../../../../glib/gmain.c:3813
#19 0x00007fef7b5b61f0 in g_main_context_iterate (context=0x55a75b8e5b30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../../glib/gmain.c:3886
        max_priority = 2147483647
        timeout = 1
        some_ready = 1
        nfds = <optimized out>
        allocated_nfds = 3
        fds = 0x55a75ba150e0
#20 0x00007fef7b5b6502 in g_main_loop_run (loop=0x55a75ba150c0) at ../../../../glib/gmain.c:4082
        __func__ = "g_main_loop_run"
#21 0x00007fef7cb0e725 in gtk_main () at ../../../../gtk/gtkmain.c:1322
        loop = 0x55a75ba150c0
#22 0x00007fef7d531474 in mate_panel_applet_factory_main (factory_id=<optimized out>, out_process=1, applet_type=94177285193728, callback=<optimized out>, user_data=0x0) at mate-panel-applet.c:2321
        factory = 0x55a75bb24300 [MatePanelAppletFactory]
        closure = 0x55a75ba14180
        __func__ = "mate_panel_applet_factory_main"
#23 0x000055a75a30b4c8 in main (argc=<optimized out>, argv=<optimized out>) at main.c:422
        context = 0x55a75b8b7540
        error = 0x0
        retval = <optimized out>
(gdb) 
joakim-tjernlund commented 6 years ago

Just found this and checked my dmesg and sre enough I got:

traps: notification-ar[7839] general protection ip:7fd13e8f74bc sp:7ffccad7bef0 error:0 in libglib-2.0.so.0.5200.3[7fd13e870000+113000]

This is TeamViewer 13 starting up

lukefromdc commented 6 years ago

Apparently only some programs (not all) using the status notifier do this, I've never had this happen with Avidemux, network-manager-applet or anything else I've got installed doing this. I can't install random software on my machine for testing though, it's my main bare metal system and is encrypted for security.

Thus I can't say for sure whether this is only some installations, or only some uses of the status notifier.

joakim-tjernlund commented 6 years ago

Managed to get this backtrace:


(gdb) bt
#0  0x00007f19364754bc in g_variant_get_child_value () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f1936473cb4 in g_variant_iter_next () from /usr/lib64/libglib-2.0.so.0
#2  0x000000000040d8d3 in ?? ()
#3  0x000000000040db92 in ?? ()
#4  0x000000000040f3bc in ?? ()
#5  0x00007f19369e1613 in ?? () from /usr/lib64/libgio-2.0.so.0
#6  0x00007f19369e20de in ?? () from /usr/lib64/libgio-2.0.so.0
#7  0x00007f1936a14f5a in ?? () from /usr/lib64/libgio-2.0.so.0
#8  0x00007f19369e1613 in ?? () from /usr/lib64/libgio-2.0.so.0
#9  0x00007f19369e1649 in ?? () from /usr/lib64/libgio-2.0.so.0
#10 0x00007f19364386ba in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#11 0x00007f1936438a60 in ?? () from /usr/lib64/libglib-2.0.so.0
#12 0x00007f1936438d82 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#13 0x00007f193794f255 in gtk_main () from /usr/lib64/libgtk-3.so.0
#14 0x00007f193869d713 in mate_panel_applet_factory_main () from /usr/lib64/libmate-panel-applet-4.so.1
#15 0x000000000040ab5e in ?? ()
#16 0x00007f193605f510 in __libc_start_main (main=0x40aa60, argc=1, argv=0x7fff318a6a58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff318a6a48) at ../csu/libc-start.c:295
#17 0x000000000040abaa in ?? ()
joakim-tjernlund commented 6 years ago

Saw this on teamviewers known issues list:

joakim-tjernlund commented 6 years ago

Better trace(I was sure i already uploaded this ...):


(gdb) bt
#0  0x00007ff78fed3b52 in g_variant_get_child_value (value=0x7fff8218d4f8, index_=0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gvariant-core.c:985
#1  0x00007ff78fecfb91 in g_variant_iter_next_value (iter=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gvariant.c:3110
#2  0x00007ff78fed260b in g_variant_iter_next (iter=iter@entry=0x7fff8218d3d0, format_string=format_string@entry=0x42a5e9 "(ii@ay)") at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gvariant.c:5636
#3  0x00000000004125b8 in icon_pixmap_new (variant=<optimized out>) at sn-item-v0.c:444
#4  0x000000000041267c in sn_tooltip_new (variant=<optimized out>) at sn-item-v0.c:511
#5  0x000000000041391f in get_all_cb (source_object=<optimized out>, res=<optimized out>, user_data=<optimized out>) at sn-item-v0.c:940
#6  0x00007ff79042e7e6 in g_task_return_now (task=0x6a89d1, task@entry=0x6a89d0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1145
#7  0x00007ff79042f17a in g_task_return (task=task@entry=0x6a89d0, type=type@entry=G_TASK_RETURN_SUCCESS) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1203
#8  0x00007ff79042f660 in g_task_return_pointer (task=task@entry=0x6a89d0, result=0x7ff77800b0a0, result_destroy=0x7ff78fed3684 <g_variant_unref>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1601
#9  0x00007ff79045fa57 in g_dbus_connection_call_done (source=<optimized out>, result=0x6a8830, user_data=0x6a89d0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gdbusconnection.c:5722
#10 0x00007ff79042e7e6 in g_task_return_now (task=task@entry=0x6a8830) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1145
#11 0x00007ff79042e810 in complete_in_idle_cb (task=0x6a8830) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1159
#12 0x00007ff78fe9884b in g_idle_dispatch (source=source@entry=0x7ff77800ba90, callback=<optimized out>, user_data=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:5586
#13 0x00007ff78fe9bb34 in g_main_dispatch (context=0x67d940) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3234
#14 g_main_context_dispatch (context=context@entry=0x67d940) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3899
#15 0x00007ff78fe9be23 in g_main_context_iterate (context=0x67d940, block=block@entry=1, dispatch=dispatch@entry=1, self=self@entry=0x690d60) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3972
#16 0x00007ff78fe9c187 in g_main_loop_run (loop=0x8abbb0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:4168
#17 0x00007ff79138a255 in gtk_main () from /usr/lib64/libgtk-3.so.0
#18 0x00007ff7920d839e in mate_panel_applet_factory_main (factory_id=factory_id@entry=0x42a0a4 "NotificationAreaAppletFactory", out_process=out_process@entry=1, applet_type=9107216, callback=callback@entry=0x40f935 <applet_factory>, 
    user_data=user_data@entry=0x0) at mate-panel-applet.c:2321
#19 0x000000000040ff46 in main (argc=1, argv=0x7fff8218d888) at main.c:422
(gdb) bt full
#0  0x00007ff78fed3b52 in g_variant_get_child_value (value=0x7fff8218d4f8, index_=0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gvariant-core.c:985
        child = <optimized out>
        __func__ = "g_variant_get_child_value"
#1  0x00007ff78fecfb91 in g_variant_iter_next_value (iter=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gvariant.c:3110
        __func__ = "g_variant_iter_next_value"
#2  0x00007ff78fed260b in g_variant_iter_next (iter=iter@entry=0x7fff8218d3d0, format_string=format_string@entry=0x42a5e9 "(ii@ay)") at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gvariant.c:5636
        value = <optimized out>
        __func__ = "g_variant_iter_next"
#3  0x00000000004125b8 in icon_pixmap_new (variant=<optimized out>) at sn-item-v0.c:444
        array = 0x76db60
        iter = {x = {140735376053496, 6901472, 0, 0, 140735376053432, 11355657933146014464, 140735376053264, 3579507750, 3, 140700846960800, 140735376053496, 140735376053504, 4368038, 140701244497060, 4368038, 11355657933146014464}}
        width = -2112301832
        height = 32767
        value = 0x9d9766b9b003c300
#4  0x000000000041267c in sn_tooltip_new (variant=<optimized out>) at sn-item-v0.c:511
        icon_name = 0x7ff77800b0a0 "а"
        icon_pixmap = 0x7fff8218d4f8
        title = 0x7fff8218d500 " ;"
        text = 0x42a6a6 "Category"
        tooltip = 0x7b68d0
#5  0x000000000041391f in get_all_cb (source_object=<optimized out>, res=<optimized out>, user_data=<optimized out>) at sn-item-v0.c:940
        v0 = 0x8da9a0
        properties = 0x7ff77800b0a0
        error = 0x0
        iter = 0x7ff778004230
        key = 0x6cc4c0 "ToolTip"
        value = 0x7ff770003b20
#6  0x00007ff79042e7e6 in g_task_return_now (task=0x6a89d1, task@entry=0x6a89d0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1145
No locals.
#7  0x00007ff79042f17a in g_task_return (task=task@entry=0x6a89d0, type=type@entry=G_TASK_RETURN_SUCCESS) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1203
        source = 0x7ff77800ba90
#8  0x00007ff79042f660 in g_task_return_pointer (task=task@entry=0x6a89d0, result=0x7ff77800b0a0, result_destroy=0x7ff78fed3684 <g_variant_unref>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1601
        __func__ = "g_task_return_pointer"
#9  0x00007ff79045fa57 in g_dbus_connection_call_done (source=<optimized out>, result=0x6a8830, user_data=0x6a89d0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gdbusconnection.c:5722
        connection = <optimized out>
        task = 0x6a89d0
        state = 0x76d980
        error = 0x0
        reply = 0x89a680
        value = <optimized out>
#10 0x00007ff79042e7e6 in g_task_return_now (task=task@entry=0x6a8830) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1145
No locals.
#11 0x00007ff79042e810 in complete_in_idle_cb (task=0x6a8830) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/gio/gtask.c:1159
No locals.
#12 0x00007ff78fe9884b in g_idle_dispatch (source=source@entry=0x7ff77800ba90, callback=<optimized out>, user_data=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:5586
No locals.
#13 0x00007ff78fe9bb34 in g_main_dispatch (context=0x67d940) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3234
        dispatch = 0x7ff78fe98819 <g_idle_dispatch>
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x6a8830
        callback = 0x7ff79042e807 <complete_in_idle_cb>
        cb_funcs = 0x7ff79015a920 <g_source_callback_funcs>
        cb_data = 0x7ff778003dc0
        need_destroy = <optimized out>
        source = 0x7ff77800ba90
        current = 0x68ca80
        i = 0
#14 g_main_context_dispatch (context=context@entry=0x67d940) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3899
No locals.
#15 0x00007ff78fe9be23 in g_main_context_iterate (context=0x67d940, block=block@entry=1, dispatch=dispatch@entry=1, self=self@entry=0x690d60) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:3972
        max_priority = 2147483647
        timeout = 25000
        some_ready = 1
        nfds = <optimized out>
        allocated_nfds = <optimized out>
        fds = 0x8abb90
---Type <return> to continue, or q <return> to quit---
#16 0x00007ff78fe9c187 in g_main_loop_run (loop=0x8abbb0) at /var/tmp/portage/dev-libs/glib-2.52.3/work/glib-2.52.3/glib/gmain.c:4168
        self = 0x690d60
        __func__ = "g_main_loop_run"
#17 0x00007ff79138a255 in gtk_main () from /usr/lib64/libgtk-3.so.0
No symbol table info available.
#18 0x00007ff7920d839e in mate_panel_applet_factory_main (factory_id=factory_id@entry=0x42a0a4 "NotificationAreaAppletFactory", out_process=out_process@entry=1, applet_type=9107216, callback=callback@entry=0x40f935 <applet_factory>, 
    user_data=user_data@entry=0x0) at mate-panel-applet.c:2321
        factory = 0x8a1700
        closure = 0x899230
        __func__ = "mate_panel_applet_factory_main"
#19 0x000000000040ff46 in main (argc=1, argv=0x7fff8218d888) at main.c:422
        context = 0x648f00
        error = 0x0
        retval = <optimized out>
(gdb) quit
lukefromdc commented 6 years ago

OK,from my read of the backtrace it looks like the trouble is in icon_pixmap_new in sn-item.v0.c My guess is that icon_pixmap_new is to blame and this relates to handling the icons provided by the application. That in turn would explain why some applications and not others are doing this. Could someone upload a copy of the exact icon file used by one of the offending apps?

This line in particular in icon_pixmap_new (line 444) got called out in the backtrace:

while (g_variant_iter_next (&iter, "(ii@ay)", &width, &height, &value))

There is also a reference to line 511 in sn-item.v0.c in sn_tooltip_new

which is: tooltip->icon_pixmap = icon_pixmap_new (icon_pixmap);

and again calls the icon handling code, so the tooltip problem IS the icon problem``

joakim-tjernlund commented 6 years ago

If I only knew which one that was, there are a bunch of:

qlist teamviewer | grep png
/usr/share/icons/hicolor/48x48/apps/TeamViewer.png
/usr/share/icons/hicolor/32x32/apps/TeamViewer.png
/usr/share/icons/hicolor/24x24/apps/TeamViewer.png
/usr/share/icons/hicolor/16x16/apps/TeamViewer.png
/usr/share/icons/hicolor/256x256/apps/TeamViewer.png
/opt/teamviewer13/tv_bin/desktop/teamviewer_48.png
/opt/teamviewer13/tv_bin/desktop/teamviewer_20.png
/opt/teamviewer13/tv_bin/desktop/teamviewer_32.png
/opt/teamviewer13/tv_bin/desktop/teamviewer_24.png
/opt/teamviewer13/tv_bin/desktop/teamviewer_16.png
/opt/teamviewer13/tv_bin/desktop/teamviewer_256.png

but which, if any, I have no idea.

lukefromdc commented 6 years ago

Those look like ordinary .png icons. Wonder if having them installed in /opt/teamviewer13 instead of /usr/share/pixmaps or /usr/share/icons (a path not being found) is the problem here?

lukefromdc commented 6 years ago

Copy them all into a tarball and upload that

muktupavels commented 6 years ago

Seems that this issue includes at least two bugs... My answer is about using calibre!

Relevant line from syslog:

Dec 1 07:27:09 bob-mint org.mate.panel.applet.NotificationAreaAppletFactory[1712]: (notification-area-applet:17348): GLib-CRITICAL **: the GVariant format string '(i@a{sv}@av)' has a type of '(ia{sv}av)' but the given value has a type of '(ia{sv}a(ia{sv}av))'

And here link to specification / dbus interface: http://bazaar.launchpad.net/~dbusmenu-team/libdbusmenu/trunk.16.10/view/head:/libdbusmenu-glib/dbus-menu.xml#L216

From that you can see that layout should have (ia{sv}av) as type, but for some reason it is (ia{sv}a(ia{sv}av)). At this point I think it is not hard to see that types does not match and is reason for application crash because code expects correct type. That last v should be in (ia{sv}av) format, but in type it should appear as v.

The wrong function in calibre: https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/dbus_export/menu.py#L239

Line ans = dbus.Array(signature='(ia{sv}av)') should be ans = dbus.Array(signature='v').

lukefromdc commented 6 years ago

Try a build from git master after https://github.com/mate-desktop/mate-panel/commit/e5c8646d8f6167fe2d3634a4604a1bf9ec8ee5af

I have no idea if this will help with Calibre (don't have it installed) but gets the icons to load properly in applications that call them by path rather than by the correct icon name

lukefromdc commented 6 years ago

If fixing icon loading has no effect (it may or may not based on what https://github.com/muktupavels said), you might need to file a bug against calibre.

EDIT: Having the icon loaded may make a difference based on the backtrace, so give it a shot

lukefromdc commented 6 years ago

I just managed to test install calibre (can't keep it due to the installed size and non-use), and found inconsistant behavior when started with "calibre --start-in-tray." Tested this while running the panel from terminal, and both the calibre and panel terminals showed errors and a lot of them. Sometimes the panel segfaulted, sometimes it became non-responsive, and sometimes the tray icon actually loaded, but clicking on it got an empty menu with two menuitems that could be selected and clicked on but contained no text or icons and did nothing when clicked on.

In panel from terminal I got this set of errors, resulting from the above mentioned mismatched code in Calibre:


** (mate-panel:29992): WARNING **: 18:08:37.620: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(mate-panel:29992): status-notifier-watcher-WARNING **: 18:08:41.840: Status Notifier Item with bus name 'org.kde.StatusNotifierItem-30055-1' and object path '/StatusNotifierItem' is already registered

(mate-panel:29992): GLib-GIO-WARNING **: 18:08:41.913: Received property Version with type i does not match expected type u in the expected interface

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: the GVariant format string '(i@a{sv}@av)' has a type of '(ia{sv}av)' but the given value has a type of '(ia{sv}a(ia{sv}av))'

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: g_variant_get: assertion 'valid_format_string (format_string, TRUE, value)' failed

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: g_variant_unref: assertion 'value->ref_count > 0' failed

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: the GVariant format string '(i@a{sv}@av)' has a type of '(ia{sv}av)' but the given value has a type of '(ia{sv}a(ia{sv}av))'

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: g_variant_get: assertion 'valid_format_string (format_string, TRUE, value)' failed

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: g_variant_unref: assertion 'value->ref_count > 0' failed

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: the GVariant format string '(i@a{sv}@av)' has a type of '(ia{sv}av)' but the given value has a type of '(ia{sv}a(ia{sv}av))'

(mate-panel:29992): GLib-CRITICAL **: 18:08:41.915: g_variant_get: assertion 'valid_format_string (format_string, TRUE, value)' failed

In Calibre's terminal I got this pair of error warnings, which is probably why the icon fails to load most of the time even when the panel stays running:

libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
lukefromdc commented 6 years ago

I also found that if the icon showed up, the panel usually kept running. If it loaded as a non-clickable space maybe 1px or so wide, the panel often became nonresponsive and sometimes segfaulted. Icon loaded about half the time in my last series of test runs

muktupavels commented 6 years ago

Second problem also is related to incorrect GVariant / property type. Here was mentioned TeamViewer and stacktrace shows crash in sn_tooltip_new. At least in TeamViewer case they are incorrectly setting tooltip. For some reason they have decided to use simple string as tooltip property while it should have (sa(iiay)ss)...

lukefromdc commented 6 years ago

EDIT: the crash was on starting Calibre to the tray

Running mate-panel from git master with the most recent commits, and running it under gdb, I always got the segfault, and I got this backtrace:

(gdb) thread apply all bt full

Thread 5 (Thread 0x7fffe5184700 (LWP 20503)):
#0  0x00007ffff29a7d89 in syscall ()
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff3753614 in g_cond_wait_until ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff36e4121 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff3736a54 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff37360f5 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6872519 in start_thread (arg=0x7fffe5184700)
    at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffe5184700
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140737036961536, 1945441458090611619, 140737488347358, 140737488347359, 140737277812896, 140737036961536, -1945464318161120349, -1945425585873677405}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#6  0x00007ffff29aca4f in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

---Type <return> to continue, or q <return> to quit---
Thread 4 (Thread 0x7fffe7df2700 (LWP 20482)):
#0  0x00007ffff29a2a5d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff370f841 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff370f94c in g_main_context_iteration ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fffe7dfa42d in  ()
    at /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007ffff37360f5 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6872519 in start_thread (arg=0x7fffe7df2700)
    at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffe7df2700
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140737083549440, 1945441458090611619, 140737488347310, 140737488347311, 140737277812896, 140737083549440, -1945459326335380573, -1945425585873677405}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#6  0x00007ffff29aca4f in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 3 (Thread 0x7fffec926700 (LWP 20481)):
---Type <return> to continue, or q <return> to quit---
#0  0x00007ffff29a2a5d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff370f841 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff370fbd2 in g_main_loop_run ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff3cfbde6 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffff37360f5 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6872519 in start_thread (arg=0x7fffec926700)
    at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffec926700
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140737162405632, 1945441458090611619, 140737488348222, 140737488348223, 140737277812896, 140737162405632, -1945482925033188445, -1945425585873677405}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#6  0x00007ffff29aca4f in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 2 (Thread 0x7fffed127700 (LWP 20480)):
#0  0x00007ffff29a2a5d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff370f841 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#2  0x00007ffff370f94c in g_main_context_iteration ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff370f991 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff37360f5 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6872519 in start_thread (arg=0x7fffed127700)
    at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffed127700
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140737170798336, 1945441458090611619, 140737488347870, 140737488347871, 140737277812896, 140737170798336, -1945481826058431581, -1945425585873677405}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#6  0x00007ffff29aca4f in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 1 (Thread 0x7ffff7fa9480 (LWP 20479)):
#0  0x00007ffff36ea475 in g_bytes_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ffff3749df1 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#2  0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff3749da4 in g_variant_unref ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff3749e61 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff3749da4 in g_variant_unref ()
---Type <return> to continue, or q <return> to quit---
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff3cf2978 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#19 0x00007ffff39ec3a2 in g_object_unref ()
    at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff3cee0bf in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#21 0x00007ffff3cb9ad9 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#22 0x00007ffff3cb9b19 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#23 0x00007ffff370f525 in g_main_context_dispatch ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007ffff370f8c8 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007ffff370fbd2 in g_main_loop_run ()
    at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007ffff5d4c1d5 in gtk_main ()
    at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#27 0x00005555555777fb in main (argc=<optimized out>, argv=<optimized out>)
    at main.c:172
        desktopfile = <optimized out>
        context = <optimized out>
        error = 0x0
(gdb) 
muktupavels commented 6 years ago

I fail to see how this stacktrace helps...

joakim-tjernlund commented 6 years ago

Second problem also is related to incorrect GVariant / property type. Here was mentioned TeamViewer and stacktrace shows crash in sn_tooltip_new. At least in TeamViewer case they are incorrectly setting tooltip. For some reason they have decided to use simple string as tooltip property while it should have (sa(iiay)ss)

Any chance MATE can catch these errors an log/reject them? Much better than SEGVs ...

muktupavels commented 6 years ago

Pull request for calibre: https://github.com/kovidgoyal/calibre/pull/797

lukefromdc commented 6 years ago

I could not see much in that stacktrace but posted it anyway in case someone else found it useful. Anyway. https://github.com/kovidgoyal/calibre/pull/797 just got merged into Calibre, which should put an end to that issue and invalidates the previous tests of it.

lukefromdc commented 6 years ago

The calibre issue is now fixed by https://github.com/kovidgoyal/calibre/pull/797 , I just tested it by directly replacing the two changed .py files in the package, and it now works fine in the tray.

So, is this issue specifically the issue of the panel segfaulting on Calibre starting in tray, or a more general issue that the status-notifier can be made to segfault? If it is the former it can be closed as Calibre itself has been fixed and is now waiting only for a new release and distros to pick it up.

alexarnaud commented 6 years ago

Le 29/12/2017 à 19:57, lukefromdc a écrit :

So, is this issue specifically the issue of the panel segfaulting on Calibre starting in tray, or a more general issue that the status-notifier can be made to segfault? If it is the former it can be closed as Calibre itself has been fixed and is now waiting only for a new release and distros to pick it up.

If Mate panel segfault in this particular case it could be useful to have a sanity check to avoid that. Maybe the issue could appear on an other app in the future.

Best regards. -- Alex ARNAUD Visual-Impairment Project Manager Hypra - "Humanizing technology"

joakim-tjernlund commented 6 years ago

If Mate panel segfault in this particular case it could be useful to have a sanity check to avoid that. Maybe the issue could appear on an other app in the future.

There is already another app causing SEGV, Teamviewer. Some sanitycheck to avoid SEGV is needed, maybe even try correct faulty format strings like the one in Calibre.

oblongau commented 6 years ago

Confirming that Calibre 3.15 in Linux Mint 18.3 64 bit MATE now works correctly. No error messages, and a Calibre icon now appears in the tray. Thanks to all who helped.

monsta commented 6 years ago

We surely should not crash on external data, though I wonder whether it's logic problems in the SNI code, or it's GVariant just being error-prone.

monsta commented 6 years ago

I see that g_variant_get function is good at printing "critical error" messages, but it has neither a return value nor an output GError argument.

muktupavels commented 6 years ago

https://developer.gnome.org/glib/stable/glib-GVariant.html#g-variant-get

The arguments that are expected by this function are entirely determined by format_string . format_string also restricts the permissible types of value . It is an error to give a value with an incompatible type. See the section on GVariant format strings. Please note that the syntax of the format string is very likely to be extended in the future.

muktupavels commented 6 years ago

https://git.gnome.org/browse/gnome-panel/log/?qt=grep&q=status-notifier

monsta commented 6 years ago

I don't mind that it's an error, just saying that the function could at least tell me about it.

Ok, I see your commits, will try them.

monsta commented 6 years ago

@oblongau @joakim-tjernlund Ok, https://github.com/mate-desktop/mate-panel/pull/709 should fix both types of crashes