From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#49954: 28.0.50; TRAMP: cannot kill child processes: "Forbidden reentrant call of Tramp" Date: Mon, 09 Aug 2021 02:08:00 -0700 Message-ID: <875ywf9ea7.fsf@secretsauce.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12859"; mail-complaints-to="usenet@ciao.gmane.io" To: 49954@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 09 11:09:50 2021 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 1mD1I5-00034Y-1t for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 11:09:50 +0200 Original-Received: from localhost ([::1]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD1I3-0000L4-Vz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 05:09:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD1HK-0006dT-76 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 05:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mD1HK-0006ow-07 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 05:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mD1HJ-0000dY-M6 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 05:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2021 09:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49954 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16285000932392 (code B ref -1); Mon, 09 Aug 2021 09:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Aug 2021 09:08:13 +0000 Original-Received: from localhost ([127.0.0.1]:55728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD1GX-0000cV-28 for submit@debbugs.gnu.org; Mon, 09 Aug 2021 05:08:13 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD1GT-0000cK-Dq for submit@debbugs.gnu.org; Mon, 09 Aug 2021 05:08:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD1GT-00041s-1Z for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 05:08:09 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:40589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD1GQ-0006Bs-FD for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 05:08:08 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id EB26D32004CE for ; Mon, 9 Aug 2021 05:08:02 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 09 Aug 2021 05:08:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= fm1; bh=yHifl772bQoXdaZ8A5RxZ4iZhRqKC7tzt8mI7kh775M=; b=Hj254fH3 W8O6MkEaZFu1UFBj3NDxYJuZheesWd9p/cROzwc9L8P/CQWjInurP5Vm1fxxU8Wc wpAUUIM7isnljGIUn/rUcl1pQwK1U4NfBLEQ/vONJhk9HcLCbfY1y5GLykcXm+iI NNczne8XKo/nThP2bHkcK9gQX0o8XtWVDET2M8lVVP2P1VBTZEEbLAtsmgB+WLsG 6iPDyiOsYCmE7mtsA9A3x66eREyKmvMms+9zP3u++LXHBCCO5ohkl/zCQ8FNn2Vs BkO415Klyf0v5L8HopP7hCmH3js8hUDXeXMvbTX/SlkwHioeAnbNMBgTkayluHJ5 CXH0Kzb4Rwh4Ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=yHifl772bQoXdaZ8A5RxZ4iZhRqKC 7tzt8mI7kh775M=; b=A3V3CqRIXP+AZpu6NO27AP8MSDMS3HhykzliOKtiAmTSR sRU1TDmy0TsTzCXedu/WbhMEMCJaz0N7cZNpDI/PM3G7GnCWRewppFdEWXyKptSs ARewOXoNmtwJ04A5Cde4a6cbdnJZQD2tSKra9niexNmGvQ57V8Z3f50ZByj/pG20 zN8fawbwCpxmLw7MkSUe9wv8lIne4LdmmnRcRPzrUJlj5Fjijv+FRghS/haPG9mX GUegtXJpKABaSQolcIu+kP/UaxyNm70p4i9q/cEzjG0QYknMzHKS2Rq98qxBffj0 0Y6jO3GO1MmBn0B7eUk/P28bWPsNcSy+TouHl1fFA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjeejgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddttd enucfhrhhomhepffhimhgrucfmohhgrghnuceoughimhgrsehsvggtrhgvthhsrghutggv rdhnvghtqeenucggtffrrghtthgvrhhnpeffvdffudfhkeffhfeifefhffdvtdfgfeejve euvdefudejjeduveeftdeggeeuvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpeguihhmrgesshgvtghrvghtshgruhgtvgdrnhgvth X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 9 Aug 2021 05:08:02 -0400 (EDT) Received-SPF: pass client-ip=64.147.123.21; envelope-from=dima@secretsauce.net; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:211423 Archived-At: Hi. I see this problem often in everyday use of emacs, but every time I try to construct a reliable reproducing recipe, it always works ok, so some of this report is a request for debugging help. I've seen this sort of bug for years, so probably it exists in the latest emacs. Today I'm seeing it in a build from a few weeks ago: 553ad9c9e85 built on 20210716. I don't know how to reproduce in the latest emacs. In the session I have running (from the 20210716 build) I have a shell buffer that shows the problem 100% of the time. New shell buffers do not show this problem. A recipe that should work: 1. emacs Run emacs. Possibly my config is triggering it. I don't know 2. C-x C-f /ssh:server: Open a remote TRAMP connection 3. M-x shell Open a remote shell 4. cat Run a "cat" command in the remote shell 5. C-c C-c kill the "cat" In fresh emacs sessions and fresh shell buffers this works fine: the "cat" process is killed and we get back to the prompt. Something happens with older shell buffers where the child process is NOT killed, and emacs complains with "Forbidden reentrant call of Tramp" I just tried to (setq tramp-verbose 10) to get a debug log of the failure. It says this: ;; Emacs: 28.0.50 Tramp: 2.5.1 -*- mode: outline; coding: utf-8; -*- ;; Location: /usr/share/emacs/28.0.50/lisp/net/tramp.el.gz Git: / 01:49:39.391745 tramp-interrupt-process (5) # Interrupt process shell<6> with pid 3705628 01:49:39.391864 tramp-get-connection-property (7) # null-device /dev/null; cache used: t 01:49:39.391946 tramp-get-connection-property (7) # process-name nil; cache used: nil 01:49:39.392019 tramp-get-connection-property (7) # process-name nil; cache used: nil 01:49:39.392089 tramp-get-connection-property (7) # process-buffer nil; cache used: nil 01:49:39.392180 tramp-get-connection-property (7) # last-cmd-time (24848 60388 520023 896000); cache used: t 01:49:39.392262 tramp-get-connection-property (7) # process-name nil; cache used: nil 01:49:39.392325 tramp-get-connection-property (7) # remote-echo nil; cache used: nil 01:49:39.392385 tramp-send-command (6) # echo are you awake 01:49:39.392447 tramp-get-connection-property (7) # process-name nil; cache used: nil 01:49:39.392509 tramp-get-connection-property (7) # chunksize 0; cache used: t 01:49:39.392573 tramp-set-connection-property (7) # last-cmd-time (24848 60451 392543 712000) 01:49:39.392637 tramp-send-string (10) # echo are you awake 01:49:39.392698 tramp-get-connection-property (7) # process-buffer nil; cache used: nil 01:49:39.392775 tramp-get-connection-property (7) # locked nil; cache used: nil 01:49:39.392828 tramp-set-connection-property (7) # locked t 01:49:39.392912 tramp-flush-connection-property (7) # locked 01:49:39.392981 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.393036 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.393120 tramp-get-connection-property (7) # locked nil; cache used: nil 01:49:39.393173 tramp-set-connection-property (7) # locked t 01:49:39.441305 tramp-accept-process-output (10) # *tramp/ssh fatty* nil run t are you awake ///66c246702753a7fa497f74164e69b140#$ 01:49:39.441619 tramp-flush-connection-property (7) # locked 01:49:39.441783 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.441931 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.442103 tramp-wait-for-regexp (6) # are you awake ///66c246702753a7fa497f74164e69b140#$ 01:49:39.442387 tramp-get-connection-property (7) # process-name nil; cache used: nil 01:49:39.442556 tramp-get-connection-property (7) # remote-echo nil; cache used: nil 01:49:39.442710 tramp-send-command (6) # (\kill -2 -3705628 || \kill -2 3705628) 2>/dev/null 01:49:39.442872 tramp-get-connection-property (7) # process-name nil; cache used: nil 01:49:39.443034 tramp-get-connection-property (7) # chunksize 0; cache used: t 01:49:39.443204 tramp-set-connection-property (7) # last-cmd-time (24848 60451 443130 172000) 01:49:39.443376 tramp-send-string (10) # (\kill -2 -3705628 || \kill -2 3705628) 2>/dev/null 01:49:39.443589 tramp-get-connection-property (7) # process-buffer nil; cache used: nil 01:49:39.443792 tramp-get-connection-property (7) # locked nil; cache used: nil 01:49:39.443936 tramp-set-connection-property (7) # locked t 01:49:39.444124 tramp-flush-connection-property (7) # locked 01:49:39.444293 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.444433 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.444579 tramp-get-connection-property (7) # locked nil; cache used: nil 01:49:39.444719 tramp-set-connection-property (7) # locked t 01:49:39.493255 tramp-accept-process-output (10) # *tramp/ssh fatty* nil run t ///66c246702753a7fa497f74164e69b140#$ 01:49:39.493535 tramp-flush-connection-property (7) # locked 01:49:39.493687 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.493835 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil 01:49:39.494001 tramp-wait-for-regexp (6) # ///66c246702753a7fa497f74164e69b140#$ 01:49:39.494263 tramp-get-connection-property (7) # locked t; cache used: t 01:49:39.512596 tramp-accept-process-output (10) # backtrace() tramp-error(#> remote-file-error "Forbidden reentrant call of Tramp") tramp-accept-process-output(#> 0) tramp-interrupt-process(nil t) comint-interrupt-subjob() funcall-interactively(comint-interrupt-subjob) command-execute(comint-interrupt-subjob) 01:49:41.733242 tramp-accept-process-output If I open a fresh shell in the same emacs session, it works OK. That debug log is similar, except the last tramp-get-connection-property line says: 01:48:36.571873 tramp-get-connection-property (7) # locked nil; cache used: nil I don't know how it's unlocked. Debugging suggestions? Should I just add more diagnostics in every lock/unlock path? Do we think this may be fixed in the latest emacs? Thanks!