Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification daemon crashes when monitor is removed. #200

Open
canoon opened this issue Jun 10, 2021 · 13 comments
Open

Notification daemon crashes when monitor is removed. #200

canoon opened this issue Jun 10, 2021 · 13 comments

Comments

@canoon
Copy link

canoon commented Jun 10, 2021

Expected behaviour

Not to crash

Actual behaviour

mate-notification-daemon crashes with version 1.24.2, with version 1.25.1 just this message is printed out

(mate-notification-daemon:182258): Gdk-CRITICAL **: 18:15:29.829: gdk_monitor_get_display: assertion 'GDK_IS_MONITOR (monitor)' failed

(mate-notification-daemon:182258): Gdk-CRITICAL **: 18:15:29.829: gdk_display_get_n_monitors: assertion 'GDK_IS_DISPLAY (display)' failed

Which I believe still indicates a bug

Steps to reproduce the behaviour

  1. Open up Notification Settings
  2. Set monitor to the highest monitor.
  3. Disconnect a monitor
  4. Preview notification
  5. Daemon will crash and a timeout "Error while displaying notification: Error calling StartServiceByName for org.freedesktop.Notifications: Timeout was reached" or I also as above the GDK assertions.

MATE general version

1.24.1

Package version

1.24.2
Also tried with 1.25.1

Linux Distribution

Arch Linux

Link to bugreport of your Distribution (requirement)

I can raise it if you like but it looks definitively like an upstream issue I suspect this line here should check also if monitor_id is NULL.

This is running with mate-notification-daemon-1.24.2.tar.xz

-> % G_DEBUG=fatal-criticals gdb /usr/lib/mate-notification-daemon/mate-notification-daemon 
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/mate-notification-daemon/mate-notification-daemon...
(gdb) run
Starting program: /usr/lib/mate-notification-daemon/mate-notification-daemon 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff5c01640 (LWP 194523)]
[New Thread 0x7ffff5400640 (LWP 194524)]
[New Thread 0x7ffff4b69640 (LWP 194525)]
[New Thread 0x7fffe7fff640 (LWP 194526)]

(mate-notification-daemon:194519): Gdk-CRITICAL **: 18:57:50.148: gdk_monitor_get_display: assertion 'GDK_IS_MONITOR (monitor)' failed

Thread 1 "mate-notificati" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff73672e3 in g_logv () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0  0x00007ffff73672e3 in g_logv () at /usr/lib/libglib-2.0.so.0
#1  0x00007ffff7367560 in g_log () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff76f8723 in gdk_monitor_get_display () at /usr/lib/libgdk-3.so.0
#3  0x000055555555ece2 in _gtk_get_monitor_num (monitor=0x0) at daemon.c:281
#4  notify_daemon_notify_handler
    (object=0x5555557788c0, invocation=0x55555576d200, app_name=<optimized out>, id=<optimized out>, icon=0x5555557aa470 "dialog-information", summary=<optimized out>, body=0x555555684040 "Just a test", actions=0x5555557aa4b0, hints=0x7fffe800ec90, timeout=-1, user_data=0x5555557d76b0) at daemon.c:1537
#5  0x00007ffff6631acd in  () at /usr/lib/libffi.so.7
#6  0x00007ffff663103a in  () at /usr/lib/libffi.so.7
#7  0x00007ffff7458d4e in g_cclosure_marshal_generic () at /usr/lib/libgobject-2.0.so.0
#8  0x00007ffff7452ddf in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#9  0x00007ffff747bfbd in  () at /usr/lib/libgobject-2.0.so.0
#10 0x000055555555cd27 in _notify_daemon_notifications_skeleton_handle_method_call
    (connection=<optimized out>, sender=<optimized out>, object_path=<optimized out>, interface_name=0x7fffe8010380 "org.freedesktop.Notifications", method_name=0x7fffe800efa0 "Notify", parameters=<optimized out>, invocation=0x55555576d200, user_data=0x5555557788c0) at mnd-dbus-generated.c:1737
#11 0x00007ffff75ab91d in  () at /usr/lib/libgio-2.0.so.0
#12 0x00007ffff75911ad in  () at /usr/lib/libgio-2.0.so.0
#13 0x00007ffff735ef30 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff73b2b59 in  () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff735e593 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#16 0x00007ffff797561f in gtk_main () at /usr/lib/libgtk-3.so.0
#17 0x000055555555b0b2 in main (argc=<optimized out>, argv=<optimized out>) at mnd-daemon.c:88

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@lukefromdc
Copy link
Member

While using the control center's "popup notifications" applet and keeping a preview notification showing, neither turning off nor removing my secondary monitor affected the notification. Were you displaying the notification on the monitor that was being removed by any chance? I was not

@canoon
Copy link
Author

canoon commented Jun 25, 2021

Yeah I had set the monitor to one that was disconnected.

@lukefromdc
Copy link
Member

