Subject: bug#63589: [PATCH] 29.0.91; crash after creating graphical frames via emacsclient when compiled with cairo-xcb

From: Po Lu <[email-masked]>
Date: Sun, 21 May 2023 21:40:45 +0800

Thiago Melo <[email-masked]> writes:

> Here's a patch to fix this issue. It was created on top of the
> emacs-29 branch, commit 6b60c81.
>
> It's based on the suggestion from the cairo mailing list (see the link
> I sent in my original message here). It ensures that the cairo device
> associated with the cairo-xcb surfaces in the display is destroyed
> before closing the display.
>
> It can probably be improved. It could even be extended to handle
> cairo-xlib. In the cairo mailing list, they mentioned one corner case
> where the xlib device is not properly destroyed: when cairo is
> unloaded before the X11 connection is closed.

I would like to know the details of the X error that caused the display
connection to be closed in the first place: this change is too large for
the release branch, but we may be able to fix the X error.

Also, please keep in mind that our policy is to place a space between
the function identifier and the opening paren of its parameter list in
function calls, and that the device should probably be destroyed even if
the display no longer exists, which usually happens when
x_delete_terminal is called in response to an IO error.