Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frames do not match in 'not top level in wrap-native for #<subr read-event>' (root case: TTY terminal init happens in each new TTY emacsclient (emacsclient -nw), which does readkey) #50

Closed
nolanl opened this issue Jul 3, 2020 · 8 comments · Fixed by #53
Labels
bug Something isn't working has-repro Has a repro case

Comments

@nolanl
Copy link

nolanl commented Jul 3, 2020

Ran "emacsclient -nw" and got a "explain-pause-mode-report-bug" buffer containing:

Explain-pause-mode: please report this bug by creating a Github
issue at https://github.com/lastquestion/explain-pause-mode. Explain-pause-mode
is now _disabled_ so you can continue to hopefully use Emacs. Info follows:


frames do not match in 'not top level in wrap-native for #<subr read-event>'
current:
#s(explain-pause-command-record root-emacs nil nil -1 (24319 39098 109174 270000) nil nil nil nil 0)
test:
#s(explain-pause-command-record root-emacs nil nil -1 (24319 39098 109174 270000) nil nil nil nil 0)


Backtrace:
  backtrace()
  (progn (princ "Explain-pause-mode: please report this bug by creating a Github\012issue at https://github.com/lastquestion/explain-pause\
-mode. Explain-pause-mode\012is now _disabled_ so you can continue to hopefully use Emacs. Info follows:\012\012\012") (princ (format "fra\
mes do not match in '%s'\012current:\012%s\012test:\012%s\012\012\012" where current-command test-command)) (princ "Backtrace:\012") (back\
trace))
  (prog1 (progn (princ "Explain-pause-mode: please report this bug by creating a Github\012issue at https://github.com/lastquestion/explai\
n-pause-mode. Explain-pause-mode\012is now _disabled_ so you can continue to hopefully use Emacs. Info follows:\012\012\012") (princ (form\
at "frames do not match in '%s'\012current:\012%s\012test:\012%s\012\012\012" where current-command test-command)) (princ "Backtrace:\012"\
) (backtrace)) (internal-temp-output-buffer-show buf))
  (let* ((old-dir default-directory) (buf (save-current-buffer (set-buffer (get-buffer-create "explain-pause-mode-report-bug")) (prog1 (cu\
rrent-buffer) (kill-all-local-variables) (setq default-directory old-dir) (setq buffer-read-only nil) (setq buffer-file-name nil) (setq bu\
ffer-undo-list t) (let ((inhibit-read-only t) (inhibit-modification-hooks t)) (erase-buffer) (run-hooks (quote temp-buffer-setup-hook)))))\
) (standard-output buf)) (prog1 (progn (princ "Explain-pause-mode: please report this bug by creating a Github\012issue at https://github.\
com/lastquestion/explain-pause-mode. Explain-pause-mode\012is now _disabled_ so you can continue to hopefully use Emacs. Info follows:\012\
\012\012") (princ (format "frames do not match in '%s'\012current:\012%s\012test:\012%s\012\012\012" where current-command test-command)) \
(princ "Backtrace:\012") (backtrace)) (internal-temp-output-buffer-show buf)))
  explain-pause-report-measuring-bug("not top level in wrap-native for #<subr read-event>" #s(explain-pause-command-record root-emacs nil \
nil -1 (24319 39098 109174 270000) nil nil nil nil 0) #s(explain-pause-command-record root-emacs nil nil -1 (24319 39098 109174 270000) ni\
l nil nil nil 0))
  (if (eq explain-pause--current-command-record explain-pause-root-command-loop) (explain-pause-report-measuring-bug (format "not top leve\
l in %s" (format "wrap-native for %s" original-func)) explain-pause--current-command-record explain-pause-root-command-loop) (let ((curren\
t-record explain-pause--current-command-record)) (explain-pause--command-record-and-store current-record) (let ((new-frame (explain-pause-\
-command-record-from-parent current-record current-record original-func t))) (progn (explain-pause-log--send-command-entry explain-pause--\
current-command-record new-frame) (setq explain-pause--current-command-record new-frame) (let ((should-profile (explain-pause--command-rec\
ord-profile-p new-frame))) (if should-profile (progn (explain-pause--command-record-start-profiling new-frame))) (progn (or (and ... t) (s\
ignal ... ...)) (let* (...) (aset v 5 ...))) (unwind-protect (apply original-func args) (explain-pause--command-record-and-store new-frame\
) (if should-profile (progn ...)) (explain-pause-log--send-command-exit new-frame) (if (not ...) (explain-pause-report-measuring-bug ... e\
xplain-pause--current-command-record new-frame) (explain-pause--run-measure-hook new-frame) (progn ... ...) (setq explain-pause--current-c\
ommand-record current-record))))))))
  explain-pause--wrap-native(#<subr read-event> nil nil 2)
  apply(explain-pause--wrap-native #<subr read-event> (nil nil 2))
  read-event(nil nil 2)
  xterm--query("\033[>0c" (("\033[?" . xterm--version-handler) ("\033[>" . xterm--version-handler)))
  terminal-init-xterm()
  tty-run-terminal-initialization(#<frame F3 0x580f530> nil t)
  tty-create-frame-with-faces(((right-fringe . 12) (left-fringe . 12) (vertical-scroll-bars) (font . "Monospace-9") (horizontal-scroll-bar\
s) (window-system) (tty . "/dev/pts/0") (tty-type . "xterm-256color") (client . #<process server <2>>) (environment "OLDPWD=/home/nolan/.e\
macs.d/elisp" "_=/usr/bin/emacsclient" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" "GDMSESSION=lightdm-xsession" "ALACRITTY_LO\
G=/tmp/Alacritty-1803.log" "PATH=/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/hom\
e/nolan/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin:/sbin:/usr/sbin:/usr/local/sbin" "XDG\
_DATA_DIRS=/home/nolan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share" "GCC_COLORS=error=01\
;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01" "XDG_RUNTIME_DIR=/run/user/1000" "XDG_SESSION_ID=1" "XDG_VTNR=7" "SHLVL=2" "DI\
SPLAY=:0" "AUTOJUMP_SOURCED=1" "USER=nolan" "TERM=xterm-256color" "XDG_SESSION_CLASS=user" "XDG_SEAT_PATH=/org/freedesktop/DisplayManager/\
Seat0" "PYTHONSTARTUP=/home/nolan/.pythonrc" "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or\
=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31\
:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01\
;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.de\
b=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;3\
1:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*\
.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz\
=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;\
35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.f\
lv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:\
*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opu\
s=00;36:*.spx=00;36:*.xspf=00;36:" "LANG=en_US.UTF-8" "AUTOJUMP_ERROR_PATH=/home/nolan/.local/share/autojump/errors.log" "HOME=/home/nolan\
" "GDM_LANG=en_US.utf8" "XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/nolan" "XAUTHORITY=/home/nolan/.Xauthority" "GPG_AGENT_INFO=/run/user/\
1000/gnupg/S.gpg-agent:0:1" "XDG_SESSION_TYPE=x11" "QT_QPA_PLATFORMTHEME=qt5ct" "LOGNAME=nolan" "XDG_SESSION_DESKTOP=lightdm-xsession" "PW\
D=/home/nolan/.emacs.d" "XDG_SEAT=seat0" "SSH_AGENT_PID=1717" "DESKTOP_SESSION=lightdm-xsession" "SSH_AUTH_SOCK=/run/user/1000/keyring/ssh\
" "XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0" "COLORTERM=truecolor" "QT_ACCESSIBILITY=1" "WINDOWID=33554434" "SHELL=/bin/b\
ash")))
  #[257 "\300\001!\207" [tty-create-frame-with-faces] 3 "\012\012(fn PARAMS)"](((right-fringe . 12) (left-fringe . 12) (vertical-scroll-ba\
rs) (font . "Monospace-9") (horizontal-scroll-bars) (window-system) (tty . "/dev/pts/0") (tty-type . "xterm-256color") (client . #<process\
 server <2>>) (environment "OLDPWD=/home/nolan/.emacs.d/elisp" "_=/usr/bin/emacsclient" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000\
/bus" "GDMSESSION=lightdm-xsession" "ALACRITTY_LOG=/tmp/Alacritty-1803.log" "PATH=/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.carg\
o/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/nolan/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr\
/local/sbin:/sbin:/usr/sbin:/usr/local/sbin" "XDG_DATA_DIRS=/home/nolan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:\
/usr/local/share:/usr/share" "GCC_COLORS=error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01" "XDG_RUNTIME_DIR=/run/user/10\
00" "XDG_SESSION_ID=1" "XDG_VTNR=7" "SHLVL=2" "DISPLAY=:0" "AUTOJUMP_SOURCED=1" "USER=nolan" "TERM=xterm-256color" "XDG_SESSION_CLASS=user\
" "XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0" "PYTHONSTARTUP=/home/nolan/.pythonrc" "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=4\
0;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;3\
1:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t\
7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.\
bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;\
31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jp\
eg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=\
01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;\
35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.r\
mvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;3\
5:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.o\
gg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:" "LANG=en_US.UTF-8" "AUTOJUMP_ERROR_PATH=/home/nolan/.l\
ocal/share/autojump/errors.log" "HOME=/home/nolan" "GDM_LANG=en_US.utf8" "XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/nolan" "XAUTHORITY=/h\
ome/nolan/.Xauthority" "GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1" "XDG_SESSION_TYPE=x11" "QT_QPA_PLATFORMTHEME=qt5ct" "LOGNAME=\
nolan" "XDG_SESSION_DESKTOP=lightdm-xsession" "PWD=/home/nolan/.emacs.d" "XDG_SEAT=seat0" "SSH_AGENT_PID=1717" "DESKTOP_SESSION=lightdm-xs\
ession" "SSH_AUTH_SOCK=/run/user/1000/keyring/ssh" "XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0" "COLORTERM=truecolor" "QT_A\
CCESSIBILITY=1" "WINDOWID=33554434" "SHELL=/bin/bash")))
  apply(#[257 "\300\001!\207" [tty-create-frame-with-faces] 3 "\012\012(fn PARAMS)"] ((right-fringe . 12) (left-fringe . 12) (vertical-scr\
oll-bars) (font . "Monospace-9") (horizontal-scroll-bars) (window-system) (tty . "/dev/pts/0") (tty-type . "xterm-256color") (client . #<p\
rocess server <2>>) (environment "OLDPWD=/home/nolan/.emacs.d/elisp" "_=/usr/bin/emacsclient" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/use\
r/1000/bus" "GDMSESSION=lightdm-xsession" "ALACRITTY_LOG=/tmp/Alacritty-1803.log" "PATH=/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan\
/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/nolan/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbi\
n:/usr/local/sbin:/sbin:/usr/sbin:/usr/local/sbin" "XDG_DATA_DIRS=/home/nolan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/\
share:/usr/local/share:/usr/share" "GCC_COLORS=error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01" "XDG_RUNTIME_DIR=/run/u\
ser/1000" "XDG_SESSION_ID=1" "XDG_VTNR=7" "SHLVL=2" "DISPLAY=:0" "AUTOJUMP_SOURCED=1" "USER=nolan" "TERM=xterm-256color" "XDG_SESSION_CLAS\
S=user" "XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0" "PYTHONSTARTUP=/home/nolan/.pythonrc" "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=0\
0:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.ta\
r=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;\
31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01\
;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.a\
lz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;3\
5:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:\
*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.m\
kv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;\
35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.em\
f=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;\
36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:" "LANG=en_US.UTF-8" "AUTOJUMP_ERROR_PATH=/home/no\
lan/.local/share/autojump/errors.log" "HOME=/home/nolan" "GDM_LANG=en_US.utf8" "XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/nolan" "XAUTHOR\
ITY=/home/nolan/.Xauthority" "GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1" "XDG_SESSION_TYPE=x11" "QT_QPA_PLATFORMTHEME=qt5ct" "LO\
GNAME=nolan" "XDG_SESSION_DESKTOP=lightdm-xsession" "PWD=/home/nolan/.emacs.d" "XDG_SEAT=seat0" "SSH_AGENT_PID=1717" "DESKTOP_SESSION=ligh\
tdm-xsession" "SSH_AUTH_SOCK=/run/user/1000/keyring/ssh" "XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0" "COLORTERM=truecolor"\
 "QT_ACCESSIBILITY=1" "WINDOWID=33554434" "SHELL=/bin/bash")))
  frame-creation-function(((right-fringe . 12) (left-fringe . 12) (vertical-scroll-bars) (font . "Monospace-9") (horizontal-scroll-bars) (\
window-system) (tty . "/dev/pts/0") (tty-type . "xterm-256color") (client . #<process server <2>>) (environment "OLDPWD=/home/nolan/.emacs\
.d/elisp" "_=/usr/bin/emacsclient" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" "GDMSESSION=lightdm-xsession" "ALACRITTY_LOG=/t\
mp/Alacritty-1803.log" "PATH=/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/no\
lan/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin:/sbin:/usr/sbin:/usr/local/sbin" "XDG_DAT\
A_DIRS=/home/nolan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share" "GCC_COLORS=error=01;31:\
warning=01;35:note=01;36:caret=01;32:locus=01:quote=01" "XDG_RUNTIME_DIR=/run/user/1000" "XDG_SESSION_ID=1" "XDG_VTNR=7" "SHLVL=2" "DISPLA\
Y=:0" "AUTOJUMP_SOURCED=1" "USER=nolan" "TERM=xterm-256color" "XDG_SESSION_CLASS=user" "XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat\
0" "PYTHONSTARTUP=/home/nolan/.pythonrc" "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;\
31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.l\
ha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:\
*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01\
;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.\
rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp\
=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;\
35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*\
.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=0\
1;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.fl\
ac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00\
;36:*.spx=00;36:*.xspf=00;36:" "LANG=en_US.UTF-8" "AUTOJUMP_ERROR_PATH=/home/nolan/.local/share/autojump/errors.log" "HOME=/home/nolan" "G\
DM_LANG=en_US.utf8" "XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/nolan" "XAUTHORITY=/home/nolan/.Xauthority" "GPG_AGENT_INFO=/run/user/1000\
/gnupg/S.gpg-agent:0:1" "XDG_SESSION_TYPE=x11" "QT_QPA_PLATFORMTHEME=qt5ct" "LOGNAME=nolan" "XDG_SESSION_DESKTOP=lightdm-xsession" "PWD=/h\
ome/nolan/.emacs.d" "XDG_SEAT=seat0" "SSH_AGENT_PID=1717" "DESKTOP_SESSION=lightdm-xsession" "SSH_AUTH_SOCK=/run/user/1000/keyring/ssh" "X\
DG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0" "COLORTERM=truecolor" "QT_ACCESSIBILITY=1" "WINDOWID=33554434" "SHELL=/bin/bash"\
)))
  make-frame(((window-system) (tty . "/dev/pts/0") (tty-type . "xterm-256color") (client . #<process server <2>>) (environment "OLDPWD=/ho\
me/nolan/.emacs.d/elisp" "_=/usr/bin/emacsclient" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" "GDMSESSION=lightdm-xsession" "A\
LACRITTY_LOG=/tmp/Alacritty-1803.log" "PATH=/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.car\
go/bin:/home/nolan/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin:/sbin:/usr/sbin:/usr/local\
/sbin" "XDG_DATA_DIRS=/home/nolan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share" "GCC_COLO\
RS=error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01" "XDG_RUNTIME_DIR=/run/user/1000" "XDG_SESSION_ID=1" "XDG_VTNR=7" "S\
HLVL=2" "DISPLAY=:0" "AUTOJUMP_SOURCED=1" "USER=nolan" "TERM=xterm-256color" "XDG_SESSION_CLASS=user" "XDG_SEAT_PATH=/org/freedesktop/Disp\
layManager/Seat0" "PYTHONSTARTUP=/home/nolan/.pythonrc" "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=\
40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:\
*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01\
;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz\
=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;3\
1:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.\
gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=0\
1;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;3\
5:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fl\
i=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:\
*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=\
00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:" "LANG=en_US.UTF-8" "AUTOJUMP_ERROR_PATH=/home/nolan/.local/share/autojump/errors.log" "HOME=\
/home/nolan" "GDM_LANG=en_US.utf8" "XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/nolan" "XAUTHORITY=/home/nolan/.Xauthority" "GPG_AGENT_INFO\
=/run/user/1000/gnupg/S.gpg-agent:0:1" "XDG_SESSION_TYPE=x11" "QT_QPA_PLATFORMTHEME=qt5ct" "LOGNAME=nolan" "XDG_SESSION_DESKTOP=lightdm-xs\
ession" "PWD=/home/nolan/.emacs.d" "XDG_SEAT=seat0" "SSH_AGENT_PID=1717" "DESKTOP_SESSION=lightdm-xsession" "SSH_AUTH_SOCK=/run/user/1000/\
keyring/ssh" "XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0" "COLORTERM=truecolor" "QT_ACCESSIBILITY=1" "WINDOWID=33554434" "S\
HELL=/bin/bash")))
  server-create-tty-frame("/dev/pts/0" "xterm-256color" #<process server <2>>)
  server-process-filter(#<process server <2>> "-env SHELL=/bin/bash -env WINDOWID=33554434 -env QT_ACCESSIBILITY=1 -env COLORTERM=truecolo\
r -env XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0 -env SSH_AUTH_SOCK=/run/user/1000/keyring/ssh -env DESKTOP_SESSION=lightd\
m-xsession -env SSH_AGENT_PID=1717 -env XDG_SEAT=seat0 -env PWD=/home/nolan/.emacs.d -env XDG_SESSION_DESKTOP=lightdm-xsession -env LOGNAM\
E=nolan -env QT_QPA_PLATFORMTHEME=qt5ct -env XDG_SESSION_TYPE=x11 -env GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1 -env XAUTHORITY\
=/home/nolan/.Xauthority -env XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/nolan -env GDM_LANG=en_US.utf8 -env HOME=/home/nolan -env AUTOJUM\
P_ERROR_PATH=/home/nolan/.local/share/autojump/errors.log -env LANG=en_US.UTF-8 -env LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01\
;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01\
;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*\
.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*\
.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=0\
1;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*\
.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.ti\
ff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=\
01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:\
*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01\
;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*\
.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: -env PYTHONSTARTUP=/home/nolan/.pythonrc -env XDG_SEAT_PATH=/org/\
freedesktop/DisplayManager/Seat0 -env XDG_SESSION_CLASS=user -env TERM=xterm-256color -env USER=nolan -env AUTOJUMP_SOURCED=1 -env DISPLAY\
=:0 -env SHLVL=2 -env XDG_VTNR=7 -env XDG_SESSION_ID=1 -env XDG_RUNTIME_DIR=/run/user/1000 -env GCC_COLORS=error=01;31:warning=01;35:note=\
01;36:caret=01;32:locus=01:quote=01 -env XDG_DATA_DIRS=/home/nolan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/\
local/share:/usr/share -env PATH=/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/home/nolan/bin:/home/nolan/.cargo/bin:/hom\
e/nolan/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin:/sbin:/usr/sbin:/usr/local/sbin -env \
ALACRITTY_LOG=/tmp/Alacritty-1803.log -env GDMSESSION=lightdm-xsession -env DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus -env _=/\
usr/bin/emacsclient -env OLDPWD=/home/nolan/.emacs.d/elisp -dir /home/nolan/.emacs.d/ -tty /dev/pts/0 xterm-256color -file init.el \012")
@lastquestion
Copy link
Owner

Hi, I literally just discovered this also just now while trying to make a video for the README.

Uh, I tested new frames and emacsclient in windowed mode, I tested emacsclient in TTY, but I didn't test TTY emacsclient when you "create a new TTY window", because, I didn't know that feature existed.... O.o

I already have a fix halfway written... thanks for reporting ❤️ should have that done in a couple hours...

Also, this backtrace shows I need to update the README even more and make sure people bytecompile, it's way faster bytecompiled now.

@lastquestion lastquestion added bug Something isn't working has-repro Has a repro case labels Jul 3, 2020
@lastquestion lastquestion changed the title frames do not match in 'not top level in wrap-native for #<subr read-event>' frames do not match in 'not top level in wrap-native for #<subr read-event>' (root case: TTY terminal init happens in each new TTY emacsclient (emacsclient -nw), which does readkey) Jul 3, 2020
@lastquestion
Copy link
Owner

Further details:

  1. If explain-pause-mode is activated AND HOOKS before server-start, then the server-process-filter will be hooked, and everything works.
  2. IF:
    a) You run explain-pause-mode AFTER server-start, you're screwed.
    b) If explain-pause-mode is activated in init.el, it will not hook until emacs-startup-hook is run, because of the exact problem of read-event which is exactly what this bug is about! https://github.com/lastquestion/explain-pause-mode/blob/master/explain-pause-mode.el#L3253-L3258, so if you run server-start in init.el, you're screwed.
    c) Running with --daemon or --fg-daemon in the command line means server-start happens after init.el is loaded. But, before emacs-startup-hook`. You're screwed again.

Conclusions:

  1. emacs-startup-hook is too late. Handle terminal-init-xterm specially, and insert a frame just for it, so that the subsequent read-events have a non-root parent frame. Then we can finish hooking during init.el, which resolves cases (b) and (c).
  2. Still, if you install explain-pause-mode after some existing processes are running, we shouldn't crash. When installing, find every existing process using process-list and wrap their filters if existing with wrappers. This fixes (a).

lastquestion added a commit that referenced this issue Jul 4, 2020
functions. Install earlier when called in init.el.

* When enabled, wrap all existing processes and timers, so that if
they call newly advised functions, the command stack is correct.

* Advise `terminal-init-xterm` specially, because it calls
`read-event`. This happens during emacs display system initialization,
outside any user-action, so it didn't have a command record. By adding
one, we can startup earlier.. so

* Make explain-pause-mode install hooks immediately when loaded
directly in init.el but not when called from the command-line (as
calling from the commandline has `call-interactively` interleaved.)

This fixes #50.
@lastquestion
Copy link
Owner

hi @nolanl , this should fix it #53, I'd like to add tests before merging to master, but the branch does fix the problem if you need it now. Thanks for reporting this bug!! ❤️

@lastquestion lastquestion added this to To do in Explain-pause-mode via automation Jul 4, 2020
@lastquestion lastquestion moved this from To do to In progress in Explain-pause-mode Jul 4, 2020
@condy0919
Copy link

Explain-pause-mode: please report this bug by creating a Github
issue at https://github.com/lastquestion/explain-pause-mode. Explain-pause-mode
is now _disabled_ so you can continue to hopefully use Emacs. Info follows:


frames do not match in 'not top level in wrap-native for #<subr read-event>'
current:
#s(explain-pause-command-record root-emacs nil nil 1146334 (24320 27529 114676 750000) nil nil nil nil 0)
test:
#s(explain-pause-command-record root-emacs nil nil 1146334 (24320 27529 114676 750000) nil nil nil nil 0)


Backtrace:
  backtrace()
  explain-pause-report-measuring-bug("not top level in wrap-native for #<subr read-event..." #s(explain-pause-command-record :command root-emacs :native nil :parent nil :executing-time 1146334 :entry-snap (24320 27529 114676 750000) :too-slow nil :is-profiled nil :under-profile nil :profile nil :depth 0) #s(explain-pause-command-record :command root-emacs :native nil :parent nil :executing-time 1146334 :entry-snap (24320 27529 114676 750000) :too-slow nil :is-profiled nil :under-profile nil :profile nil :depth 0))
  explain-pause--wrap-native(#<subr read-event> nil t 3)
  apply(explain-pause--wrap-native #<subr read-event> (nil t 3))
  read-event(nil t 3)
  sit-for(3)
  flyspell-check-word-p()
  flyspell-post-command-hook()

May be helpful.

@lastquestion
Copy link
Owner

@condy0919 let me move this bug into another bug. I am going to merge this bug fix today as I wrote a test case for it and it will automatically close the issue when the PR is merged. Plus it’s a different bug - the call stack indicates it’s in post command hook - I know what’s wrong, fix it today. Sorry for breaking all the things in that big PR :( at least I added a bug report feature HAHA

lastquestion added a commit that referenced this issue Jul 4, 2020
* Test that we wrap all existing things during init.
lastquestion added a commit that referenced this issue Jul 4, 2020
* When enabled, wrap all existing processes and timers, so that if
they call newly advised functions, the command stack is correct.

This fixes #50.
Explain-pause-mode automation moved this from In progress to Done Jul 4, 2020
lastquestion added a commit that referenced this issue Jul 4, 2020
* When enabled, wrap all existing processes and timers, so that if
they call newly advised functions, the command stack is correct.

This fixes #50.
@lastquestion
Copy link
Owner

I've merged this, @nolanl let me know if it works or not. I did manually test emacsclient -nw and it works, so I believe so :_)

lastquestion added a commit that referenced this issue Jul 4, 2020
@nolanl
Copy link
Author

nolanl commented Jul 4, 2020

Wow, fast turnaround. Thanks!

@lastquestion
Copy link
Owner

I felt embarrassment for missing that especially after writing so many tests 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-repro Has a repro case
Projects
Development

Successfully merging a pull request may close this issue.

3 participants