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

From: Po Lu <[email-masked]>
Date: Mon, 22 May 2023 09:05:41 +0800

Thiago Melo <[email-masked]> writes:

> I'm happy to contribute, but I'm sorry that I might not have much time
> to do it right now. :(
>
> We can do it slowly, but just in case I'm not around, I'm leaving here
> one way to trigger this bug more automatically. After starting emacs
> (compiled with cairo-xcb) in daemon mode, the bug can be triggered via
> a shell script like this:
>
>
> ```
> # some elisp code to close all graphical frames
> ELISP="(mapcar (lambda (x) (when (frame-parameter x 'display)
> (delete-frame x))) (frame-list))"
>
> # repeatedly create graphical frames and close them all
> for k in $(seq 10); do
>     emacsclient -c -n -a /bin/false &&
>         sleep 1 &&
>         emacsclient -e "${ELISP}"
> done
> ```
>
>
> In any case, I'll reply you about the errors in the other message in
> this thread, if you don't mind.

I will try to look into this, thanks.

> The thing is, with an emacs daemon, after I close the last graphical
> frame, x_delete_terminal is always called and the display is always
> closed. It happens no matter if I build it with or without cairo, with
> errors or without errors.

Which X toolkit did you build Emacs with?