Crashes if a well-known name's owner is discovered after it first appears
@wjt
Submitted by Will Thompson Assigned to Will Thompson @wjt
Description
This is easy to reproduce using dbus-monitor --pcap
:
dbus-monitor --pcap >/tmp/crash-bustle.pcap
bustle-pcap /tmp/bar.pcap
- Stop both monitors
- Open
/tmp/crash-bustle.pcap
in Bustle
bustle: internal error: OtherName (BusName "org.gtk.Notifications") in several apps: [(UniqueName (BusName ":1.19"),ApplicationInfo {aiColumn = CurrentColumn 645.0, aiCurrentNames = fromList [OtherName (BusName "org.freedesktop.Notifications"),OtherName (BusName "org.gnome.Caribou.Keyboard"),OtherName (BusName "org.gnome.Magnifier"),OtherName (BusName "org.gnome.Mutter.DisplayConfig"),OtherName (BusName "org.gnome.Mutter.IdleMonitor"),OtherName (BusName "org.gnome.Panel"),OtherName (BusName "org.gnome.ScreenSaver"),OtherName (BusName "org.gnome.Shell"),OtherName (BusName "org.gnome.Shell.Screencast"),OtherName (BusName "org.gnome.Shell.Screenshot"),OtherName (BusName "org.gnome.keyring.SystemPrompter"),OtherName (BusName "org.gtk.MountOperationHandler"),OtherName (BusName "org.gtk.Notifications")], aiEverNames = fromList [OtherName (BusName "org.freedesktop.Notifications"),OtherName (BusName "org.gnome.Caribou.Keyboard"),OtherName (BusName "org.gnome.Magnifier"),OtherName (BusName "org.gnome.Mutter.DisplayConfig"),OtherName (BusName "org.gnome.Mutter.IdleMonitor"),OtherName (BusName "org.gnome.Panel"),OtherName (BusName "org.gnome.ScreenSaver"),OtherName (BusName "org.gnome.Shell"),OtherName (BusName "org.gnome.Shell.Screencast"),OtherName (BusName "org.gnome.Shell.Screenshot"),OtherName (BusName "org.gnome.keyring.SystemPrompter"),OtherName (BusName "org.gtk.MountOperationHandler"),OtherName (BusName "org.gtk.Notifications")]}),(UniqueName (BusName ":fake.1"),ApplicationInfo {aiColumn = CurrentColumn 555.0, aiCurrentNames = fromList [OtherName (BusName "org.gtk.Notifications")], aiEverNames = fromList [OtherName (BusName "org.gtk.Notifications")]})]
What's going on here is that Bustle sees a message referencing org.gtk.Notifications, doesn't know who owns it, and makes something up (":fake.1"). Later, it sees the reply to GetNameOwner("org.gtk.Notifications") (called by bustle-pcap) -> :1.19. But org.gtk.Notifications already has an "owner" (the fake name) so Bustle panics.
This doesn't happen so easily if you use bustle-pcap, which calls ListNames / n × GetNameOwner immediately it starts, but I think it could still be made to happen if bustle-pcap loses the race between GetNameOwner and a name owner changing.