If I move the notification to the secondary monitor, it does indeed disappear rather than move to the primary monitor if I disconnect the secondary monitor, though a terminal running mate-notification-properties to invoke it does not catch any error messages. Not sure where you are seeing those. Anyway, removing a monitor should move the notification to the remaining monitor as everything else moves over

@canoon
Copy link
Author

canoon commented Jun 25, 2021

Those messages are from mate-notification-daemon not mate-notification-properties. I was originally just seeing them in ~/.local/share/sddm/xorg-session.log but obviously that depends on what display manager you are using.

@lukefromdc
Copy link
Member

I don't have sddm as window manager, didn't get t anything like that error in .xsession-errors so not sure if its the same. Different WMs might respond differently to a monitor being removed

@canoon
Copy link
Author

canoon commented Jun 25, 2021

I can't exactly explain why it's changed now but I'm getting the error out of journalctl -f now. It seems like it's now run from dbus???.

-> % sudo journalctl -f
-- Journal begins at Tue 2020-12-15 21:17:59 AEDT. --
[snip]
Jun 25 13:50:28 canoon mate-notificati[188948]: gdk_monitor_get_display: assertion 'GDK_IS_MONITOR (monitor)' failed
Jun 25 13:50:28 canoon mate-notificati[188948]: gdk_display_get_n_monitors: assertion 'GDK_IS_DISPLAY (display)' failed
Jun 25 13:50:28 canoon mate-notificati[188948]: gdk_monitor_get_display: assertion 'GDK_IS_MONITOR (monitor)' failed
Jun 25 13:50:28 canoon mate-notificati[188948]: gdk_display_get_n_monitors: assertion 'GDK_IS_DISPLAY (display)' failed
Jun 25 13:50:28 canoon systemd-coredump[189009]: [🡕] Process 188948 (mate-notificati) of user 1000 dumped core.
                                                   
                                                   Stack trace of thread 188948:
                                                   #0  0x0000556e1d7d96ab n/a (mate-notification-daemon + 0xc6ab)
                                                   #1  0x0000556e1d7d9f5b notify_stack_add_window (mate-notification-daemon + 0xcf5b)
                                                   #2  0x0000556e1d7d7d99 n/a (mate-notification-daemon + 0xad99)
                                                   #3  0x00007f5911603acd n/a (libffi.so.7 + 0x6acd)
                                                   #4  0x00007f591160303a n/a (libffi.so.7 + 0x603a)
                                                   #5  0x00007f5912414d4e g_cclosure_marshal_generic (libgobject-2.0.so.0 + 0x18d4e)
                                                   #6  0x00007f591240eddf g_closure_invoke (libgobject-2.0.so.0 + 0x12ddf)
                                                   #7  0x00007f5912437fbd n/a (libgobject-2.0.so.0 + 0x3bfbd)
                                                   #8  0x0000556e1d7d5d37 n/a (mate-notification-daemon + 0x8d37)
                                                   #9  0x00007f591256791d n/a (libgio-2.0.so.0 + 0x11191d)
                                                   #10 0x00007f591254d1ad n/a (libgio-2.0.so.0 + 0xf71ad)
                                                   #11 0x00007f591231af30 g_main_context_dispatch (libglib-2.0.so.0 + 0x53f30)
                                                   #12 0x00007f591236eb59 n/a (libglib-2.0.so.0 + 0xa7b59)
                                                   #13 0x00007f591231a593 g_main_loop_run (libglib-2.0.so.0 + 0x53593)
                                                   #14 0x00007f591293212f gtk_main (libgtk-3.so.0 + 0x1da12f)
                                                   #15 0x0000556e1d7d40b2 main (mate-notification-daemon + 0x70b2)
                                                   #16 0x00007f5911fe1b25 __libc_start_main (libc.so.6 + 0x27b25)
                                                   #17 0x0000556e1d7d415e _start (mate-notification-daemon + 0x715e)
                                                   
                                                   Stack trace of thread 188950:
                                                   #0  0x00007f59120adb2f __poll (libc.so.6 + 0xf3b2f)
                                                   #1  0x00007f591236eae8 n/a (libglib-2.0.so.0 + 0xa7ae8)
                                                   #2  0x00007f591231a593 g_main_loop_run (libglib-2.0.so.0 + 0x53593)
                                                   #3  0x00007f59125585b8 n/a (libgio-2.0.so.0 + 0x1025b8)
                                                   #4  0x00007f59123490c1 n/a (libglib-2.0.so.0 + 0x820c1)
                                                   #5  0x00007f59118b1259 start_thread (libpthread.so.0 + 0x9259)
                                                   #6  0x00007f59120b85e3 __clone (libc.so.6 + 0xfe5e3)
                                                   
                                                   Stack trace of thread 188951:
                                                   #0  0x00007f59120adb2f __poll (libc.so.6 + 0xf3b2f)
                                                   #1  0x00007f591236eae8 n/a (libglib-2.0.so.0 + 0xa7ae8)
                                                   #2  0x00007f5912318781 g_main_context_iteration (libglib-2.0.so.0 + 0x51781)
                                                   #3  0x00007f5912f65ebe n/a (libdconfsettings.so + 0x5ebe)
                                                   #4  0x00007f59123490c1 n/a (libglib-2.0.so.0 + 0x820c1)
                                                   #5  0x00007f59118b1259 start_thread (libpthread.so.0 + 0x9259)
                                                   #6  0x00007f59120b85e3 __clone (libc.so.6 + 0xfe5e3)
                                                   
                                                   Stack trace of thread 188949:
                                                   #0  0x00007f59120adb2f __poll (libc.so.6 + 0xf3b2f)
                                                   #1  0x00007f591236eae8 n/a (libglib-2.0.so.0 + 0xa7ae8)
                                                   #2  0x00007f5912318781 g_main_context_iteration (libglib-2.0.so.0 + 0x51781)
                                                   #3  0x00007f59123187d2 n/a (libglib-2.0.so.0 + 0x517d2)
                                                   #4  0x00007f59123490c1 n/a (libglib-2.0.so.0 + 0x820c1)
                                                   #5  0x00007f59118b1259 start_thread (libpthread.so.0 + 0x9259)
                                                   #6  0x00007f59120b85e3 __clone (libc.so.6 + 0xfe5e3)
                                                   
                                                   Stack trace of thread 188952:
                                                   #0  0x00007f59120b318d syscall (libc.so.6 + 0xf918d)
                                                   #1  0x00007f591236906b g_cond_wait_until (libglib-2.0.so.0 + 0xa206b)
                                                   #2  0x00007f59122ea8b3 n/a (libglib-2.0.so.0 + 0x238b3)
                                                   #3  0x00007f59122eaa44 g_async_queue_timeout_pop (libglib-2.0.so.0 + 0x23a44)
                                                   #4  0x00007f591234bd2a n/a (libglib-2.0.so.0 + 0x84d2a)
                                                   #5  0x00007f59123490c1 n/a (libglib-2.0.so.0 + 0x820c1)
                                                   #6  0x00007f59118b1259 start_thread (libpthread.so.0 + 0x9259)
                                                   #7  0x00007f59120b85e3 __clone (libc.so.6 + 0xfe5e3)

