From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#55832: 28.1; Emacs crashes when using tramp from helm in emacs-29 Date: Fri, 10 Jun 2022 10:00:12 +0000 Message-ID: <87edzwakji.fsf@posteo.net> References: <87pmjhgdiv.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29312"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , larsi@gnus.org, 55832@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 10 13:00:52 2022 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 1nzcNn-0007Td-Ms for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jun 2022 13:00:51 +0200 Original-Received: from localhost ([::1]:39388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzcNm-0004AQ-BV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jun 2022 07:00:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzbjK-0006YY-W2 for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2022 06:19:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzbjK-0003IO-IF for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2022 06:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzbjK-0008Pk-90 for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2022 06:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jun 2022 10:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55832 X-GNU-PR-Package: emacs Original-Received: via spool by 55832-submit@debbugs.gnu.org id=B55832.165485633432329 (code B ref 55832); Fri, 10 Jun 2022 10:19:02 +0000 Original-Received: (at 55832) by debbugs.gnu.org; 10 Jun 2022 10:18:54 +0000 Original-Received: from localhost ([127.0.0.1]:48902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzbjB-0008PN-P0 for submit@debbugs.gnu.org; Fri, 10 Jun 2022 06:18:54 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:50885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzbj9-0008P9-Jk for 55832@debbugs.gnu.org; Fri, 10 Jun 2022 06:18:53 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1198C24010B for <55832@debbugs.gnu.org>; Fri, 10 Jun 2022 12:18:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1654856326; bh=Ip18dDjFT5chFmxqYXn9l4oaZOb0cKrIV7mlCgiuX44=; h=From:To:Cc:Subject:Date:Autocrypt:From; b=F7xQV3wXQhYKuZXm/482ZR+dkN66qBzd9K2yWGBy+fIrMDdnKYcc6TFu2HXpOvcso 94Fzn/knWQCpzXdLTu/HC1s3kIr7BgiN3dhAADhLA+iDz0yl/7hxxwcpy1pf+BR0uW zjRk90LE9XMHCXYPYEAiHLpF3vOJ5mXEOVjLsCrs4hgd9yikeIeL0aIBTPD3/GDZeg yx2irm/KMm22PivDLCELbLmetPe4qeB6rn2ytrMS1fqr4NA5tjHS7qwHQJ72o24fj/ 4mpcBbvTx+sGAzMo+QsIUAGOPW8ulmqiH1l/WhirlqqqKGAmcQtqFix/ThARjFr417 gQaeBLPQLd0iA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LKH440xZgz6tmJ; Fri, 10 Jun 2022 12:18:43 +0200 (CEST) In-reply-to: <87pmjhgdiv.fsf@gmx.de> Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata= mQGNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA AbQSdGhpZXZvbEBwb3N0ZW8ubmV0iQHUBBMBCgA+FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAl8y lcICGwMFCQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQDsVtFB0W75MB3QwAlTsVzFmr +S/tMKwwwOibjhNPi/OZiUC2AYfaqfVAiIHDT3RbzDe03sAJoomJkJnYVjGzQZwibCMO2+ITkMPV 2wvrd4CbgS1KCVbrltwcuK/nxPCBaHytOCZUIInnhJo5PE/h03K 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" Xref: news.gmane.io gmane.emacs.bugs:234207 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Michael, Michael Albinus writes: > Eli Zaretskii writes: > > Hi, > >>> > So tramp-file-name-for-operation errors out, and that somehow gets us >>> > in trouble. >>> > >>> > I see we call signal-hook-function -- what is its value in that >>> > session, please? >>> >>> Seems tramp let-bound it to tramp-signal-hook-function in >>> tramp-file-name-handler. >> >> Michael, can you help us out here? Could the above somehow cause >> infinite recursion, whereby signaling an error triggers another, >> nested error? > > First, I've tried to reproduce it from emacs -Q. I've upgraded all > installed ELPA packages, and then I have called > > emacs -Q \ > -l ~/.emacs.d/elpa/helm-core-20220503.622/helm-core-autoloads.el \ > -l ~/.emacs.d/elpa/helm-20220504.827/helm-autoloads.el \ > -l ~/.emacs.d/elpa/helm-tramp-20190616.125/helm-tramp-autoloads.el \ What is helm-tramp? this is not part of helm. > -l ~/.emacs.d/elpa/async-20220318.1342/async-autoloads.el \ > -l seq -f helm-find-files You have better time cloning emacs-async and run make && sudo make install and same with helm, then emacs -q, (require 'helm) (require 'helm-config) and C-x c C-x C-f > Using /sudo:: as file name doesn't raise any error. Did you follow the recipe I sent? First shot doesn't crash but second after M-x tramp-cleanup-all-connections does. > However, this is from the master branch; The bug is from master branch not emacs-28, I sent the bug report from my main emacs which is emacs-28 because 29 crashed. > Emacs 28 doesn't play fine with the compiled Helm libraries because of > an error in calling string-match (using the new optional arg > INHIBIT-MODIFY). And I don't want to recompile all my installed > packages with Emacs 28. Hmm. The bug doesn't happen with emacs-28. > Looking at the error, it comes indeed from > tramp-file-name-for-operation. In the backtrace shown by Thierry it > looks like this function is called for tramp-get-remote-uid: > > (gdb) xsymbol > $5 =3D (struct Lisp_Symbol *) 0x555558080030 > "tramp-file-name-for-operation" > (gdb) p args[1] > $6 =3D XIL(0x22fdb90) > (gdb) xtype > Lisp_Symbol > (gdb) xsymbol > $7 =3D (struct Lisp_Symbol *) 0x555557fd47d0 > "tramp-get-remote-uid" > > tramp-get-remote-uid *is* a valid argument, and > tramp-file-name-for-operation shouldn't raise an error. Once we have > fixed the problem of Emacs crash, it shall be investigated wy this error > has been raised. tramp-get-remote-uid is calling tramp-file-name-handler with tramp-get-remote-uid as arg so I guess the infinite recursion starts here isn't it? =20 > It is not clear to me why tramp-file-name-for-operation goes into > recursion with the error handling, invoking again and again > tramp-signal-hook-function (that is the function bound to > signal-hook-function). What is calling tramp-get-remote-uid in tramp-file-name-for-operation? > However, a simple protection against this should be this patch: > > diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el > index 3ee1169139..3905aeba70 100644 > --- a/lisp/net/tramp.el > +++ b/lisp/net/tramp.el > @@ -2476,6 +2476,7 @@ tramp-file-name-for-operation > It does not always return a Tramp file name, for example if the > first argument of `expand-file-name' is absolute and not remote. > Must be handled by the callers." > + (let (signal-hook-function) > (cond > ;; FILE resp DIRECTORY. > ((member operation > @@ -2558,7 +2559,7 @@ tramp-file-name-for-operation > ((member operation '(tramp-get-remote-gid tramp-get-remote-uid)) > (tramp-make-tramp-file-name (nth 0 args))) > ;; Unknown file primitive. > - (t (error "Unknown file I/O primitive: %s" operation)))) > + (t (error "Unknown file I/O primitive: %s" operation))))) > > (defun tramp-find-foreign-file-name-handler (filename &optional _operati= on) > "Return foreign file name handler if exists." > > > Similar protections have been applied already elsewhere in Tramp. Does > this solve the problem? No still crashing. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmKjGoETHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk9TVDACTPsS7Ghz5mm532o5IV/HzwVnSYzGY vn7bB0uXrdPJvXo/YbQO2KFSioC5tg7qJmf5EYlTXGVQpooGzCtSv3gaPVCLPwLA wtSyy+3RUdP11J1KHwtxul39iyZqFUAzyMXc/PWxooKjHozu3aGNqG4If/xN/LV0 NOG/yYhSo/6nKyzkCb+l1jkY+OUUqn1xKPSBIRwcA2Bn6QG+On8E2okKfsni/0qZ e1GeAJ0EpWzEkBEkU2Bk02rdrE8ZB3Wx/u50FfhsWOyFy8sixESRLBJttvQRKA5N ewj/aiZCbBs77wn8lHT3qJQRqR96UqeSQ/NLKStIUB2uZKushdffs2ckSRXLRF5e UzazMR9oMe0Tz4odoKh7+A0HAagl7DYVacgM+ol58oWpMANs/j0gEhhdthM5n61X cFMia4mZv+hRSm71Mh4AdntCH5NXkxQivsPVjlwJfmUvOU4+BfxnnR7gb2/W9eoI eV3uvhB21DcVZfDYmXH5ZecADcRHQWlly0w= =E9TO -----END PGP SIGNATURE----- --=-=-=--