Subject: bug#29710: Emacs becomes unresponsive when typing brackets (haskell-mode)

From: Hariharan Rangasamy <[email-masked]>
Date: Thu, 14 Dec 2017 22:35:39 +0530

Emacs becomes unresponsive when typing {-[]-} when both haskell mode and
electric pair mode are enabled.

Install haskell mode from https://github.com/haskell/haskell-mode

* emacs -Q
* enable electric-pair-mode
* enable haskell mode in scratch buffer
* type {--}
* try to input brackets
{-[]-}

On pressing [  emacs becomes unresponsive, the mouse pointer rotates
continuously. On giving C-g repeatedly, the brackets are inserted and
emacs becomes responsive again. Also when i send SIGUSR2 signal emacs
becomes responsive.

The bug was posted in
https://www.reddit.com/r/emacs/comments/7jb4qu/bug_with_haskellmode_and_electricpairmode_doesnt/
In the original post the user mentioned emacs was crashing but i was
able to reproduce the emacs hang only.

I was able to reproduce this issue easily on two different systems.
Let me know if you are unable to reproduce the issue or if you need
more info.

In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
 of 2017-12-10 built on hari-VirtualBox
Repository revision: 94179453039a23b7f2aefa990e317f72a3df03d5
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description:    Ubuntu 16.04.3 LTS

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Error during redisplay: (internal--syntax-propertize 148) signaled
(quit) [2 times]
Quit
Configured using:
 'configure --enable-checking=yes,glyphs --enable-check-lisp-object-type
 --prefix=/home/hari/.install --without-pop 'CFLAGS=-O0 -g3''

Configured features:
XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11

Important settings:
  value of $LANG: en_IN
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: iso-latin-1-unix

Major mode: Haskell

Minor modes in effect:
  shell-dirtrack-mode: t
  haskell-indentation-mode: t
  ivy-mode: t
  electric-pair-mode: t
  global-company-mode: t
  company-mode: t
  show-paren-mode: t
  override-global-mode: t
  global-auto-revert-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml
mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
haskell-doc inf-haskell haskell-decl-scan imenu shell pcomplete haskell
haskell-load haskell-commands highlight-uses-mode haskell-modules
haskell-sandbox haskell-navigate-imports haskell-repl haskell-collapse
hideshow haskell-debug haskell-hoogle haskell-completions
haskell-interactive-mode haskell-presentation-mode haskell-compile
haskell-process haskell-session url-util json map haskell-mode
haskell-cabal haskell-utils haskell-font-lock haskell-indentation
haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-compat haskell-complete-module haskell-ghc-support noutline
outline flymake-proc flymake warnings dabbrev haskell-customize colir
color counsel dired dired-loaddefs compile comint ansi-color esh-util
swiper ivy delsel ivy-overlay ffap company-oddmuse company-keywords
company-etags etags xref project ring company-gtags company-dabbrev-code
company-dabbrev company-files company-capf company-cmake company-xcode
company-clang company-semantic company-eclim company-template
company-css company-nxml company-bbdb elec-pair company-c-headers rx
company pcase highlight-symbol thingatpt paren smex ido two-column
edmacro kmacro diminish cl-extra help-mode use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core autorevert
filenotify jka-compr auto-compile advice packed finder-inf info package
easymenu epg-config url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt
gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors 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 composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray 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 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 256157 11502)
 (symbols 48 32465 1)
 (miscs 40 56 142)
 (strings 32 81273 4132)
 (string-bytes 1 2196417)
 (vectors 16 31144)
 (vector-slots 8 748034 12446)
 (floats 8 246 393)
 (intervals 56 389 11)
 (buffers 992 11)
 (heap 1024 36431 1849))