From: Gemini Lasswell <gazally@runbox.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32537@debbugs.gnu.org
Subject: bug#32537: 26.1.50; Tramp: Cursor jumps when typing during asynchronous find-file
Date: Wed, 29 Aug 2018 10:55:35 -0700 [thread overview]
Message-ID: <87wos9vyzs.fsf@runbox.com> (raw)
In-Reply-To: <83r2ih2poi.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 Aug 2018 17:49:33 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
> Hmm... does that mean tramp-sh-handle-file-attributes runs with
> *scratch* is its current buffer? It was *scratch* that you were
> typing into when this point jumps happened, right? It's strange that
> Tramp uses the current buffer for its processing, but Michael should
> know.
Yes, I was typing into *scratch*. I'm a gdb newbie, so here's what I
did:
1. From a shell, cd to src, run ./emacs -Q
2. M-x global-font-lock-mode RET
3. From another shell, cd to src, determine PID of Emacs and then run
gdb -p PID
4. Enter following commands to gdb:
source .gdbinit
set logging on
set height 0
p current_thread->m_current_buffer
break Fmake_thread
cont
5. Return to Emacs and enter:
C-x C-f C-a C-k /scp:server:src/emacs/lisp/emacs-lisp/b*.el RET
6. In gdb, enter the following:
clear
break set_point_both if current_thread->m_current_buffer == $1
commands
xbacktrace
cont
end
break temp_set_point_both if buffer == $1
commands
xbacktrace
cont
end
cont
8. Return to Emacs and type until the cursor makes a backward jump.
9. C-x C-c
> Wait a minute, why does self-insert-command run in a non-main thread?
> Could it be that somehow a non-main thread started receiving and
> interpreting your keyboard input? (The "find-file /scp:" thread is
> not the main thread, right?)
It looks to me like Thread 1 is the main thread, and the thread names
printed by gdb don't match what Emacs thinks they are. Thread 1 starts
out as "emacs" but its name changes after I continue from the
Fmake_thread breakpoint:
Thread 1 "emacs" hit Breakpoint 3, Fmake_thread (function=XIL(0x4867b15),
name=XIL(0x45b85a4)) at thread.c:768
768 {
Deleted breakpoint 3
Breakpoint 4 at 0x635530: file intervals.c, line 1826.
Type commands for breakpoint(s) 4, one per line.
End with a line saying just "end".
Breakpoint 5 at 0x635360: file intervals.c, line 1729.
Type commands for breakpoint(s) 5, one per line.
End with a line saying just "end".
Continuing.
[New Thread 0x7f1cad3e1700 (LWP 9151)]
Thread 1 "find-file /scp:" hit Breakpoint 5, temp_set_point_both (
buffer=0xdb5800 <bss_sbrk_buffer+458720>, charpos=charpos@entry=146,
bytepos=bytepos@entry=146) at intervals.c:1729
1729 {
"redisplay_internal (C function)" (0x0)
And then later in gdb.txt this thread shows up:
Thread 6 "emacs" hit Breakpoint 5, temp_set_point_both (
buffer=0xdb5800 <bss_sbrk_buffer+458720>, charpos=charpos@entry=151,
bytepos=bytepos@entry=151) at intervals.c:1729
1729 {
"redisplay_internal (C function)" (0x0)
"message" (0xaca48708)
"apply" (0xaca48700)
"tramp-sh-handle-file-local-copy" (0xaca492d8)
"apply" (0xaca492d0)
"tramp-sh-file-name-handler" (0xaca49700)
"apply" (0xaca496f8)
"tramp-file-name-handler" (0xaca4a750)
"file-local-copy" (0xaca4aa70)
"tramp-handle-insert-file-contents" (0xaca4b278)
"apply" (0xaca4b3c0)
"tramp-sh-file-name-handler" (0xaca4b668)
"apply" (0xaca4b838)
"tramp-file-name-handler" (0xaca4c878)
"insert-file-contents" (0xaca50eb8)
"find-file-noselect-1" (0xaca51270)
"find-file-noselect" (0xaca51810)
0x4860a20 PVEC_COMPILED
next prev parent reply other threads:[~2018-08-29 17:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-26 17:39 bug#32537: 26.1.50; Tramp: Cursor jumps when typing during asynchronous find-file Gemini Lasswell
2018-08-26 18:32 ` Eli Zaretskii
2018-08-28 19:48 ` Gemini Lasswell
2018-08-29 14:49 ` Eli Zaretskii
2018-08-29 17:55 ` Gemini Lasswell [this message]
2018-08-29 18:14 ` Eli Zaretskii
2018-08-30 18:49 ` Gemini Lasswell
2018-08-31 6:40 ` Eli Zaretskii
2018-08-31 16:52 ` Gemini Lasswell
2018-09-01 13:35 ` Eli Zaretskii
2018-09-01 15:27 ` Michael Albinus
2018-09-02 0:24 ` Gemini Lasswell
2018-09-02 2:35 ` Eli Zaretskii
2018-09-02 8:33 ` Michael Albinus
2018-09-02 16:09 ` Gemini Lasswell
2018-09-02 17:40 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wos9vyzs.fsf@runbox.com \
--to=gazally@runbox.com \
--cc=32537@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).