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#45256: Viewing images over network using TRAMP (errors and unexpected prompts) Date: Wed, 16 Dec 2020 10:08:08 +0100 Message-ID: <87360615l3.fsf@gmx.de> References: <461b6a4f-9709-c71b-0ec3-f70d08674c9e@fastmail.com> 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="15058"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45256@debbugs.gnu.org, Juri Linkov To: Mikhail P Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 16 10:09:14 2020 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 1kpSo5-0003oZ-QZ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Dec 2020 10:09:13 +0100 Original-Received: from localhost ([::1]:41978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpSo4-00049V-RM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Dec 2020 04:09:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpSnu-000496-Gf for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2020 04:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpSnu-0006cu-8i for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2020 04:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kpSnu-0001eJ-25 for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2020 04:09: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: Wed, 16 Dec 2020 09:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45256 X-GNU-PR-Package: emacs Original-Received: via spool by 45256-submit@debbugs.gnu.org id=B45256.16081097026286 (code B ref 45256); Wed, 16 Dec 2020 09:09:02 +0000 Original-Received: (at 45256) by debbugs.gnu.org; 16 Dec 2020 09:08:22 +0000 Original-Received: from localhost ([127.0.0.1]:59817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpSnG-0001dK-Ei for submit@debbugs.gnu.org; Wed, 16 Dec 2020 04:08:22 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:56497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpSnD-0001d7-QH for 45256@debbugs.gnu.org; Wed, 16 Dec 2020 04:08:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608109690; bh=NhofY7mnYrGRoWYSILeAIJKEQ4aojk8sc1uwOkIHyv4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=EJHqAsnR9N6RYwysKvKXhZkzvnF3yY1kLoEaX52mgWbW9YWU85xLwAKdCxddn301r EbGMrzbtWyhF2YY6yRj0VQvoynVYuplx+A7A4e66+LTT5i05jYFdo2IQtlfuWp28DB 9VwmAgbOEBIdy/Jum8UN/oB4yTgWzDnVg+A8Na8E= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.118.184]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MOREi-1kSqd548go-00Pxyk; Wed, 16 Dec 2020 10:08:10 +0100 In-Reply-To: <461b6a4f-9709-c71b-0ec3-f70d08674c9e@fastmail.com> (Mikhail P.'s message of "Tue, 15 Dec 2020 19:17:28 +0700") X-Provags-ID: V03:K1:/QC9eJkxQXwGKNZ2lSNy0UvwWjaI8qFFGFlkxZqJgehQUEZebb3 r53OFShU5kKZKyOdGU5CPwqhdKbGG4ywzP4SPF1qKZqQRqOXrbAEDk/vQipXscB2ZGPterR Nm+kaFv4chZt74OEFtnS8s0A7i/MhraAexHjqvcKNc/kf85rJzs+l8HY7ObNKxnxSv2EHSy 1AV2dhgGms6QU1mLDAz9Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:Tfgky9OQz74=:fRdhA14OjoOVI3RsEcLZUl zQGKVReB4RBZWXvFFehHAxlIDTqfBNZuQdCJaeGUFisLW7VgoU1lrV5eornFJMBuu56MHrxQd dT7NiOeOK8ZvLQqRExzXIGdrHpSrzDeynnf5P/LuGuDi5KoRoRA1sBJ2x3TEmQGBeXVsVxEix ZPUVO8aBgGL1W91m9jWPlnKi/N+9zqEu0dDlmmiSKS315W4dH9WOxwrZrNLgqF9s0t+sEbDrt Aduh/XC0we9sQ8LXDF5CJpU9k0uP/K91xg3tVJ2ZXJMf951LuA3ckxxcyXfuzPgXaNoADJHsA 8XRyt5g5BQIHjy9ukT021L9CxTAcWgvT/0EfOWsW5yBSwcYIK8mlfrOSqFUiwuLYbfFEhkejh Vw/hdULdv8n4pfjsEEWh5Rhan+5OGxzHpMKShm2YZpNLrnzZUmCjyF6wrrTQJrglQo0Mh10m3 JbXO/mwfL66nM87CIeY7IMJL8DCwvNHuotEXv8VkFyJzqS5Cejdqg5rSkMrJ6IkhVAI2rrrXH MX2rhkohvzCmjub0TfZKWQhUSIeoCokZ/HqapHGSUJH/3DAVtULvxfXaITBwJAdhhL+WYrjQN AUYqBrVwiwcwtr0DZHPeS/Wgm4SKeZWhcgxCEhFzd9dDkaLrhxJZCzIlaMmSAlHq3vEY6QfCM OWMuQJBf8+K8ZlGDMEEDOkoG2S7+bzGrzRoReKzkPjnNtUJVs/ZIJT9/yD80W5MgnnMAm1zBd jH/HbAtCsck68eulqnyF/NU+Xr7a6mVlk32KG5CeCWTBunyC9xuAiwG5xcghRiotXCqKgABx 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:196203 Archived-At: Mikhail P writes: > Greetings. Hi, > I am experiencing problems with viewing remote images. When resizing > an image (e.g. by resizing Emacs frame) Emacs occasionally > (approximately ~30% reproducibility) can prompt ... changed on disk; > really edit the buffer? which does not make a lot of sense. Regardless > of my response Emacs outputs errors, lags for several seconds and only > after that resizes the image. > > I am using currently most recent commit on TRAMP repo > (69844458e33b5dcae53de249d9d82c59a5876055) containing some necessary > fixes. Prior to these fixes Emacs could occasionally stall on resizing > remote image and only interruption with C-g could help (or sometimes > making Emacs completely unresponsive). Also attaching TRAMP debug file > which I hope exposes the problem. FTR, this has been merged with the Emacs git master. > As far as I could understand from my conversation with TRAMP devs > while working on the fixes there are problems with functions called on > idle-timer in image mode ... =F0=9F=98=AC Well, we see in the debug file the following backtrace: --8<---------------cut here---------------start------------->8--- backtrace() tramp-send-string((tramp-file-name "ssh" nil nil "horsehop" nil "/storage= 1/mikpom/wizard_devel/CNV/figs/TCGA_CNV/AT..." nil) "(env QUOTING_STYLE=3Dl= ocale \\stat -c '((/////%N/////...") tramp-send-command((tramp-file-name "ssh" nil nil "horsehop" nil "/storag= e1/mikpom/wizard_devel/CNV/figs/TCGA_CNV/AT..." nil) "(env QUOTING_STYLE=3D= locale \\stat -c '((/////%N/////...") [...] tramp-file-name-handler(file-readable-p "/ssh:horsehop:/storage1/mikpom/w= izard_devel/CNV/fi...") file-readable-p("/ssh:horsehop:/storage1/mikpom/wizard_devel/CNV/fi...") image-toggle-display-image() image-fit-to-window(#) apply(image-fit-to-window #) timer-event-handler([t 0 1 0 nil image-fit-to-window (#) idle 0]) [...] tramp-file-name-handler(verify-visited-file-modtime #) add-text-properties(1 64075 (display (image :type png :data "\211PNG\15\n= \32\n\0\0\0\15IHDR\0\0\5\0\0\0\3\300\10\6\0\0\0j\334\324y\0\0\0\4sBIT\10\10= \10\10|\10d\210\0..." :scale 1 :max-width 1152 :max-height 884) rear-nonsti= cky (display) read-only t front-sticky (read-only))) image-toggle-display-image() image-fit-to-window(#) apply(image-fit-to-window #) timer-event-handler([t 0 1 0 nil image-fit-to-window (#) idle 0]) 18:56:54.633834 tramp-send-string (1) # Remote file error (compat): Forbidd= en reentrant call of Tramp --8<---------------cut here---------------end--------------->8--- That is, two calls of timer-event-handler([t 0 1 0 nil image-fit-to-window = ...]) image-fit-to-window calls remote file operations, verify-visited-file-modtime the first time, file-readable-p the second time. The first call of image-fit-to-window hasn't finished, when the second call of image-fit-to-window happens one second later. That is relevant, this situation happens only for slow remote connections (I had a hard time to reconstruct the scenario). >From my pov, image-fit-to-window must be hardened in order to avoid this reentrant call. Maybe an internal lock at entry, which is honored by every next call until the lock is removed. And at least it shall be wrapped with (ignore-error 'remote-file-error ...) in order to masque the situation. > Thanks, > > Mikhail Best regards, Michael.