GNU bug report logs - #55368
29.0.50; Unreliable input-pending-p and throw-on-input on Emacs 29 / pgtk in Wayland

Previous Next

Package: emacs;

Reported by: Vijay Marupudi <vijay <at> vijaymarupudi.com>

Date: Wed, 11 May 2022 13:36:01 UTC

Severity: normal

Tags: moreinfo

Found in version 29.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 55368 in the body.
You can then email your comments to 55368 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#55368; Package emacs. (Wed, 11 May 2022 13:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vijay Marupudi <vijay <at> vijaymarupudi.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 11 May 2022 13:36:01 GMT) Full text and rfc822 format available.

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

From: Vijay Marupudi <vijay <at> vijaymarupudi.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Unreliable input-pending-p and throw-on-input on Emacs 29
 / pgtk in Wayland
Date: Wed, 11 May 2022 08:34:56 -0500
Hello,

I would like to report an inconsistency issue with how pending input is
communicated with elisp code. In Emacs 29, input-pending-p sometimes
returns t and while-no-input is interrupting code (because it uses
throw-on-input) AFTER all keyboard input has already been read into
elisp code and is being processed, and when there is no pending input.
This is leading to code being unable to process and react to the latest
input because it gets interrupted while handling the latest input.

This issue does not occur in X.Org sessions, only Wayland.

This issue was initially encountered via the vertico ELPA package, for
more discussion and screencasts, see here.

https://github.com/minad/vertico/issues/226#issuecomment-1123087263

To replicate this bug, run this code, and then type very fast on your
keyboard. When I type the string "not" very fast, the printed message is
`"not", t`

