From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thiago Melo Newsgroups: gmane.emacs.bugs Subject: bug#63589: [PATCH] 29.0.91; crash after creating graphical frames via emacsclient when compiled with cairo-xcb Date: Sun, 21 May 2023 16:09:40 +0000 Message-ID: References: <871qj9246a.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26443"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63589@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 21 18:12:50 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0lft-0005tU-Hh for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 May 2023 18:12:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q0leE-0007cF-R7; Sun, 21 May 2023 12:11:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q0leD-0007c4-Ar for bug-gnu-emacs@gnu.org; Sun, 21 May 2023 12:11:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q0leD-0000Wx-2k for bug-gnu-emacs@gnu.org; Sun, 21 May 2023 12:11:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q0leA-0001OK-C6 for bug-gnu-emacs@gnu.org; Sun, 21 May 2023 12:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thiago Melo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 May 2023 16:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63589 X-GNU-PR-Package: emacs Original-Received: via spool by 63589-submit@debbugs.gnu.org id=B63589.16846854315310 (code B ref 63589); Sun, 21 May 2023 16:11:02 +0000 Original-Received: (at 63589) by debbugs.gnu.org; 21 May 2023 16:10:31 +0000 Original-Received: from localhost ([127.0.0.1]:60999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q0lde-0001NZ-Iy for submit@debbugs.gnu.org; Sun, 21 May 2023 12:10:30 -0400 Original-Received: from mail-yw1-f179.google.com ([209.85.128.179]:61722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q0lda-0001NI-9m for 63589@debbugs.gnu.org; Sun, 21 May 2023 12:10:29 -0400 Original-Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-563b1e5f701so19912947b3.3 for <63589@debbugs.gnu.org>; Sun, 21 May 2023 09:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684685417; x=1687277417; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=h+X3DXm3Opy02oO5m3ilAr7jSJ9UnwxCpnCYbdbcvd8=; b=a3nxm81hU35Ooi6+4B14y2wf2duJb7ZxkV1MjPl2n8iTc+Ea/CUwM553tW07xJP/1R VxknYbaWat9TpER4JcuP3HCyZ7rPZBIvsorkcvi9naicYA4nh/RJqao7mG6S1gMwTGBi s+NNVmuo6yGA0RhOl7ftUcy+cyw0aGmO/BRG2M3GX1TeY4wb0PwwXZhYWD89K6xkUPSU yJmAECbZeB6em5V5PS0VsbxCwVA/LzBE/9xaaTljKx0wTXrwyo+clDraqathUFmBvedO 1zymLBAhUjGAt27LHfNUsq1oVWEj6EdltJrBC2zs7R5wKYpXhvml34RuQ+kVOien9oFV lv6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684685417; x=1687277417; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=h+X3DXm3Opy02oO5m3ilAr7jSJ9UnwxCpnCYbdbcvd8=; b=TQ24dqr/sIvPnyDRbPp/AturUofGIsbW5SCsRG+lZ6ayaEKdORm1nsqUlPtrSUcZWa sCn01l3g7cWvGwFU5vEiMwnKNFJYK3w64mAmBNa+zS1wDt+Pq8MZ4rgQPtO+0d+yI6x7 M1x4bOJQ+Ry4t8yYEmUhBJQr6H0Bpcy1vgiwPA8GvdvPmNGrHnPircqwm8ZFyHpDCMzh moYPs5d17fZXA+5LtBFIOdFdPliLuCNlbf1BVGIdlFGNkQ2anLUrmLpM9+rzCH7lStLS VdrZ7nmhUwkmDkj1P5+W+a4VjM5t75OVNsJDHI1PoEz/J4dBzovL7mFPqvlQ9ezrNHYk va0g== X-Gm-Message-State: AC+VfDwNOqa95VRI9Sd+1q46nWJ/jJTJ7w7Y/A7iPwjfG/3PFniH1qH6 zu3gZMWurRRRP0jaZJvOhDQtiY3XR+2XRVruNGE= X-Google-Smtp-Source: ACHHUZ4YIf9JqBnVh8y3uldb4gh5C+3DR5U3B64OKToL46H0/i/m53KwJ3Twk2Sk72VEe5DocM/Ojm2c0A+Y7VTZ8l8= X-Received: by 2002:a81:7703:0:b0:561:79af:f7dd with SMTP id s3-20020a817703000000b0056179aff7ddmr9205430ywc.5.1684685416925; Sun, 21 May 2023 09:10:16 -0700 (PDT) In-Reply-To: <871qj9246a.fsf@yahoo.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262114 Archived-At: (sorry, forgot to hit reply all) > I would like to know the details of the X error that caused the display > connection to be closed in the first place 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. > this change is too large for > the release branch, but we may be able to fix the X error. No problem. At least, I wanted to point out one potential direction for the solution. By the way, I've done my FSF Copyright assignment already. > 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 Thank you, I'll keep it in mind. > and that the device should probably be destroyed even if > the display no longer exists It's puzzling, isn't it? The cairo dev also said it should be destroyed, but that sometimes it doesn't happen for cairo-xcb when (1) there's a leak somewhere or (2) during some non-leak cases they didn't specify. > which usually happens when > x_delete_terminal is called in response to an IO error. Here is one thing that I'd like to be clarified about: it seems to me that you don't expect the display to be closed, as you mentioned before: > However, > this crash happens when a display connection is closed, which is not > common in normal use. As the backtraces you attached show, an unrelated > X error is what caused a connection to be closed. 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. So I probably misunderstood something here, please do let me know if I did. Or these things only happens with my computer. I also would love to know if anyone else is able to replicate this issue.