Subject: bug#29789: 25.1; Emacs blocks user input when using visual-fill-column in wide terminals

From: Luis Gerhorst <[email-masked]>
Date: Wed, 20 Dec 2017 20:28:27 +0100

1. Run Emacs in a wide terminal (about 150 characters, 100 isn't
enough): emacs -nw -Q

2. Load a arbitrary theme: M-x load-theme adwaita

3. Load visual-fill-column. E.g. by copying
https://raw.githubusercontent.com/joostkremers/visual-fill-column/c0e5ec8f88a7598f7afdee565978410bee0de2a0/visual-fill-column.el
into the scratch buffer and typing M-x eval-buffer.

There is nothing suspicious about the code, regular lisp code should not
be able to block Emacs (I believe). It does not seem to contain any loops that block the main thread. The maintainer knows about the issue but say's it may be an issue with low-level code. In GUI Emacs it works.

4. Open a buffer and enable visual-fill-column-mode: M-x
visual-fill-column-mode

5. Your Emacs is now blocked. In ZSH when I type C-g C-g I'm back in my
shell which displays the message "zsh: suspended emacs -nw -Q".

This bug has been encountered by multiple users on different operating
systems (Debian, Ubuntu and macOS) running different versions of Emacs
(24.5 to 26.0), some reported it here:
https://github.com/joostkremers/visual-fill-column/issues/1

In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-09-15, modified by Debian built on trouble
System Description:	Debian GNU/Linux 9.3 (stretch)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --with-x=yes --with-x-toolkit=gtk3
 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs25-wN2qS3/emacs25-25.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LC_CTYPE: C.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: GFM

Minor modes in effect:
  luis-text-wrap-mode: t
  visual-fill-column-mode: t
  adaptive-wrap-prefix-mode: t
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  ws-butler-mode: t
  show-paren-mode: t
  frame-restore-mode: t
  winner-mode: t
  global-company-mode: t
  company-mode: t
  which-key-mode: t
  flx-ido-mode: t
  ido-vertical-mode: t
  crm-custom-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  projectile-global-mode: t
  projectile-mode: t
  recentf-mode: t
  global-auto-revert-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent messages:
Source file ‘/home/cip/2016/un65esoq/.emacs.d/elpa/bind-key-2.3/bind-key.el’ newer than byte-compiled file
Loading /home/cip/2016/un65esoq/.emacs.d/recentf...done
Cleaning up the recentf list...done (0 removed)
Source file ‘/home/cip/2016/un65esoq/.emacs.d/elpa/s-1.12.0/s.el’ newer than byte-compiled file
Source file ‘/home/cip/2016/un65esoq/.emacs.d/elpa/company-0.9.4/company-dabbrev.el’ newer than byte-compiled file
Unable to load color "brightgreen" [12 times]
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark saved where search started
Visual-Fill-Column mode enabled in current buffer
GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian

