From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#61350: Eglot over Tramp freezes with large project Date: Tue, 14 Mar 2023 15:19:54 +0000 Message-ID: References: <87y1ootw2t.fsf@gmail.com> <87ilfkh89k.fsf@gmail.com> <87y1ofct83.fsf@gmx.de> <87356n8kja.fsf@gmail.com> <877cvvfnp6.fsf@gmx.de> <54377687.213790.1678016749459@office.mailbox.org> <87356jfktc.fsf@gmx.de> <87a60ovi90.fsf@gmx.de> <31964054.380679.1678194256931@office.mailbox.org> <87r0u0u0rl.fsf@gmx.de> <87mt4otyy1.fsf@gmx.de> <87pm9fk6ht.fsf@gmx.de> <87mt4jzf8q.fsf@gmail.com> <87fsabh2z2.fsf@gmx.de> <87edpvxu7w.fsf@gmail.com> <87bkkzgyb8.fsf@gmx.de> <87lek2x09t.fsf@gmail.com> <875yb646d1.fsf@gmx.de> <87fsa7mw9x.fsf@gmx.de> <87fsa7l6o6.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40490"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thomas Koch , monnier@iro.umontreal.ca, 61350@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 14 16:23:03 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 1pc6UQ-000AOD-Po for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Mar 2023 16:23:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pc6Qb-0004qf-Ik; Tue, 14 Mar 2023 11:19:05 -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 1pc6QZ-0004qR-Ho for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2023 11:19:03 -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 1pc6QY-00049r-Or for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2023 11:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pc6QY-0007a7-3D for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2023 11:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Mar 2023 15:19: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.167880709329046 (code B ref 61350); Tue, 14 Mar 2023 15:19:02 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 14 Mar 2023 15:18:13 +0000 Original-Received: from localhost ([127.0.0.1]:38240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pc6Pl-0007YP-FB for submit@debbugs.gnu.org; Tue, 14 Mar 2023 11:18:13 -0400 Original-Received: from mail-oa1-f46.google.com ([209.85.160.46]:33399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pc6Pj-0007Y6-JK for 61350@debbugs.gnu.org; Tue, 14 Mar 2023 11:18:12 -0400 Original-Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-17997ccf711so4066008fac.0 for <61350@debbugs.gnu.org>; Tue, 14 Mar 2023 08:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678807086; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=66m8JyNBPMbf8Jb/+i0UPkN18BQQO3rQ3gESuK0Zi1U=; b=TKSzVrvty5zWWo2ru6qM4ScHTh0HfJxhsbudxkPakTnXNmMyEN2jUcT2GT0L3sJYC6 4DNzRbwhrW5Q0iSKTuBmTXr2vPp5owSV7Bx2jhDux9nR5+yxSr90mltUzjr1I36Kojxi 86VKMVL4DM/ELv9d7+27To/K1Smedmvl5cIa21bZqBFB1dRSiiVVGLtYKzcLkgfaH/Y/ m/WTc8JzrHP6AG9qKIcQ6lyTxOeBgmQImk+L+ABLe+9SJO2OYrY2nwpn+wYca36CVa4c KzjIr6YrCA5aqpFU+p5wlLiBxZaPF1iiCos5aCFkrPKv4+eDWNCW9zo77XIM5Z3VTYkU oGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678807086; h=content-transfer-encoding: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=66m8JyNBPMbf8Jb/+i0UPkN18BQQO3rQ3gESuK0Zi1U=; b=bTgUeYoM8DI4++hBxaNNlRar4k8WCSwJAcjwsks0ZAos0F2BtlAZp+k504M4Zih5EB nLOiSut3muCFKQ+XF9mLfAbSY1iRdlAzsfR9aUzyPARgkXDes5dh2ftI5MmxR2y5skJ1 1cTdM79GaxRsqOTaDrwpLVWFQ7CMtQ7LJtbl7wyB1/dVMRr5mtLrKcQitgGjHHyFufxc 7emw6oXEX8oyLu6S5YK3OxWlWiqV0UhrKyQ8mjulKk+pSbBUUhSJktt4mkYZMjbby//Z QE9fRdzn/uU38hFzFfV6jaYdjcW1g/gzo644YashYR0zQwZwN4FfawdOJ7YLcWEvq58m /LzQ== X-Gm-Message-State: AO0yUKUj67K2Tg0h/gFyLOvdP+Zn081fwfuSLcvJAFxx3LAZBrdWo2Np EZYC9I0bcwpNnouqzs0kjeJ+AmWShXvMraG3Sz0= X-Google-Smtp-Source: AK7set/Ho0Nlbtv+1gzD2naEYvrNqL8hlyb9cxF3oQEQRf4KzjrSTt3xv2q8Gj/xLdUwKnPcjHSv+RyUae8aJBsarhg= X-Received: by 2002:a05:6870:4729:b0:17a:ad5d:c973 with SMTP id b41-20020a056870472900b0017aad5dc973mr887605oaq.5.1678807085769; Tue, 14 Mar 2023 08:18:05 -0700 (PDT) In-Reply-To: <87fsa7l6o6.fsf@gmx.de> 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:257938 Archived-At: On Tue, Mar 14, 2023 at 3:00=E2=80=AFPM Michael Albinus wrote: > Achhhhhh :-( Pech! > I will investigate. IMHO, this is the final indication that we shouldn't > allow a nil JUST-THIS-ONE in accept-process-output. I don't see this failure as an indication of that, at all!! First, you didn't do that -- put nil in JUST-THIS-ONE -- did you? At most this means that you are doing more or less the same as setting JUST-THIS-ONE to nil, but in a much more convoluted way, so that you may as well start setting JUST-THIS-ONE to nil... ...and bite the bullet, continuing this analysis. We're making progress... So, I reach a completely different conclusion. For me, this means that those auto-revert and symlinks-remote tests, whatever they are, must be investigated. It's good that you have these tests! Do they fail in all Emacsen or just some? Always/sometimes? Can I reproduce this here? After we get a consistent failure, we should ask ourselves what exactly is the reentrancy in question here. Perhaps you already have a conjecture of the chain of events that leads to it. FWIW I've recently solved a reentrancy bug in jsonrpc.el. I identified the conditions (here, i was ignoring that process-send-string when given enough input to send, will cause output acceptance, and filters to run), and fixed it. Jo=C3=A3o commit 8bf4cdcf79bc3254a9169f28f68922ab83bd4e78 Author: Jo=C3=A3o T=C3=A1vora Date: Thu Dec 15 15:26:13 2022 +0000 Avoid recursive process filters in lisp/jsonrpc.el (bug#60088) jsonrpc.el may lose JSON-RPC messages because of recursive process filters. The problem happens in jsonrpc.el's jsonrpc--process-filter. The code of the process filter didn't expect to be called recursively and fails in that case. But that can happen if the three conditions are verified. 1. the client code invoked by its jsonrpc--connection-receive inside the process filter callee immediately sends follow-up input to process within the same Lisp stack. This is a common scenario, especially during LSP initialiation sequence used by Eglot, a jsonrpc.el client. 2. that follow-up message is large enough for process-send-string to send the input in bunches (output from processes can arrive in between bunches). 3. the process happens to have already some more output ready The fix in this commit detects recursive invocations and immediately re-schedules them as non-recursive calls to the jsonrpc--process-filter (but started from timers). * lisp/jsonrpc.el (jsonrpc--process-filter): Rework. (Version): Bump to 1.0.16.