GNU Emacs crashes when iconified #emacs #fvwm

🕥︎ - 2011-10-12

After installing a new emacs-snapshot package, suddenly Emacs started crashing when I iconified a window and moved the mouse over it.

The output in the terminal said something about an X Error, BadMatch and 42, which a quick search turned up was X_SetInputFocus().

I reported the problem on the emacs-devel mailing list, and also sent an inquiry to the gtk-list.

(I even tried shooting of a message to the fvwm mailing list, but it is probably awaiting moderator approval, as I didn't think to subscribe first.)

Then I dug around a little in the gtk sourcecode. It looks like gtk means to catch these errors, and that gtk2 succeeded while gtk3 doesn't. I can't tell why.

So I turned to the Emacs source code and tried discarding those error events there instead.

This lead to a trivial follow up patch that "solves" the problem by making Emacs discard BadMatch errors from X_SetInputFocus directly.

I don't think it is the right solution, but hopefully someone will pick up the thing and say what is.

Update: Nobody has responded, so I have proceeded to build packages from Julien Danjou's packages with my trivial patch applied - available in my local .deb repository.

Update 2: Jan Djärv committed a fix.

Add comment

To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Twitter, Facebook, Google or even Microsoft GitHub.

I have chosen to use a more old school method of spam prevention.

To post a comment here, you need to:

¹ Such as Thunderbird, Pan, slrn, tin or Gnus (part of Emacs).

Or, you can fill in this form: