Dunst: Crash when Google Chrome gains focus

Created on 15 Jan 2019  Â·  8Comments  Â·  Source: dunst-project/dunst

When I run Dunst and focus a Google Chrome window, Dunst crashes. wat

The error that Dunst prints before exiting:

$ dunst
X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  17 (X_GetAtomName)
  Atom id in failed request:  0x0
  Serial number of failed request:  1669
  Current serial number in output stream:  1669
$ dunst
X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  17 (X_GetAtomName)
  Atom id in failed request:  0x0
  Serial number of failed request:  289
  Current serial number in output stream:  289
$ dunst
X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  17 (X_GetAtomName)
  Atom id in failed request:  0x0
  Serial number of failed request:  92
  Current serial number in output stream:  92

If I use -verbosity debug, I get these three lines as well before each crash:

DEBUG: RUN
DEBUG: XEvent: Ignoring '65'
DEBUG: XEvent: Checking for active screen changes

Installation info

  • Version: v1.3.2-334-gfb2904767 (also reproducible on v1.3.2-281-gc562c6441)
  • Install type: manually from git
  • Distro and version: Ubuntu 18.04
Bug

All 8 comments

I suspect the error in:

https://github.com/dunst-project/dunst/blob/8579b3ed6bd3331e4cf6626e6f6423a166252117/src/x11/screen.c#L257-L269

 Atom id in failed request:  0x0

I guess, there should be another boundary check, because we're passing a NULL string as the atom name. This ain't good.


Distro and version: Ubuntu 18.04

Do you have any special modifications on your system? How did you install chrome?

Do you have any special modifications on your system? How did you install chrome?

I'm using i3 (installed from their repository) rather than GNOME; I don't think I've changed anything in a big way apart from that. I installed Chrome from the official deb package.

I should have mentioned it's Chrome Dev, not Chrome Stable – maybe a recent update introduced something in Chrome that's not behaving properly.

It looks like it is something in Chrome Dev – this doesn't happen if I focus a Chrome Stable window. I'm using Chrome 73.0.3664.3.

With that commit, I get this when Chrome gains focus:

$ ./dunst 
WARNING: testing bad atoms
WARNING: n_items: 1
WARNING: testing bad atoms
WARNING: n_items: 2
BadAtom (invalid Atom parameter)

@anowlcalledjosh Can you please test the commit 874e0ef ? Thanks in advance. If it fixes your behavior, I can create a PR for it and it's fixed ;-)

Apparently it's fixed now without any code changes – I can't get dunst to crash by giving Chrome focus even on an older commit... I have no idea what was causing the error that has changed in the last day, sorry!

That commit doesn't seem to break anything, though :)

Right, I managed to reproduce it again – that commit (874e0efe8544ed5033b504cade40414d77f8e93e) consistently fixes it.

Ok, so I've created a PR #593. @anowlcalledjosh Could you do me a favor and test the PR please? Thanks in advance.

Tested it, it works fine. Thank you for the fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

meribold picture meribold  Â·  5Comments

progandy picture progandy  Â·  4Comments

atomheartother picture atomheartother  Â·  6Comments

Kaligule picture Kaligule  Â·  5Comments

chronus7 picture chronus7  Â·  5Comments