Edit: Just to clarify sddm is a display manager afaik I'm just using whatever mate has by default as a wm.

@lukefromdc
Copy link
Member

I didn't find any of this in journalctl on my system, in fact outputting it to a file, opening that in Pluma and searching for 'gdk_display_get_n_monitors' returned no matches at all

@canoon
Copy link
Author

canoon commented Jun 25, 2021

Weird. Thanks heaps for looking into it anyway. Out of curiosity what are you running?

@lukefromdc
Copy link
Member

Debian Unstable, rather hacked. Local builds all of MATE, compiz, the kernel, and some security stuff

@ghost
Copy link

ghost commented Dec 26, 2021

@lukefromdc

While using the control center's "popup notifications" applet and keeping a preview notification showing, neither turning off nor removing my secondary monitor affected the notification. Were you displaying the notification on the monitor that was being removed by any chance? I was not

Thank you! I've been struggling for a few days with my broken notifications which worked when second monitor was connected but not when disconnected. Your comment was a great hint.
With second monitor disconnected I opened Ubuntu's Popup Notifications and checked "Use Active Monitor" -> then "Preview" -> it worked (a notification showed up). Without this options checked I encountered the following error message:
gdbus.error.freedesktop.dbus.error.noreply: message recipient disconnected from message bus without replying

I was using my second monitor as primary and "Use Active Monitor" checkbox unchecked because I wanted notifications to show up on this second screen. Notification manager probably remembered this even though I disconnected second monitor. However it should not because when no external monitors are plugged in then the laptop's screen should be a primary monitor.

Thank you, I've just wanted to share my problem and solution in case somebody will have the same problem in the future.

@lukefromdc
Copy link
Member

lukefromdc commented Dec 26, 2021 via email

@stephematician
Copy link

I'm slightly unclear as to whether this has been solved. I encountered this same problem when I disconnected an external monitor:

  1. Connect external monitor, set it to the primary display.
  2. Disconnect external monitor.
  3. Notification daemon crashes when a notification is sent.

I prompted a notification by connecting or disconnecting a bluetooth device. I'll try the 'popup notification' Preview when I'm next at my workstation.

@stephematician
Copy link

I have tried a number of different sequences, but I cannot reliably cause the daemon to crash when I disconnect the external monitor. However it does crash when monitors are connected and disconnected, e.g. sometimes it crashes when:

  1. Both displays connected.
  2. Open Popup Notifications in the external display.
  3. Select "Use Active Monitor".
  4. Click "Preview".
  5. Disconnect monitor while notification is present.

The notification will disappear and the daemon will have crashed.

I have also experienced a crash when after (5) I also try to close the notification - at which time the notification will freeze for a moment (not close) and then the daemon crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants