From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#55832: 28.1; Emacs crashes when using tramp from helm in emacs-29 Date: Fri, 10 Jun 2022 09:53:44 +0200 Message-ID: <87pmjhgdiv.fsf@gmx.de> References: <83y1y520eh.fsf@gnu.org> <87mteladpm.fsf@posteo.net> <83pmjh1xbg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="738"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Thierry Volpiatto , larsi@gnus.org, 55832@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 10 09:54:45 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 1nzZTg-000Aba-Sr for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jun 2022 09:54:44 +0200 Original-Received: from localhost ([::1]:57124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZTf-0005BY-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jun 2022 03:54:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZT4-0005BQ-0x for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2022 03:54:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzZT0-0005az-4z for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2022 03:54:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzZT0-000092-0F for bug-gnu-emacs@gnu.org; Fri, 10 Jun 2022 03:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jun 2022 07:54:01 +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.1654847638546 (code B ref 55832); Fri, 10 Jun 2022 07:54:01 +0000 Original-Received: (at 55832) by debbugs.gnu.org; 10 Jun 2022 07:53:58 +0000 Original-Received: from localhost ([127.0.0.1]:48593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzZSv-00008j-Iq for submit@debbugs.gnu.org; Fri, 10 Jun 2022 03:53:57 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:38855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzZSr-00008T-KS for 55832@debbugs.gnu.org; Fri, 10 Jun 2022 03:53:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1654847626; bh=vsLikD6U6fxYAw6Gh5GqRxRoiatobRQ0hwJ5dVgdm8M=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=IzZD284q8CQYG2NNJMSqrGMG1+88RTkLTRiWAIUCVVUphHt4bAphcWSyCU7OL+nWF 0lr8eU/3GTyxHImlRDzFF6c0ZcA637pQ7kCEZRgelQX2zsgWPfoo3R5FWikCbZICMf E3rBwZzvu5MoT2lJtgzTCTJl3O+sNBuIwOEuygUw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.124.174]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MsYqp-1njgXJ0a9D-00u4rj; Fri, 10 Jun 2022 09:53:46 +0200 In-Reply-To: <83pmjh1xbg.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 09 Jun 2022 21:55:15 +0300") X-Provags-ID: V03:K1:cmcqcz2rppn5nUFXnOi4UX3ya+rLnpkAAJ16i1i5Ad3o7MKii/E iBRmjzbvHDjAWqkY1REJNifwpoizugENK3MR4KLIhkeuaSKsCYw2Z/pSusDDKcmf6puRFAt 15pNG7mPVTAbyNdJCefBiZPH/SOJuEO9XCEpnXeW+P86hxy9l04UisR5RUBAkNgG2Wtfo15 fmIc6Y9w7EKYSpIWnFUQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZIOtdFdYdog=:mBZmzApuOcL6H7PNfxwIoU h9PsnrlNomym49Q2zrf+ewQllgaJDVf3AkktdpUDmD7edZaiRTPyaRwE/Q+dPrZVJu0d2uddg 4U8HdgUCd0FOmwTgcLbAuVIUxjNvZ/jqnj6cPkiV3/4UveIcuDTROoRrrADv4VGnj4+fq5XwE 4X4qaZnO5jtp1zt4ugaABgxjuj1xCw6JdS2Y5IfPlC7nKcSMOJAtjBfjXovXecNT21Nfn1AFO o31aDS+abPdvYllLGWRbs28bG5k9q8lHZqpE05SEhn/LQiBEuxZUbHR5BAMd/4PMPLImjhU2s tPO+OXS1bfttFmVeS0M8RtvjHg2u275b7AehTmCS4jNSbt8tb3010E6/7NNgc92atFQ30YFsf tYZBioEA6HX+YSNFkpqLxUE8F9rzlRW+VoxvwOuNxryULLwy0eXafYuauhZPgbVJLkPimHEdX CtvBVluYpFgWF8+zHX/ajOy+YlUvSyLcUQhezZE6ExwEPMscFbG+Cx4MtZUzwBSGHZHStGlzT Mhow1qV/ySrtdZ1cE+xk9MQZ2Ie9gGGHJHY0fDw5+5nyoOD7/viE3Z06+o5G60hky57P8DUgs U9LjA+l41SfMTaAvH9P645HOUA4PUYYwDEWpLhzVfpgm/aP1XSPUphtCGUkFHEAOumH0x2fNO tpo2ERHt4Uq3cpZRFaqA5O9+YXUqq7Za8VKmmKI8foSlb7wYB9b7tTkH0FxkvsLidY+FTNmeN IzFbvVxz/eZzGuHdUVfhktY0utUdK+TaGiQJhh2pHHxBcyUKxoaLbjK4XKgzIv4pL9ZKXQDu 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:234192 Archived-At: --=-=-= Content-Type: text/plain 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 --8<---------------cut here---------------start------------->8--- 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 \ -l ~/.emacs.d/elpa/async-20220318.1342/async-autoloads.el \ -l seq -f helm-find-files --8<---------------cut here---------------end--------------->8--- Using /sudo:: as file name doesn't raise any error. However, this is from the master branch; 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. 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: --8<---------------cut here---------------start------------->8--- (gdb) xsymbol $5 = (struct Lisp_Symbol *) 0x555558080030 "tramp-file-name-for-operation" (gdb) p args[1] $6 = XIL(0x22fdb90) (gdb) xtype Lisp_Symbol (gdb) xsymbol $7 = (struct Lisp_Symbol *) 0x555557fd47d0 "tramp-get-remote-uid" --8<---------------cut here---------------end--------------->8--- 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. 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). However, a simple protection against this should be this patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3ee1169139..3905aeba70 100644 =2D-- 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 _operatio= n) "Return foreign file name handler if exists." --=-=-= Content-Type: text/plain Similar protections have been applied already elsewhere in Tramp. Does this solve the problem? Best regards, Michael. --=-=-=--