Load-path shadows:
/home/cip/2016/un65esoq/.emacs.d/elpa/magit-2.11.0/magit-popup hides /home/cip/2016/un65esoq/.emacs.d/elpa/magit-popup-2.12.0/magit-popup
/home/cip/2016/un65esoq/.emacs.d/elpa/lua-mode-20151025/lua-mode hides /usr/share/emacs25/site-lisp/lua-mode/lua-mode
/home/cip/2016/un65esoq/.emacs.d/elpa/apache-mode-2.1/apache-mode hides /usr/share/emacs25/site-lisp/emacs-goodies-el/apache-mode
/home/cip/2016/un65esoq/.emacs.d/elpa/diminish-0.45/diminish hides /usr/share/emacs25/site-lisp/emacs-goodies-el/diminish
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-ispell hides /usr/share/emacs25/site-lisp/auctex/tex-ispell
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/context hides /usr/share/emacs25/site-lisp/auctex/context
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-buf hides /usr/share/emacs25/site-lisp/auctex/tex-buf
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/font-latex hides /usr/share/emacs25/site-lisp/auctex/font-latex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/preview hides /usr/share/emacs25/site-lisp/auctex/preview
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-jp hides /usr/share/emacs25/site-lisp/auctex/tex-jp
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex hides /usr/share/emacs25/site-lisp/auctex/tex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/latex hides /usr/share/emacs25/site-lisp/auctex/latex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/context-en hides /usr/share/emacs25/site-lisp/auctex/context-en
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/context-nl hides /usr/share/emacs25/site-lisp/auctex/context-nl
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-info hides /usr/share/emacs25/site-lisp/auctex/tex-info
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/bib-cite hides /usr/share/emacs25/site-lisp/auctex/bib-cite
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-mik hides /usr/share/emacs25/site-lisp/auctex/tex-mik
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-style hides /usr/share/emacs25/site-lisp/auctex/tex-style
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/plain-tex hides /usr/share/emacs25/site-lisp/auctex/plain-tex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-bar hides /usr/share/emacs25/site-lisp/auctex/tex-bar
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/multi-prompt hides /usr/share/emacs25/site-lisp/auctex/multi-prompt
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-font hides /usr/share/emacs25/site-lisp/auctex/tex-font
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-fold hides /usr/share/emacs25/site-lisp/auctex/tex-fold
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/toolbar-x hides /usr/share/emacs25/site-lisp/auctex/toolbar-x
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/texmathp hides /usr/share/emacs25/site-lisp/auctex/texmathp
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/prv-emacs hides /usr/share/emacs25/site-lisp/auctex/prv-emacs
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/auctex hides /usr/share/emacs/site-lisp/auctex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-site hides /usr/share/emacs/site-lisp/tex-site
/usr/share/emacs/25.1/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/25.1/site-lisp/why3 hides /usr/share/emacs/site-lisp/why3
/usr/share/emacs25/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/home/cip/2016/un65esoq/.emacs.d/elpa/dsvn-20130120.1257/dsvn hides /usr/share/emacs/site-lisp/dsvn
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/25.1/lisp/textmodes/rst
/home/cip/2016/un65esoq/.emacs.d/elpa/scala-mode-1.0.0/ob-scala hides /usr/share/emacs/25.1/lisp/org/ob-scala
/usr/share/emacs25/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/25.1/lisp/language/thai-word
/usr/share/emacs/25.1/site-lisp/slime/lib/ert-x hides /usr/share/emacs/25.1/lisp/emacs-lisp/ert-x
/usr/share/emacs/25.1/site-lisp/slime/lib/ert hides /usr/share/emacs/25.1/lisp/emacs-lisp/ert
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-ispell hides /usr/share/emacs/site-lisp/auctex/tex-ispell
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/preview hides /usr/share/emacs/site-lisp/auctex/preview
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex hides /usr/share/emacs/site-lisp/auctex/tex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/context-en hides /usr/share/emacs/site-lisp/auctex/context-en
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/context hides /usr/share/emacs/site-lisp/auctex/context
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/bib-cite hides /usr/share/emacs/site-lisp/auctex/bib-cite
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-buf hides /usr/share/emacs/site-lisp/auctex/tex-buf
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/plain-tex hides /usr/share/emacs/site-lisp/auctex/plain-tex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-mik hides /usr/share/emacs/site-lisp/auctex/tex-mik
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-bar hides /usr/share/emacs/site-lisp/auctex/tex-bar
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/latex hides /usr/share/emacs/site-lisp/auctex/latex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-font hides /usr/share/emacs/site-lisp/auctex/tex-font
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-info hides /usr/share/emacs/site-lisp/auctex/tex-info
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-fold hides /usr/share/emacs/site-lisp/auctex/tex-fold
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/context-nl hides /usr/share/emacs/site-lisp/auctex/context-nl
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-jp hides /usr/share/emacs/site-lisp/auctex/tex-jp
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/font-latex hides /usr/share/emacs/site-lisp/auctex/font-latex
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/multi-prompt hides /usr/share/emacs/site-lisp/auctex/multi-prompt
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/tex-style hides /usr/share/emacs/site-lisp/auctex/tex-style
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/texmathp hides /usr/share/emacs/site-lisp/auctex/texmathp
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/toolbar-x hides /usr/share/emacs/site-lisp/auctex/toolbar-x
/home/cip/2016/un65esoq/.emacs.d/elpa/auctex-12.1.0/prv-emacs hides /usr/share/emacs/site-lisp/auctex/prv-emacs

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils smex luis-text-wrap
visual-fill-column adaptive-wrap markdown-mode derived url-parse
url-vars noutline outline misearch multi-isearch dired-aux
minibuffer-complete-cycle vc-git diff-mode bookmark pp xcscope dired
term/xterm xterm paredit aggressive-indent lisp-mnt
luis-comment-auto-fill fillcode python tramp-sh tramp tramp-compat
auth-source eieio eieio-core gnus-util mm-util help-fns mail-prsvr
password-cache tramp-loaddefs trampver ucs-normalize shell pcomplete
format-spec json map cc-mode cc-fonts cc-guess cc-menus cc-styles
cc-align cc-cmds cc-engine cc-vars cc-defs cc-bytecomp ws-butler
elec-pair cap-words superword subword fic-mode company-jedi jedi-core
python-environment epc ctable concurrent deferred subr-x luis-iterm
luis-apps luis-mail luis-modes luis-terminal luis-xml luis-make
luis-scala luis-sbt luis-java luis-lua luis-asm luis-org luis-c luis-nxc
luis-python luis-apache luis-swift luis-css luis-shell luis-latex
luis-markdown luis-elisp luis-look paren solarized-dark-theme solarized
powerline cl-macs powerline-separators color powerline-themes
luis-user-interaction luis-misc desktop frameset frame-restore
luis-compile luis-movement saveplace winner luis-modification
whole-line-or-region company-keywords company-css company-dabbrev-code
company-dabbrev company-elisp find-func company luis-interactive
time-date which-key flx-ido flx ido-vertical-mode crm-custom
ido-completing-read+ warnings memoize s cus-edit cus-start cus-load ido
luis-files projectile grep compile comint ansi-color ring ibuf-ext
ibuffer dash thingatpt recentf tree-widget wid-edit autorevert
filenotify luis-integration use-package diminish bind-key luis-packages
cl-seq cl finder-inf edmacro kmacro info package epg-config seq byte-opt
gv bytecomp byte-compile cl-extra help-mode easymenu cconv luis-private
luis-machine-local benchmark-init advice cl-loaddefs pcase cl-lib
benchmark-init-loaddefs slime-autoloads haskell-mode-autoloads
erlang-start emacs-goodies-el emacs-goodies-custom
emacs-goodies-loaddefs easy-mmode devhelp preview-latex tex-site
auto-loads mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 647388 21245)
 (symbols 48 43035 0)
 (miscs 40 574 465)
 (strings 32 104884 16016)
 (string-bytes 1 3270643)
 (vectors 16 79586)
 (vector-slots 8 1717257 54052)
 (floats 8 8003 1977)
 (intervals 56 1023 0)
 (buffers 976 440))