From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72517: 31.0.50; [PATCH] Close X connection upon deletion of last emacsclient frame Date: Thu, 08 Aug 2024 15:23:56 +0800 Message-ID: <87mslnmq9f.fsf@yahoo.com> References: <86mslnmvjo.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23346"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72517@debbugs.gnu.org, Thomas Fitzsimmons To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 08 09:24:57 2024 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 1sbxW4-0005rZ-QC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Aug 2024 09:24:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbxVm-0006Ae-7O; Thu, 08 Aug 2024 03:24:38 -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 1sbxVk-0006AO-La for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 03:24:36 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbxVk-0003IW-Bu for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 03:24:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=BA/XzxB0luxVLM4p1hFtI0vdjrBZILsXcSgG9hjA4xI=; b=b6eNOavycOZXkMHwnkoLHQIQiYISd8BLEKiGCb+WOttOP4j4UAztFAdtV138+WKi51seUnL+sGYBcv/vunYK00uBriX5AtjwCPm7bceds4hZIvWckqnzZZLazh8rFMhLiyhqOHCrckLk5dmnS6GC84LiEqnn6BJF6jewyQx4F2fq5cULToV+w1ABFEFcmaIntr09+GgMTkCROy4Z8sxlfV0WJ/bOOTv0pXKl0yk+gB1WvR9lRGeWMVnPd5vUFW+UOH+ehXLBgRnhAOmq/4enUOzYaLO+Vf+2wFxS3G3KuFICdmBRj1jx1MLm9S3GbinetqRSr5RyirM4R2LjTofCKw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbxWA-0001hK-Hu for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 03:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Aug 2024 07:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72517-submit@debbugs.gnu.org id=B72517.17231018846496 (code B ref 72517); Thu, 08 Aug 2024 07:25:02 +0000 Original-Received: (at 72517) by debbugs.gnu.org; 8 Aug 2024 07:24:44 +0000 Original-Received: from localhost ([127.0.0.1]:35430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbxVr-0001gh-Rv for submit@debbugs.gnu.org; Thu, 08 Aug 2024 03:24:44 -0400 Original-Received: from sonic302-20.consmr.mail.ne1.yahoo.com ([66.163.186.146]:38005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbxVp-0001gT-8A for 72517@debbugs.gnu.org; Thu, 08 Aug 2024 03:24:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1723101849; bh=BA/XzxB0luxVLM4p1hFtI0vdjrBZILsXcSgG9hjA4xI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=q4Y5udVG5xnCqqtncuGq3s/GQ4kx4layATHNfDFEWfEgCctaKswEXbhGOHZCdBI1VSIsQeqXLW6nZ5fYKzIJa4yor1IWbg1u2OyJL0CKl42dgRfAvdOBwCfFF0k9W0jPisIyFf4mIiKNHgWHfkql4b3wI4o1nSb7j39XdUy73rVSfMrWUSgal1A7pHj/05QAn6HI+iLlio7V5+pNgiiGH8hNbVqmuxtd69bHyk708ZkKn63QCif98IfRcz68/h5CQL2CYrbN5UyZW1uDLj/yOi2mcFijwHjPmvkQD1nsH2JtKtzoWFkchRZ+3Mu/7KxkKtV4fNuXpewSu56gsXbVyw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1723101849; bh=FCZ7t1myza1pDPzGKV/q32ipxIX7RY0HmKrEKmXwr1Y=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=D9lMwp2qJp4qgNpxa4XHviMog/zdVQY285SKbSPJiJZ8NurKhcpZGnwf4gxx2U+Q3gwK2Go/aC5/RNXxEfOKCsV+wseV+UjeQXZa+Fdrq5hV5RVtaZDDxnrN7kHi1qEUd7r5oBKstn81OZmPo0h9G2mbvzYRL6Itrdg9VcewHH01a7pq5tYBIg+RzsMSfnzUrXMuvGLHcts9ojpEhxTY7fKPG7z1nUA6b624tNN0jIcr4udf07K4unj5//kRwMqPTLnOC87q/hQaJdr/9vQxW0weEfu3Oyg+cZiaUmPy1GvpV5oaCYKttIRc7yE+qh5DA/fRpeVxfXsma2q/nOtC/Q== X-YMail-OSG: Bl_vG7YVM1lbWYbLJyTJ5GLT_9dyZfOcdwxOPqbL80pw81fZaALvlvFmwe7RFzJ K7FOMTP5fK1odsMdVglavnhGRatbiIGVXNv5Jru4eUlFh1sRtMwR.p9Prj6SqpaVK53Z2KX0gIPo bjt80S1DMSTmqokda7TQ9vTvDcf.gpQuGqRMKod_IC_ywhN_u.uxoONP7MF6SQ3_B23kmHXCAHVR WmsAkv8oGLLBkZj.HJmGCHXWA2vVVldQEphjNZhDU45xFAtKl6Shl_6XugsWgYVCUbdn93A0fLYF ytdoUL8y_tr7ib0gSIFqJ.QJCgizkkvMnT4d21k01sG4dbdzTZikBsIvT1NrOEHPI61LMU6R7sgm Q8Y3zCGiOCjavUH.VFz0iMqPTj_uQY7.0Lb9_4TulC3XVxxhZ7qA3bhpHtEYD8UoyCaJ0MU0pgPd fAWYOhXlpJ9VOjAkmUZxv5xu4jnLrUuURlu7kmWDeKvKLG7MFo7obqy_KNfZde1Zzw4CeDaj1u3z q4GjaFzLDvwDHqqbIqdqLeoCJ2ASm.Jg1LLrZddKItvR5WblVlTOzDHB9yLBPNUtWGACM3nL_uql nyemHDe9A6JO2t5TCv31GDix5VDCZKfQnGmOs7iJ0jM9wXRcB45g6AINa7MaxNg8KrhBOC1uWqDI tXD5WTr4xdBHKy490lNLzuCfa82ZHmXRZaAnQyYZrjm2DsBsjKANdiMx_esJwhukbTwNmyns0PNz SY1d7oezXH_rDlCLDBOxISc0ssir1jY1g4btWbVo5X1skKMXP.XvtNwbbVkyk8EeXASRmtWpQxRd itCjufIAfMpy4e__Enu_a6RJN2ofMVD1sPKJjscXuh X-Sonic-MF: X-Sonic-ID: b4672962-da09-4574-bff1-3b307646cd2e Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Thu, 8 Aug 2024 07:24:09 +0000 Original-Received: by hermes--production-sg3-fc85cddf6-gmtjx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID e8e42c87f18d8abf3d1fc32367bf7405; Thu, 08 Aug 2024 07:24:04 +0000 (UTC) In-Reply-To: <86mslnmvjo.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 08 Aug 2024 08:29:47 +0300") X-Mailer: WebService/1.1.22544 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:289921 Archived-At: Eli Zaretskii writes: >> From: Thomas Fitzsimmons >> Date: Wed, 07 Aug 2024 20:47:48 -0400 >> >> The attached patch fixes an issue reported on the mailing list [1]. >> After quitting a remote "emacsclient -c" frame using C-x 5 0, the SSH >> session will hang on exit. It is waiting for the X11 display connection >> to be closed, but Emacs never closes it. >> >> I have been using this patch for a few months without issue, with the >> Lucid toolkit, running "emacsclient -c" over a remote X11 connection. >> >> I just retested it on master (423c86cbde7b1ed1d42c7e21fef6e8be872857b0) >> with "./configure --with-x-toolkit=lucid" and it works for me. >> >> I would like others who use remote X11 emacsclient to try the patch, to >> make sure it does not introduce crashes, error messages or warnings. If >> it works for others, I can push the patch to master. > > Thanks, but "ssh -X" is not the only way of starting a remote client > session, is it? How do we know closing the X connection is TRT in all > the cases, and cannot do any harm in some use cases other than yours? > > I'm also surprised that such a fundamental problem is raised only now, > when remote connections existed for decades. Are you saying this is a > regression due to some recent change we installed? If not, how come > this went undetected for so many years? > > Po Lu, any comments or suggestions? The issue that ought to be fixed is emacsclient's waiting for the display connection to be closed before exiting, as the automatic closure of connections without frames is expressly disabled on X toolkit builds, since closing a display connection is liable to induce crashes in the X toolkit. Unless I misunderstand Thomas and it is ssh that is refusing to exit.