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

segfault when receiving notifications while screen is off (Wayland) #888

Closed
9ary opened this issue Jul 2, 2021 · 14 comments · Fixed by #930
Closed

segfault when receiving notifications while screen is off (Wayland) #888

9ary opened this issue Jul 2, 2021 · 14 comments · Fixed by #930

Comments

@9ary
Copy link

9ary commented Jul 2, 2021

I use a DisplayPort monitor. These have the peculiar behavior of "disappearing" when they are turned off, as if you had unplugged the cable.

Consistent repro:

  • start dunst in a terminal to catch the crash
  • turn monitor off (or unplug it)
  • send a notification with notify-send or something else
  • turn monitor back on
  • dunst has crashed

Installation info

  • Version: Dunst - A customizable and lightweight notification-daemon 1.6.1 (2021-02-21)
  • Install type: package
  • Distro and version: Arch Linux (up to date)
  • Wayland compositor: sway 1.6
@fwsmit
Copy link
Member

fwsmit commented Jul 2, 2021

Could you send the dunst debug logs?

@fwsmit fwsmit added the Bug label Jul 2, 2021
@9ary
Copy link
Author

9ary commented Jul 2, 2021

It doesn't print anything at all, other than WARNING: No icon found in path: 'dialog-information', even after setting verbosity = debug. Am I missing something?

@9ary
Copy link
Author

9ary commented Jul 2, 2021

Nevermind, here it is: https://wank.party/Woc8.log

@fwsmit
Copy link
Member

fwsmit commented Jul 3, 2021

I think it's related to #877

@fwsmit
Copy link
Member

fwsmit commented Jul 3, 2021

@9ary I don't see any segfault in the logs. Maybe you didn't pipe the errors to the log file. Hint: dunst -verbosity debug > crash.log 2>&1

@9ary
Copy link
Author

9ary commented Jul 3, 2021

There was nothing on stderr, just the standard segfault message which would be at the very end.

@fwsmit
Copy link
Member

fwsmit commented Jul 3, 2021

What does the segfault message say?

@9ary
Copy link
Author

9ary commented Jul 3, 2021

Seems like even redirecting stderr doesn't push that message to the log file. This is the message:

zsh: segmentation fault (core dumped)  dunst -verbosity debug > dunst.log 2>&1

Here's another log for completeness: https://wank.party/YimJ.log

@fwsmit
Copy link
Member

fwsmit commented Jul 3, 2021

Thank you, I can reproduce it. What's probably happening is that when the monitor is off, dunst tries to create a window. That window is for some reason destroyed by the compositor. After that dunst comes in an infinite loop of requesting new windows (this is a know bug, see #877).
It should be possible to create a window when the monitor is off, though, so this is still a separate issue from #877.

@WhitePeter
Copy link
Contributor

WhitePeter commented Sep 18, 2021

May I suggest a workaround?

dunstctl set-paused true or sending SIGUSR1 to the dunst process pauses processing of notification sending and queues the notifications until resumed by either dunstctl set-paused false or SIGUSR2. If you can hook this to turning off/on the monitor, then dunst should not segfault, when it is off, because it should wait until it is back on.

See MISCELLANEOUS in dunst(1) for reference.

@WhitePeter
Copy link
Contributor

It should be possible to create a window when the monitor is off, though, so this is still a separate issue from #877.

I cannot reproduce this, because I do not have a DP monitor to test it with but @9ary said that it disappears entirely. When I send a notification while the display of my laptop is off, without suspending dunst, it does not crash.

BTW, it is good practice to pause dunst while the display is off or the session is suspended/locked because one might lose notifications otherwise, i.e.:
{sleep 5; notify-send -t 5000 Test}& loginctl lock-session
Wait more than 10 seconds and the notification is gone.

@9ary
Copy link
Author

9ary commented Sep 18, 2021

May I suggest a workaround?

dunstctl set-paused true or sending SIGUSR1 to the dunst process pauses processing of notification sending and queues the notifications until resumed by either dunstctl set-paused false or SIGUSR2. If you can hook this to turning off/on the monitor, then dunst should not segfault, when it is off, because it should wait until it is back on.

See MISCELLANEOUS in dunst(1) for reference.

That's not a bad idea actually, should be easy to do with kanshi. I think it might be a good idea to have this as an option in dunst.

@fwsmit
Copy link
Member

fwsmit commented Oct 4, 2021

@9ary I've added a fix for this crash. My method of reproducing was:
swaymsg output "*" disable && sleep 1 && notify-send "Crash Dunst" && sleep 1 && kanshi
Now dunst doesn't crash anymore from that.

@9ary
Copy link
Author

9ary commented Oct 4, 2021

Thanks, I'll try it out when I get the chance.

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

Successfully merging a pull request may close this issue.

3 participants