Subject: bug#9330: 24.0.50; xassert failure in redisplay of composed characters

From: Eli Zaretskii <[email-masked]>
Date: Fri, 19 Aug 2011 14:07:41 +0300

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

  C-h H
  M-: (setq bidi-display-reordering nil)
  C-u 765 M-x goto-char RET
  C-p

Emacs aborts in this assertion:

	  xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));

This abort doesn't happen if bidi-display-reordering is turned on.

The backtrace is below:

  #0  w32_abort () at w32fns.c:7182
  #1  0x011690b3 in set_iterator_to_next (it=0x82e4b0, reseat_p=1)
      at xdisp.c:6630
  #2  0x0116ced6 in move_it_in_display_line_to (it=0x82e4b0, to_charpos=765,
      to_x=-1, op=MOVE_TO_POS) at xdisp.c:8063
  #3  0x0116db9c in move_it_to (it=0x82e4b0, to_charpos=765, to_x=-1, to_y=-1,
      to_vpos=-1, op=8) at xdisp.c:8341
  #4  0x0111b210 in Fvertical_motion (lines=-4, window=55242245)
      at indent.c:2067
  #5  0x01037d2b in Ffuncall (nargs=2, args=0x82ee10) at eval.c:2984
  #6  0x01124c86 in exec_byte_code (bytestr=20612529, vector=20612669,
      maxdepth=20, args_template=52369434, nargs=0, args=0x0) at bytecode.c:785
  #7  0x01038c2c in funcall_lambda (fun=20612493, nargs=2, arg_vector=0x82f074)
      at eval.c:3212
  #8  0x010380c7 in Ffuncall (nargs=3, args=0x82f070) at eval.c:3030
  #9  0x01124c86 in exec_byte_code (bytestr=20612313, vector=20612405,
      maxdepth=16, args_template=52369434, nargs=0, args=0x0) at bytecode.c:785
  #10 0x01038c2c in funcall_lambda (fun=20612261, nargs=4, arg_vector=0x82f2c4)
      at eval.c:3212
  #11 0x010380c7 in Ffuncall (nargs=5, args=0x82f2c0) at eval.c:3030
  #12 0x01124c86 in exec_byte_code (bytestr=20611633, vector=20611341,
      maxdepth=20, args_template=52369434, nargs=0, args=0x0) at bytecode.c:785
  #13 0x01124236 in Fbyte_code (bytestr=20611633, vector=20611341, maxdepth=20)
      at bytecode.c:423
  #14 0x01035e4c in eval_sub (form=20611622) at eval.c:2335
  #15 0x01033902 in internal_lisp_condition_case (var=52611362,
      bodyform=20611622, handlers=20611366) at eval.c:1440
  #16 0x01125541 in exec_byte_code (bytestr=20611505, vector=20611573,
      maxdepth=20, args_template=52369434, nargs=0, args=0x0) at bytecode.c:981
  #17 0x01038c2c in funcall_lambda (fun=20611477, nargs=2, arg_vector=0x82f8e4)
      at eval.c:3212
  #18 0x010380c7 in Ffuncall (nargs=3, args=0x82f8e0) at eval.c:3030
  #19 0x01123cb3 in Fcall_interactively (function=52733698,
      record_flag=52369434, keys=52390661) at callint.c:857
  #20 0x01037da0 in Ffuncall (nargs=4, args=0x82fb80) at eval.c:2988
  #21 0x0103723b in call3 (fn=52534634, arg1=52733698, arg2=52369434,
      arg3=52369434) at eval.c:2781
  #22 0x0101ff42 in Fcommand_execute (cmd=52733698, record_flag=52369434,
      keys=52369434, special=52369434) at keyboard.c:10274
  #23 0x01006404 in command_loop_1 () at keyboard.c:1572
  #24 0x01033a0c in internal_condition_case (bfun=0x100543f <command_loop_1>,
      handlers=52427162, hfun=0x1004c69 <cmd_error>) at eval.c:1486
  #25 0x010050a5 in command_loop_2 (ignore=52369434) at keyboard.c:1156
  #26 0x010333cc in internal_catch (tag=52425186,
      func=0x1005082 <command_loop_2>, arg=52369434) at eval.c:1247
  #27 0x0100505d in command_loop () at keyboard.c:1135
  #28 0x01004627 in recursive_edit_1 () at keyboard.c:756
  #29 0x01004949 in Frecursive_edit () at keyboard.c:820
  #30 0x010027be in main (argc=2, argv=0xa32790) at emacs.c:1705

  Lisp Backtrace:
  "vertical-motion" (0x82ee14)
  "line-move-visual" (0x82f074)
  "line-move" (0x82f2c4)
  "byte-code" (0x82f4a0)
  "previous-line" (0x82f8e4)
  "call-interactively" (0x82fb84)

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
d:/gnu/bzr/emacs/trunk/etc/DEBUG.

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-08-19 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1255
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-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

Recent input:
M-x r e p o <tab> r t <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug help-mode easymenu view time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
multi-tty emacs)