(require 'cl-lib)

(defun my-hook ()
  (message "%S, %S" (minibuffer-contents)
           (while-no-input
             (cl-loop for i from 0 below 1000000
                      summing i))))

(minibuffer-with-setup-hook (lambda ()
                              (add-hook 'post-command-hook
                                        'my-hook
                                        nil t))
  (read-from-minibuffer "Text: "))

Setup information:

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
 of 2022-05-10 built on entropy
Repository revision: 430b5ba838f31865139e3a724f9191e2b1de57d1
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --with-json --with-pgtk --with-native-compilation
 --with-xinput2 --with-file-notification=inotify --with-mailutils'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Messages

Minor modes in effect:
  global-company-mode: t
  company-mode: t
  which-key-mode: t
  pdf-occur-global-minor-mode: t
  savehist-mode: t
  recentf-mode: t
  marginalia-mode: t
  vertico-mode: t
  show-smartparens-global-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  override-global-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/vijaymarupudi/.emacs.d/elpa/transient-20220509.1943/transient hides /usr/local/share/emacs/29.0.50/lisp/transient

Features:
(shadow sort mail-extr emacsbug misearch multi-isearch vc-mtn vc-hg
vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc
vc-dispatcher vertico-directory mule-util vj-notmuch-config vj-diff
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb company cape vj-wiki vj-elisp vj-capture bbt which-key
typescript-mode cc-mode-expansions smartparens-c cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
lsp-pyright pdf-occur ibuf-ext ibuffer ibuffer-loaddefs tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local find-func cedet
pdf-isearch let-alist pdf-misc pdf-loader pdf-tools pdf-view jka-compr
pdf-cache pdf-info pdf-util pdf-macs image-mode exif lsp-mode
lsp-protocol spinner network-stream nsm lv inline ht f s ewoc slime
arc-mode archive-mode hyperspec geiser-guile info-look geiser
geiser-repl geiser-compile geiser-debug compile geiser-image geiser-capf
geiser-doc geiser-menu geiser-edit etags fileloop generator xref project
geiser-completion geiser-autodoc geiser-eval geiser-connection tq
geiser-syntax scheme geiser-log geiser-popup view ein
smartparens-markdown markdown-mode color noutline outline savehist
embark-consult consult-vertico consult compat-28 recentf tree-widget
magit-bookmark bookmark notmuch notmuch-tree notmuch-jump notmuch-hello
notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-message
notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company
notmuch-parser notmuch-wash coolj notmuch-query goto-addr icalendar
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag
notmuch-lib notmuch-version notmuch-compat hl-line mm-view mml-smime
smime gnutls dig vj-embark embark ffap marginalia orderless vertico
expand-region text-mode-expansions er-basic-expansions
expand-region-core expand-region-custom smartparens-config
smartparens-text smartparens advice rainbow-delimiters magit-submodule
magit-obsolete magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff diff-mode git-commit log-edit message eudc-capf eudc
cus-edit pp cus-load eudc-vars sendmail yank-media rmc dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader pcvs-util add-log magit-core
magit-autorevert magit-margin magit-transient magit-process with-editor
shell pcomplete comint ansi-color magit-mode transient edmacro kmacro
magit-git magit-base magit-section format-spec crm dash compat-27
compat-26 compat exec-path-from-shell eww xdg url-queue thingatpt shr
pixel-fill kinsoku url-file url-dired svg dom puny mm-url gnus nnheader
gnus-util text-property-search time-date mail-utils range wid-edit
mm-util mail-prsvr notifications dbus xml use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core modus-operandi-theme modus-themes pcase
autorevert filenotify delsel display-line-numbers comp comp-cstr
warnings rx cl-extra server geiser-impl help-fns radix-tree help-mode
geiser-custom geiser-base ring slime-autoloads info package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars
seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice
simple cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help
abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face
macroexp files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 542628 440465)
 (symbols 48 42850 1)
 (strings 32 143837 32615)
 (string-bytes 1 6262187)
 (vectors 16 75716)
 (vector-slots 8 1324303 604428)
 (floats 8 410 1561)
 (intervals 56 1363 434)
 (buffers 992 17))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55368; Package emacs. (Fri, 13 May 2022 02:02:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Vijay Marupudi <vijay <at> vijaymarupudi.com>
Cc: 55368 <at> debbugs.gnu.org
Subject: Re: bug#55368: 29.0.50; Unreliable input-pending-p and
 throw-on-input on Emacs 29 / pgtk in Wayland
Date: Fri, 13 May 2022 10:01:18 +0800
Vijay Marupudi <vijay <at> vijaymarupudi.com> writes:

> Hello,
>
> I would like to report an inconsistency issue with how pending input is
> communicated with elisp code. In Emacs 29, input-pending-p sometimes
> returns t and while-no-input is interrupting code (because it uses
> throw-on-input) AFTER all keyboard input has already been read into
> elisp code and is being processed, and when there is no pending input.
> This is leading to code being unable to process and react to the latest
> input because it gets interrupted while handling the latest input.
>
> This issue does not occur in X.Org sessions, only Wayland.

Does that mean the bug doesn't happen in the regular X build, or does it
mean that nothing happens if you run the PGTK build under X Windows?

And what happens if you comment out this code in `readable_events' in
keyboard.c?

  if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES) && some_mouse_moved ())
    return 1;
  if (single_kboard)
    {
      if (current_kboard->kbd_queue_has_data)
	return 1;
    }
  else
    {
      KBOARD *kb;
      for (kb = all_kboards; kb; kb = kb->next_kboard)
	if (kb->kbd_queue_has_data)
	  return 1;
    }




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55368; Package emacs. (Fri, 13 May 2022 15:08:01 GMT) Full text and rfc822 format available.

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

From: Vijay Marupudi <vijay <at> vijaymarupudi.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 55368 <at> debbugs.gnu.org
Subject: Re: bug#55368: 29.0.50; Unreliable input-pending-p and
 throw-on-input on Emacs 29 / pgtk in Wayland
Date: Fri, 13 May 2022 10:07:12 -0500
I cannot reproduce the bug anymore, not sure why. The screencasts I
had provided in the Github issue show that experienced it, but for
some reason I don't see it anymore. I tried bisecting the commits, and
I couldn't find the commit with the bug anymore.

Sorry about that. There might be numerous reason why I can't replicate
this bug anymore One reason could be that there was some bug fixed in
the packages that had been updated since then. I have included the
list of packages that have been upgraded for archival reasons.

Additionally, it is possible that I might have forgotten to call
autoreconf -vif and ./configure --options ... before compiling the
version of Emacs and there might have been some stale files linked in.
I have no way of checking this now.

Po Lu <luangruo <at> yahoo.com> writes:

> Does that mean the bug doesn't happen in the regular X build, or does it
> mean that nothing happens if you run the PGTK build under X Windows?

For archival reasons, this happened in PGTK in Wayland, but not in
PGTK in X.Org.

Sorry about the inconvenience. This bug can be closed.

Packages that have been upgraded since then:

[2022-05-11T08:02:35-0500] gnutls
[2022-05-11T08:02:35-0500] sqlite
[2022-05-11T08:02:35-0500] chromium
[2022-05-11T08:02:35-0500] criu
[2022-05-11T08:02:36-0500] pyright
[2022-05-11T08:06:39-0500] google-cloud-sdk
[2022-05-11T10:11:14-0500] wireplumber
[2022-05-11T18:45:23-0500] curl
[2022-05-11T18:45:23-0500] fuse-common
[2022-05-11T18:45:23-0500] fuse3
[2022-05-11T18:45:23-0500] intel-ucode
[2022-05-11T18:45:24-0500] linux
[2022-05-11T18:45:24-0500] nvidia
[2022-05-11T18:45:24-0500] psmisc
[2022-05-12T11:01:59-0500] bubblewrap
[2022-05-12T11:01:59-0500] libxml2
[2022-05-12T11:01:59-0500] libnotify
[2022-05-12T11:01:59-0500] gnome-todo
[2022-05-12T11:01:59-0500] python-setuptools
[2022-05-12T11:01:59-0500] jupyterlab
[2022-05-12T11:01:59-0500] python-cryptography
[2022-05-12T20:27:43-0500] pcsclite
[2022-05-12T20:27:43-0500] postgresql-libs
[2022-05-13T08:51:14-0500] jupyterlab
[2022-05-13T08:51:14-0500] librsvg
[2022-05-13T08:51:14-0500] mobile-broadband-provider-info
[2022-05-13T08:51:14-0500] noto-fonts
[2022-05-13T08:51:14-0500] pcsclite
[2022-05-13T08:51:15-0500] vulkan-headers
[2022-05-13T08:51:15-0500] vulkan-icd-loader

~ Vijay




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55368; Package emacs. (Sat, 14 May 2022 00:55:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Vijay Marupudi <vijay <at> vijaymarupudi.com>
Cc: 55368 <at> debbugs.gnu.org
Subject: Re: bug#55368: 29.0.50; Unreliable input-pending-p and
 throw-on-input on Emacs 29 / pgtk in Wayland
Date: Sat, 14 May 2022 08:54:44 +0800
Vijay Marupudi <vijay <at> vijaymarupudi.com> writes:

> I cannot reproduce the bug anymore, not sure why. The screencasts I
> had provided in the Github issue show that experienced it, but for
> some reason I don't see it anymore. I tried bisecting the commits, and
> I couldn't find the commit with the bug anymore.
>
> Sorry about that. There might be numerous reason why I can't replicate
> this bug anymore One reason could be that there was some bug fixed in
> the packages that had been updated since then. I have included the
> list of packages that have been upgraded for archival reasons.
>
> Additionally, it is possible that I might have forgotten to call
> autoreconf -vif and ./configure --options ... before compiling the
> version of Emacs and there might have been some stale files linked in.
> I have no way of checking this now.

I would rather keep this bug open for a little more time, in case you
(or someone else) runs into the bug again.

Thanks for trying.




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 14 May 2022 02:54:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55368; Package emacs. (Sat, 11 Jun 2022 11:08:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 55368 <at> debbugs.gnu.org, Vijay Marupudi <vijay <at> vijaymarupudi.com>
Subject: Re: bug#55368: 29.0.50; Unreliable input-pending-p and
 throw-on-input on Emacs 29 / pgtk in Wayland
Date: Sat, 11 Jun 2022 13:07:44 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> I would rather keep this bug open for a little more time, in case you
> (or someone else) runs into the bug again.

This was a month ago, and apparently nobody ran into the problem again,
so I'm closing this bug report.  If anybody sees it, please respond to
the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 55368 <at> debbugs.gnu.org and Vijay Marupudi <vijay <at> vijaymarupudi.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 11 Jun 2022 11:08:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 1 year and 285 days ago.

Previous Next


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