Subject: 25.0.95; Assertion failure in bidi.c with nhexl-mode

From: Stefan Monnier <[email-masked]>
Date: Fri, 15 Jul 2016 23:53:54 -0400

% src/emacs -Q -l elpa/packages/nhexl-mode/nhexl-mode.el lisp/subr.el -f
nhexl-mode

And then do C-v enough times (about 10 times) gives me an assertion
violation

bidi.c:2988: Emacs fatal error: assertion failed: bidi_it->next_for_neutral.charpos > bidi_it->charpos || (bidi_it->next_for_neutral.charpos == bidi_it->charpos && bidi_it->type == PDI)

Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=6, 
    backtrace_limit=2147483647) at emacs.c:353
(gdb) bt
#0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:353
#1  0x08212147 in die (
    msg=0x830f2f0 "bidi_it->next_for_neutral.charpos > bidi_it->charpos || (bidi_it->next_for_neutral.charpos == bidi_it->charpos && bidi_it->type == PDI)", 
    file=0x830eddc "bidi.c", line=2988) at alloc.c:7223
#2  0x0813b977 in bidi_resolve_neutral (bidi_it=0xffffa97c) at bidi.c:2984
#3  0x0813bbcf in bidi_type_of_next_char (bidi_it=bidi_it@entry=0xffffa97c)
    at bidi.c:3160
#4  0x0813bd32 in bidi_level_of_next_char (bidi_it=bidi_it@entry=0xffffa97c)
    at bidi.c:3227
#5  0x0813c8f9 in bidi_move_to_visually_next (bidi_it=0xffffa97c)
    at bidi.c:3420
#6  0x080a0a6f in set_iterator_to_next (it=it@entry=0xffffa3c8, 
    reseat_p=reseat_p@entry=true) at xdisp.c:7428
#7  0x080ae6b8 in display_line (it=it@entry=0xffffa3c8) at xdisp.c:20997
#8  0x080af3e5 in try_window (window=..., pos=..., flags=0) at xdisp.c:17198
#9  0x080c7129 in redisplay_window (window=..., window@entry=..., 
    just_this_one_p=just_this_one_p@entry=false) at xdisp.c:16394
#10 0x080cafb3 in redisplay_window_0 (window=...) at xdisp.c:14446
#11 0x082394e7 in internal_condition_case_1 (
    bfun=0x80caf87 <redisplay_window_0>, arg=..., handlers=..., 
    hfun=0x8073e75 <redisplay_window_error>) at eval.c:1333
#12 0x08082ba7 in redisplay_windows (window=...) at xdisp.c:14426
#13 0x080b533a in redisplay_internal () at xdisp.c:13986
#14 0x080b6f41 in redisplay () at xdisp.c:13214
#15 0x081a8b9e in read_char (commandflag=1, map=..., prev_event=..., 
    used_mouse_menu=0xffffd17b, end_time=0x0) at keyboard.c:2477
#16 0x081aac0b in read_key_sequence (keybuf=keybuf@entry=0xffffd1f8, 
    bufsize=bufsize@entry=30, prompt=..., prompt@entry=..., 
    dont_downcase_last=false, can_return_switch_frame=true, 
    fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9063
#17 0x081ad1f1 in command_loop_1 () at keyboard.c:1365
#18 0x08239472 in internal_condition_case (bfun=0x81ace6e <command_loop_1>, 
    handlers=..., hfun=0x819d8d0 <cmd_error>) at eval.c:1309
#19 0x08196203 in command_loop_2 (ignore=...) at keyboard.c:1107
#20 0x082393e9 in internal_catch (tag=..., func=0x81961e2 <command_loop_2>, 
    arg=...) at eval.c:1074
#21 0x08196192 in command_loop () at keyboard.c:1086
#22 0x0819d367 in recursive_edit_1 () at keyboard.c:692
#23 0x0819d7eb in Frecursive_edit () at keyboard.c:763
#24 0x08195913 in main (argc=<optimized out>, argv=0xffffd4d4) at emacs.c:1606

Lisp Backtrace:
"redisplay_internal (C function)" (0x0)
(gdb) 

In GNU Emacs 25.0.95.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
 of 2016-07-12 built on ceviche
Repository revision: 069fc05bd5fabdd5971e2c5230a8586248fb7f38
Windowing system distributor 'The X.Org Foundation', version 11.0.11802000
System Description:	Debian GNU/Linux testing (stretch)

Configured using:
 'configure -C --enable-checking --enable-check-lisp-object-type
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
 PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'

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

Important settings:
  value of $LANG: fr_CH.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  outline-minor-mode: t
  flyspell-mode: t
  checkdoc-minor-mode: t
  electric-pair-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  global-compact-docstrings-mode: t
  compact-docstrings-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  menu-bar-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
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
.emacs start
Loading /home/monnier/src/elisp/twelf/autoloads...done
Loading /home/monnier/src/elisp/haskell-mode/haskell-site-file.el (source)...done
Loading ~/src/elisp/bbdb/lisp/bbdb-autoloads...done
Loading /home/monnier/src/elisp/ProofGeneral/generic/proof-site.el (source)...done
Loading /home/monnier/etc/emacs/X11.el (source)...done
Loading /home/monnier/etc/emacs/custom.el (source)...done
Starting new Ispell process /usr/bin/aspell with american dictionary...
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-ref-man hides /home/monnier/src/emacs/elpa/packages/ada-ref-man/ada-ref-man
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-xref hides /home/monnier/src/emacs/emacs-25/lisp/progmodes/ada-xref
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-mode hides /home/monnier/src/emacs/emacs-25/lisp/progmodes/ada-mode
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-stmt hides /home/monnier/src/emacs/emacs-25/lisp/progmodes/ada-stmt
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-prj hides /home/monnier/src/emacs/emacs-25/lisp/progmodes/ada-prj
/home/monnier/src/emacs/elpa/packages/cl-generic/cl-generic hides /home/monnier/src/emacs/emacs-25/lisp/emacs-lisp/cl-generic
/home/monnier/src/emacs/elpa/packages/seq/seq hides /home/monnier/src/emacs/emacs-25/lisp/emacs-lisp/seq
/home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/emacs-25/lisp/obsolete/landmark
/home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/emacs-25/lisp/obsolete/crisp

Features:
(shadow sort mail-extr emacsbug message dired format-spec 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
noutline outline easy-mmode flyspell ispell checkdoc thingatpt load-dir
elec-pair url-handlers reveal autoinsert proof-site proof-autoloads cl
pg-vars savehist minibuf-eldef disp-table compact-docstrings advice info
finder-inf url-auth url-parse auth-source cl-seq eieio eieio-core
cl-macs gnus-util mm-util help-fns mail-prsvr password-cache url-vars
package epg-config seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib bbdb-autoloads
time-date 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 8 137951 7145)
 (symbols 24 24519 0)
 (miscs 20 72 335)
 (strings 16 32855 6142)
 (string-bytes 1 1123996)
 (vectors 8 17928)
 (vector-slots 4 505906 2656)
 (floats 8 241 149)
 (intervals 28 257 0)
 (buffers 520 19)
 (heap 1024 29140 949))