GNU bug report logs - #61663
30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Mon, 20 Feb 2023 21:28:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61663 in the body.
You can then email your comments to 61663 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61663; Package emacs. (Mon, 20 Feb 2023 21:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dima Kogan <dima <at> secretsauce.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Feb 2023 21:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dima Kogan <dima <at> secretsauce.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer
 without re-establishing a connection
Date: Mon, 20 Feb 2023 13:27:23 -0800
Hi. This happens with a bleeding-edge emacs. I'm using a yubikey-based
ssh key, so I need to enter a passphrase and touch the yubikey to unlock
the ssh key. It looks like TRAMP is requiring this interaction even when
it shouldn't.

1. emacs -Q

2. C-x C-f /ssh:server:file

   We open some remote file using TRAMP. This is a new ssh connection,
   so I must enter the passphrase and touch the yubikey.

3. Modify the buffer by typing something into it. Do not save

4. Break the ssh link. One way is to M-x tramp-cleanup-this-connection

5. Try to kill the buffer with C-x k. Emacs says something like "Buffer
   modified. Kill anyway?" I say "yes". I would expect emacs to throw
   away the modified buffer. Instead it tries to re-establish the
   network connection to (presumably) do some cleanup. This requires the
   yubikey auth again. If I don't follow through the passphrase,
   touching prompts by pressing C-g, the modified buffer sticks around,
   and there doesn't appear to be any way to kill it.

With a "normal" ssh key, without a yubikey TRAMP still tries to
re-establish the network connection here. But it quickly fails, and the
(kill-buffer) still succeeds. With a yubikey it fails when I kill it and
the (kill-buffer) fails too. TRAMP shouldn't be trying to re-establish
the connection here probably.

Thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61663; Package emacs. (Sun, 26 Feb 2023 14:46:01 GMT) Full text and rfc822 format available.

Message #8 received at 61663 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 61663 <at> debbugs.gnu.org
Subject: Re: bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill
 modified buffer without re-establishing a connection
Date: Sun, 26 Feb 2023 15:45:35 +0100
Dima Kogan <dima <at> secretsauce.net> writes:

> Hi.

Hi Dima,

> This happens with a bleeding-edge emacs. I'm using a yubikey-based
> ssh key, so I need to enter a passphrase and touch the yubikey to unlock
> the ssh key. It looks like TRAMP is requiring this interaction even when
> it shouldn't.
>
> 1. emacs -Q
>
> 2. C-x C-f /ssh:server:file
>
>    We open some remote file using TRAMP. This is a new ssh connection,
>    so I must enter the passphrase and touch the yubikey.
>
> 3. Modify the buffer by typing something into it. Do not save
>
> 4. Break the ssh link. One way is to M-x tramp-cleanup-this-connection
>
> 5. Try to kill the buffer with C-x k. Emacs says something like "Buffer
>    modified. Kill anyway?" I say "yes". I would expect emacs to throw
>    away the modified buffer. Instead it tries to re-establish the
>    network connection to (presumably) do some cleanup. This requires the
>    yubikey auth again. If I don't follow through the passphrase,
>    touching prompts by pressing C-g, the modified buffer sticks around,
>    and there doesn't appear to be any way to kill it.
>
> With a "normal" ssh key, without a yubikey TRAMP still tries to
> re-establish the network connection here. But it quickly fails, and the
> (kill-buffer) still succeeds. With a yubikey it fails when I kill it and
> the (kill-buffer) fails too. TRAMP shouldn't be trying to re-establish
> the connection here probably.

When the buffer is modified, kill-buffer tries to unlock the respective
file. I've modified tramp-handle-unlock-file such a way that it ceases
to work when the connection is broken.

Pushed to master. Could you, pls, check?

> Thanks!

Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Sun, 19 Mar 2023 12:45:01 GMT) Full text and rfc822 format available.

Notification sent to Dima Kogan <dima <at> secretsauce.net>:
bug acknowledged by developer. (Sun, 19 Mar 2023 12:45:01 GMT) Full text and rfc822 format available.

Message #13 received at 61663-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 61663-done <at> debbugs.gnu.org
Subject: Re: bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill
 modified buffer without re-establishing a connection
Date: Sun, 19 Mar 2023 13:44:29 +0100
Version: 30.1

Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Dima,

> When the buffer is modified, kill-buffer tries to unlock the respective
> file. I've modified tramp-handle-unlock-file such a way that it ceases
> to work when the connection is broken.
>
> Pushed to master. Could you, pls, check?

No further response, so I assume the bug is fixed. Closing.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61663; Package emacs. (Sun, 19 Mar 2023 20:32:01 GMT) Full text and rfc822 format available.

Message #16 received at 61663 <at> debbugs.gnu.org (full text, mbox):

From: Dima Kogan <dima <at> secretsauce.net>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 61663 <at> debbugs.gnu.org
Subject: Re: bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill
 modified buffer without re-establishing a connection
Date: Sun, 19 Mar 2023 13:30:35 -0700
Hi Michael. I forgot to test this; apologies. I did just try out your
fix, and it does work for me. Thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 17 Apr 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.