GNU bug report logs - #63589
29.0.91; crash after creating graphical frames via emacsclient when compiled with cairo-xcb

Previous Next

Package: emacs;

Reported by: Thiago Melo <tmdmelo <at> gmail.com>

Date: Fri, 19 May 2023 15:22:03 UTC

Severity: normal

Found in version 29.0.91

Full log


View this message in rfc822 format

From: Thiago Melo <tmdmelo <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 63589 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#63589: [PATCH] 29.0.91; crash after creating graphical frames via emacsclient when compiled with cairo-xcb
Date: Wed, 24 May 2023 14:16:20 +0000
[Message part 1 (text/plain, inline)]
> I thought I explained what the problems with trying to fix this in Emacs
> are.  The first is: there's a reference leak in Cairo somewhere, since
> Emacs never allows displays to be closed without each frame being
> destroyed, and destroying each frame will also dereference its Cairo
> surface; thus, it's not actually Emacs's problem.
[...]
> The other problem occurs when `cairo_xcb_surface_create' creates a
> different device from the one that was previously created for the
> display.  So you have only destroyed one of several devices, any one of
> which may rear its ugly head later.  This is also a bug in Cairo.
>
> BTW, it's not necessary to call XFreePixmap, as all resources created
> by the client will be destroyed per the close down mode set earlier.

Welp, I guess it means that all that remains is bringing up the issue
to the Cairo mailing list (again) and waiting for the problem to be
solved from their side. I'm afraid they might just say that Emacs is
"holding it wrong". :(

By the way, I wrote a minimal standalone cairo-xcb c program (see
attached) to trigger this particular bug. It opens a small window via
xcb, draws something via cairo, destroys the window and closes the
display when any key or mouse button is pressed on it, then recreates
everything again... And it repeats until it crashes (Hopefully. At
lest it crashes in my system). Redrawing errors also happen during the
process. It might be an useful example to bring to the Cairo mailing
list and to debug the root of this issue.

Thanks for everything you taught me, Po Lu.
[cairo-xcb-bug.c (text/x-csrc, attachment)]

This bug report was last modified 2 years and 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.