SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

[Bug] Crash when a new notification is sent

Open zjeffer opened this issue 1 year ago • 6 comments

Describe the bug Segfaults when a notification is sent.

To Reproduce Steps to reproduce the behavior:

  1. Run swaync
  2. Send a notification (I did it by running spotify and going to the next song)

I also managed to reproduce it by simply running notify-send hello, but the below logs and backtraces are created with a spotify notification.

Expected behavior It shows the notification without crashing.

Please provide logs if you're experiencing notification errors / bugs gdb backtrace when built from source with G_MESSAGES_DEBUG=all: https://gist.github.com/zjeffer/45bc48dd7c7e5550655f18b2e9d82f84,

Desktop (please complete the following information):

  • OS: Arch Linux (Kernel 6.9.5-arch1-1)
  • WM: Hyprland (4168b8c17b12b90873fab1ca73c2981b53f48bf5)
  • glib2 2.80.3-2
  • libnotify 0.8.3-1

It happens with both the swaync-git AUR package and building from source.

zjeffer avatar Jun 26 '24 20:06 zjeffer

Seems like a GTK 3 issue? I'm running a later version on my machine, and it runs just fine. Try rebuilding?

ErikReider avatar Jul 28 '24 13:07 ErikReider

Still happening after recompiling latest git commit.

My installed versions of GTK (all installed through pacman)

  • gtk2 2.24.33
  • gtk3 3.24.43
  • gtk4 4.14.4

Which GTK3 version are you using?

zjeffer avatar Jul 28 '24 13:07 zjeffer

Hmm, the same versions… It segfaults when constructing the notification for some reason...

ErikReider avatar Jul 28 '24 13:07 ErikReider

Yeah, seems to happen somewhere in the HdyCarousel object deep in GTK, where at some point the widget is a nullptr. I'm not familiar with Vala or GTK so I haven't really been able to figure out where exactly it goes wrong.

zjeffer avatar Jul 28 '24 14:07 zjeffer

When you run swaync with G_MESSAGES_DEBUG=all, what do you get as output when a new notification is sent? This is mine when I execute notify-send hello:

** (swaync:953129): DEBUG: 17:05:15.898: notiDaemon.vala:171: Notification: 
category:		(null)
image_data:		false
expire_timeout:		-1
replaces_id:		0
desktop_entry:		(null)
body:			
app_icon:		
action_icons:		false
time:			1722179115
hints:		
	sender-pid: int64 953250
	urgency: byte 0x01
applied_id:		1
image_path:		(null)
inline-reply:		(null)
app_name:		notify-send
summary:		hello
icon_data:		false
resident:		false
default_action:		(null)
actions:		
urgency:		Normal

[1]    953129 segmentation fault (core dumped) G_MESSAGES_DEBUG=all ./build/src/swaync

zjeffer avatar Jul 28 '24 15:07 zjeffer

This is still happening btw :cry:

zjeffer avatar Oct 08 '24 18:10 zjeffer

I notice it doesn't happen on my work laptop, which is also running Hyprland (on Ubuntu). I'll investigate what's different about my personal laptop to see why it's happening.

zjeffer avatar Dec 19 '24 15:12 zjeffer

Found it: I had an older version of gtk installed in /usr/local/lib/. Deleting all libgtk*.so* and libgdk*.so* files fixed the issue.

I found it by running swaync through gdb, making the segfault happen by sending a notification, and then checking info sharedlibrary. It found:

0x00007ffff6a90fb0  0x00007ffff6ff1088  Yes         /usr/local/lib/libgtk-3.so.0
0x00007ffff68f3130  0x00007ffff69a80af  Yes         /usr/local/lib/libgdk-3.so.0

zjeffer avatar Dec 19 '24 17:12 zjeffer