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#61350: Eglot over Tramp freezes with large project Date: Fri, 17 Feb 2023 10:54:15 +0100 Message-ID: <87r0uo7h2w.fsf@gmx.de> References: <1163788660.69273.1675787581764@office.mailbox.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="900"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61350@debbugs.gnu.org To: Thomas Koch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 17 10:55:16 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 1pSxSW-000AYY-9s for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Feb 2023 10:55:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSxSK-0007QD-FE; Fri, 17 Feb 2023 04:55:04 -0500 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 1pSxSJ-0007Pr-33 for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 04:55:03 -0500 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 1pSxSI-0006sD-Q8 for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 04:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSxSI-00030S-9f for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 04:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2023 09:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61350 X-GNU-PR-Package: emacs Original-Received: via spool by 61350-submit@debbugs.gnu.org id=B61350.167662766511506 (code B ref 61350); Fri, 17 Feb 2023 09:55:02 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 17 Feb 2023 09:54:25 +0000 Original-Received: from localhost ([127.0.0.1]:38525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSxRg-0002zV-FL for submit@debbugs.gnu.org; Fri, 17 Feb 2023 04:54:24 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:43655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSxRe-0002zH-8v for 61350@debbugs.gnu.org; Fri, 17 Feb 2023 04:54:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1676627656; i=michael.albinus@gmx.de; bh=t78NY4u6f1+HKZyJaHtQ0ID37PRVIlTAbdLAPVl4tsE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=OUNzCW+sO8As0FoX16PrQWZsh/OFUb7kBfsJdTOjeA7DTeU9nRQrcyacxQC452w/j YR26yqlMSvyVeU1dcXrQ4N0rvNg18uA/IY9BXpBLz9DfRnRdK8RO6nFow21adeVGPV L49jj+K/yHksTQ8G8lGiZRlIQbfsQp2GgDKICgJUAcNFMilWuw6tXxGOqy+eIahRrH 1yc1RkotdABiB5Zfwx+mZxTck3z/HkdgITr2CG5LsI8swAHw2CPCqKaKouOtzrU2tC k7UkWwNoCHS8QRaaaSFrXudh+A1/6l1CkpBk0/wOb2vo14IUryVRxX8pFn7vKGUFeu p6mDonc8vkCWQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1fn0-1oRFui0u4G-0121v1; Fri, 17 Feb 2023 10:54:16 +0100 In-Reply-To: <1163788660.69273.1675787581764@office.mailbox.org> (Thomas Koch's message of "Tue, 7 Feb 2023 18:33:01 +0200 (EET)") X-Provags-ID: V03:K1:yKxblpJcgZPYLRoHKhsKeIYwHje1AO7/usnag7mTR+24z/hjVkF Dy3+XniPiPnTjCJHFn4OvNFnBaPvWbReJICaLUXjEGIUsS/xa8jrAxJmWt7KaOfKDhDd6JJ LsnkJXM/c9ckr5PYmiiY5NPLmpZSaomPKWg30xsrLtHeMHXrbPhEtPDZhke6gnZ1J9dURON Gf4q+6wXEsq7N5yxA94qA== UI-OutboundReport: notjunk:1;M01:P0:varG+J8UhMQ=;AnxXr8qnriysnW4Xs+KEm8NazVy M4nf6qdArSENf5d/TGGu+DTcO6WukXubSNdwFriO2D2vdd+oOvYAYWI4xQ5kAg58/BRTzhMcy EhQs5D4TcvvpjBB6Db9r+FHD00JJWE1fwVtKLbHr80pZzD23AkqZEFg/8e143UWU9XlYbsiQ5 9MNUd1hsYUiXsSQSKtvwwhs4acNnwUp8fdlBRKb4/cwiZTJaeN7OfGtqy/t0//1WEq7eTUN4g JjcaYjoNW1CnNh32uzCAm13ccHP+vd3+ytnv4uFHWsJsCFd5c3b0r925blqfb3UzlCma9rQbV mIfUi1LSFEgd3Q80ccA3zaF1X4AfpOAsVZWVHT1KalioxPmQmW5Nva7VueDrmrgBPm51eB+vn R+c7fSrd/v+dbQZFYZF5alZrwhTjMDJQfwbOWRbT8RSpbWp388PgZCutlT3fQ6Ltgc0CgMVN8 dSkAywtKCMmBPhzLKBUGn6dsWWjPglXSSyiUxUZpxJ6l568zC/GYjdq4WyugzmzG/RwelrXvp f1TlDxvJUdgyT4Tkdj/yK4xVbPVy41eMl7P+2nVX9OgqBQnF41bydb+LDAuD+5WONkBOp8RAT BpOJAcCBxJsQLJC41v5oq7XW7JPu1EDget6p2tqqKIbsbyXOTf2uO+vz8AWqZ8w8WH+gFz+h1 VN/Yi9q5b0WNJZ5fXCh6NRb9ccobB17u+Xvk/4fjQ803SONePOr4dZhYl1Y8b+acbYqPR6lRz nm5j2OFS7rF0TODNMaJJlIz5Q+ahZrQwR7nE6x+/tgTUD6fhNCMt/GVEsR3zcil+w74Nsgi7 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:255868 Archived-At: Thomas Koch writes: Hi Thomas, > I've reproduced the problem with Emacs 27.1 from Debian and a minimal > Emacs 28.2. installed via nixpkg. The follwing describes a hopefully > reliable reproduction. > > 1. Have a client system with Emacs + eglot and an SSH server. > > 2. On the server: > > git clone --depth 1 --no-tags --single-branch \ > -b eglot-tramp-freeze-repro \ > https://github.com/thkoch2001/yacy_search_server > > 3. On the server download and untar > https://download.eclipse.org/jdtls/milestones/1.19.0/jdt-language-server-1.19.0-202301171536.tar.gz > > 4. Still on server make a symlink from ~/bin/jdtls to bin/jdtls from the > tarball. > > 5. Install eglot and use this emacs config on client: > > (custom-set-variables > '(tramp-remote-path > '("/run/current-system/sw/bin" "/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" tramp-own-remote-path)) > '(tramp-use-ssh-controlmaster-options nil) > ;; problem exists also without previous line > ) > > 6. Open source/net/yacy/yacy.java over Tramp with ssh: > > 7. M-x eglot Thanks for the concise recipe. Since I have used a virgin Ubuntu VM as test target, one additional step is needed: Install Java. > Freeze should happen after a few seconds. Yep, I could reproduce it with both Emacs 29.0.60 and 30.0.50. And the backtrace is --8<---------------cut here---------------start------------->8--- backtrace() tramp-error((tramp-file-name "ssh" nil nil "ubuntu-2204" nil "/home/albinus/src/yacy_search_server/examples/Simp..." nil) quit "") tramp-signal-hook-function(quit nil) accept-process-output(# nil nil t) tramp-accept-process-output(#) tramp-wait-for-regexp(# nil "\\(?:^\\|\0\\)\\(?:[^\n#$]*///3f62f1d55bd34cba7fe730c633...") tramp-wait-for-output(#) tramp-send-command((tramp-file-name "ssh" nil nil "ubuntu-2204" nil "/home/albinus/src/yacy_search_server/examples/Simp..." nil) "\\readlink --canonicalize-missing /home/albinus/src...") tramp-send-command-and-check((tramp-file-name "ssh" nil nil "ubuntu-2204" nil "/home/albinus/src/yacy_search_server/examples/Simp..." nil) "\\readlink --canonicalize-missing /home/albinus/src...") tramp-sh-handle-file-truename("/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") apply(tramp-sh-handle-file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") tramp-sh-file-name-handler(file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") apply(tramp-sh-file-name-handler file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") tramp-file-name-handler(file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") file-truename("/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") find-buffer-visiting("/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...") #f(compiled-function (arg1 arg2 &rest rest) "Handle notification publishDiagnostics." #)(# textDocument/publishDiagnostics :uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics []) apply(#f(compiled-function (arg1 arg2 &rest rest) "Handle notification publishDiagnostics." #) # textDocument/publishDiagnostics (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics [])) eglot-handle-notification(# textDocument/publishDiagnostics :uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics []) apply(eglot-handle-notification # textDocument/publishDiagnostics (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics [])) #f(compiled-function (server method params) #)(# textDocument/publishDiagnostics (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics [])) jsonrpc-connection-receive(# (:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics []))) jsonrpc--process-filter(# "pc\":\"2.0\",\"method\":\"$/progress\",\"params\":{\"token\":...") --8<---------------cut here---------------end--------------->8--- The problem is clear. We are in jsonrpc--process-filter (accepting process output). This runs eglot-handle-notification, and that runs file-truename. The latter needs to check remote, so Tramp sends a remote command, and waits for that output (calling accept-process-output again). Since jsonrpc always accepts output from *all* running processes, there could be (and is!) the constellation, that process output has been read already, and Tramp didn't get it, waiting for the output forever. I could mitigate the problem partly by changing the arguments of accept-process-output in jsonrpc-request, and eglot could work successfully, sometimes. And sometimes not. And even then, I ran into the famous "Forbidden reentrant call" error, see bug#60534. I will continue to investigate, but after playing with this for some days, I feel we must add threads to Tramp, when there are several concurrent processes. I've tried this already some years agao, and I failed. Maybe it is time now for a new attempt. Best regards, Michael.