GNU bug report logs - #33345
27.0.50; Abort in bidi_cache_iterator_state

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Date: Sun, 11 Nov 2018 15:05:02 UTC

Severity: normal

Tags: unreproducible

Found in version 27.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 33345 in the body.
You can then email your comments to 33345 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#33345; Package emacs. (Sun, 11 Nov 2018 15:05:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 11 Nov 2018 15:05:03 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Abort in bidi_cache_iterator_state
Date: Sun, 11 Nov 2018 10:03:31 -0500
Package: Emacs
Version: 27.0.50


My Gnus session of Emacs on master crashed with the following backtrace:

    Breakpoint 1, terminate_due_to_signal (sig=sig <at> entry=6, 
        backtrace_limit=backtrace_limit <at> entry=40) at emacs.c:369
    (gdb) bt
    #0  terminate_due_to_signal (sig=sig <at> entry=6, 
        backtrace_limit=backtrace_limit <at> entry=40) at emacs.c:369
    #1  0x0000000000596371 in emacs_abort () at sysdep.c:2429
    #2  0x000000000050af91 in bidi_cache_iterator_state (
        bidi_it=bidi_it <at> entry=0x7fffffff7140, resolved=resolved <at> entry=true, 
        update_only=update_only <at> entry=false) at bidi.c:800
    #3  0x000000000050f1b2 in bidi_move_to_visually_next (
        bidi_it=bidi_it <at> entry=0x7fffffff98b0) at bidi.c:3417
    #4  0x0000000000464f86 in set_iterator_to_next (it=it <at> entry=0x7fffffff8ec0, 
        reseat_p=reseat_p <at> entry=true) at xdisp.c:7565
    #5  0x000000000047446f in display_line (it=it <at> entry=0x7fffffff8ec0, 
        cursor_vpos=cursor_vpos <at> entry=19) at xdisp.c:22060
    #6  0x000000000047512a in try_window (window=window <at> entry=XIL(0x17a6c35), 
        pos=..., flags=flags <at> entry=1) at xdisp.c:17778
    #7  0x000000000048fa1f in redisplay_window (window=XIL(0x17a6c35), 
        just_this_one_p=just_this_one_p <at> entry=false) at xdisp.c:17225
    #8  0x0000000000492228 in redisplay_window_0 (window=..., 
        window <at> entry=XIL(0x17a6c35)) at xdisp.c:14953
    #9  0x000000000061db75 in internal_condition_case_1 (
        bfun=bfun <at> entry=0x4921f9 <redisplay_window_0>, arg=..., handlers=..., 
        hfun=hfun <at> entry=0x432ae6 <redisplay_window_error>) at eval.c:1397
    #10 0x000000000044390f in redisplay_windows (window=...) at xdisp.c:14933
    #11 0x000000000047b539 in redisplay_internal () at xdisp.c:14416
    #12 0x000000000047d8c6 in redisplay () at xdisp.c:13626
    #13 0x00000000005819a9 in read_char (commandflag=1, map=..., 
        map <at> entry=XIL(0x5cf0d53), prev_event=..., 
        used_mouse_menu=used_mouse_menu <at> entry=0x7fffffffdffb, 
        end_time=end_time <at> entry=0x0) at keyboard.c:2452
    #14 0x0000000000583818 in read_key_sequence (
        keybuf=keybuf <at> entry=0x7fffffffe0c0, prompt=..., prompt <at> entry=XIL(0), 
        dont_downcase_last=dont_downcase_last <at> entry=false, 
        can_return_switch_frame=can_return_switch_frame <at> entry=true, 
        fix_current_buffer=fix_current_buffer <at> entry=true, 
        prevent_redisplay=prevent_redisplay <at> entry=false) at keyboard.c:9119
    #15 0x0000000000585ea1 in command_loop_1 () at keyboard.c:1339
    #16 0x000000000061dacc in internal_condition_case (
        bfun=bfun <at> entry=0x585c82 <command_loop_1>, handlers=..., 
        handlers <at> entry=XIL(0x53a0), hfun=hfun <at> entry=0x574c36 <cmd_error>)
        at eval.c:1373
    #17 0x000000000056d0c5 in command_loop_2 (ignore=..., ignore <at> entry=XIL(0))
        at keyboard.c:1080
    #18 0x000000000061da2c in internal_catch (tag=..., tag <at> entry=XIL(0xca80), 
        func=func <at> entry=0x56d0a9 <command_loop_2>, arg=..., arg <at> entry=XIL(0))
        at eval.c:1136
    #19 0x000000000056d08b in command_loop () at keyboard.c:1059
    #20 0x0000000000574665 in recursive_edit_1 () at keyboard.c:703
    #21 0x0000000000574b2e in Frecursive_edit () at keyboard.c:775
    #22 0x000000000056c2c1 in main (argc=<optimized out>, argv=0x7fffffffe3f8)
        at emacs.c:1731
    
    Lisp Backtrace:
    "redisplay_internal (C function)" (0x0)
    (gdb) 

I can *currently* reproduce it at will:

    start `emacs -f gnus`, then enter my IMAP password, then press RET
    on the first group (INBOX) and *boom*.

As the backtrace indicates, the crash happens not while running the Gnus
code that enters the group, displaying the summary of all messages, but
in the immediately subsequent redisplay.

If I enter another group, the problem doesn't occur, so I guess it has
to do with the current content of the summary buffer in my INBOX
(i.e. probably due to some unusual email message's title).

The crash happens because of:

      /* We should never cache on backward scans.  */
      if (bidi_it->scan_dir == -1)
        emacs_abort ();

The content of bidi_it is below, in case it helps,


        Stefan

(gdb) up
#1  0x0000000000596371 in emacs_abort () at sysdep.c:2429
(gdb) 
#2  0x000000000050af91 in bidi_cache_iterator_state (
    bidi_it=bidi_it <at> entry=0x7fffffff7140, resolved=resolved <at> entry=true, 
    update_only=update_only <at> entry=false) at bidi.c:800
(gdb) p bidi_it
$1 = (struct bidi_it *) 0x7fffffff7140
(gdb) p *bidi_it
$2 = {
  bytepos = 13501, 
  charpos = 13387, 
  ch = 1604, 
  nchars = 1, 
  ch_len = 2, 
  type = STRONG_R, 
  type_after_wn = STRONG_AL, 
  orig_type = STRONG_AL, 
  resolved_level = 1 '\001', 
  isolate_level = 0 '\000', 
  invalid_levels = 0, 
  invalid_isolates = 0, 
  prev = {
    charpos = 13386, 
    type = STRONG_AL, 
    orig_type = STRONG_AL
  }, 
  last_strong = {
    charpos = 13386, 
    type = STRONG_AL, 
    orig_type = STRONG_AL
  }, 
  next_for_neutral = {
    charpos = 13333, 
    type = UNKNOWN_BT, 
    orig_type = UNKNOWN_BT
  }, 
  prev_for_neutral = {
    charpos = 13386, 
    type = STRONG_R, 
    orig_type = STRONG_AL
  }, 
  next_for_ws = {
    charpos = -1, 
    type = UNKNOWN_BT, 
    orig_type = UNKNOWN_BT
  }, 
  bracket_pairing_pos = -1, 
  bracket_enclosed_type = UNKNOWN_BT, 
  next_en_pos = 0, 
  next_en_type = UNKNOWN_BT, 
  sos = L2R, 
  scan_dir = -1, 
  disp_pos = 13619, 
  disp_prop = 0, 
  stack_idx = 0, 
  level_stack = {{
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 2098145394957076504, 
      next_for_neutral_type = 6, 
      last_strong_type = 3, 
      prev_for_neutral_type = 0, 
      level = 137 '\211', 
      flags = 30 '\036'
    }, {
      next_for_neutral_pos = -8782847446135503330, 
      next_for_neutral_type = 3, 
      last_strong_type = 5, 
      prev_for_neutral_type = 2, 
      level = 200 '\310', 
      flags = 14 '\016'
    }, {
      next_for_neutral_pos = -9073954418851241016, 
      next_for_neutral_type = 6, 
      last_strong_type = 6, 
      prev_for_neutral_type = 3, 
      level = 8 '\b', 
      flags = 12 '\f'
    }, {
      next_for_neutral_pos = 2242380479172758028, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 2, 
      level = 24 '\030', 
      flags = 137 '\211'
    }, {
---Type <return> to continue, or q <return> to quit---
      next_for_neutral_pos = 2173348323713255704, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 0, 
      level = 33 '!', 
      flags = 137 '\211'
    }, {
      next_for_neutral_pos = 2310004764047853857, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 5, 
      level = 136 '\210', 
      flags = 215 '\327'
    }, {
      next_for_neutral_pos = 876252313521705739, 
      next_for_neutral_type = 4, 
      last_strong_type = 2, 
      prev_for_neutral_type = 5, 
      level = 20 '\024', 
      flags = 130 '\202'
    }, {
      next_for_neutral_pos = 1767981844370293005, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 3, 
      level = 34 '"', 
      flags = 73 'I'
    }, {
      next_for_neutral_pos = 4765949849663766812, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 2, 
      level = 36 '$', 
      flags = 41 ')'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 4, 
      level = 196 '\304', 
      flags = 82 'R'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 2, 
      last_strong_type = 4, 
      prev_for_neutral_type = 5, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 25296549, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
      level = 129 '\201', 
      flags = 1 '\001'
---Type <return> to continue, or q <return> to quit---
    }, {
      next_for_neutral_pos = 2, 
      next_for_neutral_type = 2, 
      last_strong_type = 3, 
      prev_for_neutral_type = 1, 
      level = 87 'W', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 15278021, 
      next_for_neutral_type = 0, 
      last_strong_type = 3, 
      prev_for_neutral_type = 0, 
      level = 109 'm', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 3377734080266242, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 10 '\n', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 62119301, 
      next_for_neutral_type = 4, 
      last_strong_type = 0, 
      prev_for_neutral_type = 1, 
      level = 100 'd', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 2533309150134272, 
      next_for_neutral_type = 2, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 2 '\002', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 62119301, 
      next_for_neutral_type = 4, 
      last_strong_type = 0, 
      prev_for_neutral_type = 1, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1604, 
      next_for_neutral_type = 4, 
      last_strong_type = 7, 
      prev_for_neutral_type = 6, 
      level = 107 'k', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488318872, 
      next_for_neutral_type = 5, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
      level = 129 '\201', 
      flags = 1 '\001'
    }, {
      next_for_neutral_pos = 98630672, 
      next_for_neutral_type = 5, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 97 'a', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 12, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
---Type <return> to continue, or q <return> to quit---
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 7, 
      last_strong_type = 1, 
      prev_for_neutral_type = 5, 
      level = 97 'a', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 7, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
      level = 152 '\230', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 53280, 
      next_for_neutral_type = 1, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
      level = 152 '\230', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1, 
      next_for_neutral_type = 7, 
      last_strong_type = 3, 
      prev_for_neutral_type = 1, 
      level = 97 'a', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140, 
      next_for_neutral_type = 0, 
      last_strong_type = 2, 
      prev_for_neutral_type = 4, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 11042213, 
      next_for_neutral_type = 4, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 48460784, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 4, 
      level = 147 '\223', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1, 
      next_for_neutral_type = 3, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488319760, 
      next_for_neutral_type = 3, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488319784, 
      next_for_neutral_type = 3, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
---Type <return> to continue, or q <return> to quit---
      level = 98 'b', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 2, 
      next_for_neutral_type = 0, 
      last_strong_type = 7, 
      prev_for_neutral_type = 2, 
      level = 167 '\247', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488320208, 
      next_for_neutral_type = 3, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488319816, 
      next_for_neutral_type = 4, 
      last_strong_type = 2, 
      prev_for_neutral_type = 2, 
      level = 104 'h', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 10996917, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 4, 
      level = 147 '\223', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 53546, 
      next_for_neutral_type = 2, 
      last_strong_type = 6, 
      prev_for_neutral_type = 4, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 25296549, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488319840, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 7, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 53509280, 
      next_for_neutral_type = 4, 
      last_strong_type = 3, 
      prev_for_neutral_type = 5, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 140737488320992, 
      next_for_neutral_type = 3, 
      last_strong_type = 5, 
      prev_for_neutral_type = 5, 
      level = 227 '\343', 
      flags = 245 '\365'
    }, {
      next_for_neutral_pos = 49733264, 
      next_for_neutral_type = 4, 
      last_strong_type = 6, 
      prev_for_neutral_type = 6, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 140737488320988, 
      next_for_neutral_type = 7, 
      last_strong_type = 0, 
      prev_for_neutral_type = 2, 
      level = 254 '\376', 
      flags = 2 '\002'
    }, {
      next_for_neutral_pos = 98630677, 
      next_for_neutral_type = 7, 
      last_strong_type = 1, 
---Type <return> to continue, or q <return> to quit---
      prev_for_neutral_type = 5, 
      level = 97 'a', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 7, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 5, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 3200002, 
      next_for_neutral_type = 0, 
      last_strong_type = 6, 
      prev_for_neutral_type = 0, 
      level = 122 'z', 
      flags = 1 '\001'
    }, {
      next_for_neutral_pos = 81788949, 
      next_for_neutral_type = 3, 
      last_strong_type = 1, 
      prev_for_neutral_type = 2, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 13, 
      next_for_neutral_type = 2, 
      last_strong_type = 6, 
      prev_for_neutral_type = 3, 
      level = 68 'D', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 6, 
      prev_for_neutral_type = 7, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 140737354116018, 
      next_for_neutral_type = 0, 
      last_strong_type = 6, 
      prev_for_neutral_type = 0, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 4294967307, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 14534368, 
      next_for_neutral_type = 3, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488320048, 
      next_for_neutral_type = 6, 
      last_strong_type = 4, 
      prev_for_neutral_type = 5, 
      level = 45 '-', 
      flags = 243 '\363'
    }, {
      next_for_neutral_pos = 6, 
      next_for_neutral_type = 3, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
      level = 230 '\346', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1237, 
      next_for_neutral_type = 3, 
---Type <return> to continue, or q <return> to quit---
      last_strong_type = 4, 
      prev_for_neutral_type = 1, 
      level = 111 'o', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488320112, 
      next_for_neutral_type = 7, 
      last_strong_type = 4, 
      prev_for_neutral_type = 6, 
      level = 95 '_', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1541948305, 
      next_for_neutral_type = 3, 
      last_strong_type = 7, 
      prev_for_neutral_type = 7, 
      level = 66 'B', 
      flags = 7 '\a'
    }, {
      next_for_neutral_pos = 15125667, 
      next_for_neutral_type = 3, 
      last_strong_type = 3, 
      prev_for_neutral_type = 4, 
      level = 95 '_', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 2, 
      last_strong_type = 3, 
      prev_for_neutral_type = 1, 
      level = 96 '`', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1541948305, 
      next_for_neutral_type = 5, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 11, 
      next_for_neutral_type = 3, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 14564992, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 0, 
      level = 214 '\326', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 2, 
      prev_for_neutral_type = 0, 
      level = 224 '\340', 
      flags = 5 '\005'
    }, {
      next_for_neutral_pos = 2, 
      next_for_neutral_type = 0, 
      last_strong_type = 5, 
      prev_for_neutral_type = 4, 
      level = 96 '`', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 10, 
      next_for_neutral_type = 0, 
      last_strong_type = 7, 
      prev_for_neutral_type = 6, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 9, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 14564992, 
---Type <return> to continue, or q <return> to quit---
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 6, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 2, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 6269056, 
      next_for_neutral_type = 5, 
      last_strong_type = 3, 
      prev_for_neutral_type = 7, 
      level = 96 '`', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 5, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 5, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 97642867, 
      next_for_neutral_type = 6, 
      last_strong_type = 0, 
      prev_for_neutral_type = 7, 
      level = 97 'a', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 97640620, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 97640620, 
      next_for_neutral_type = 1, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 97640620, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
---Type <return> to continue, or q <return> to quit---
      next_for_neutral_pos = 98630677, 
      next_for_neutral_type = 7, 
      last_strong_type = 3, 
      prev_for_neutral_type = 1, 
      level = 106 'j', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 15747, 
      next_for_neutral_type = 2, 
      last_strong_type = 1, 
      prev_for_neutral_type = 1, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 13387, 
      next_for_neutral_type = 0, 
      last_strong_type = 5, 
      prev_for_neutral_type = 0, 
      level = 106 'j', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 40, 
      next_for_neutral_type = 0, 
      last_strong_type = 5, 
      prev_for_neutral_type = 0, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 97648432, 
      next_for_neutral_type = 2, 
      last_strong_type = 5, 
      prev_for_neutral_type = 1, 
      level = 107 'k', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488320960, 
      next_for_neutral_type = 0, 
      last_strong_type = 2, 
      prev_for_neutral_type = 4, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488321024, 
      next_for_neutral_type = 2, 
      last_strong_type = 7, 
      prev_for_neutral_type = 5, 
      level = 106 'j', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 15120, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 255 '\377', 
      flags = 255 '\377'
    }, {
      next_for_neutral_pos = 280, 
      next_for_neutral_type = 5, 
      last_strong_type = 2, 
      prev_for_neutral_type = 0, 
      level = 224 '\340', 
      flags = 5 '\005'
    }, {
      next_for_neutral_pos = 98630672, 
      next_for_neutral_type = 5, 
      last_strong_type = 1, 
      prev_for_neutral_type = 4, 
      level = 106 'j', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 98630672, 
      next_for_neutral_type = 5, 
      last_strong_type = 1, 
      prev_for_neutral_type = 2, 
      level = 107 'k', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = -1, 
      next_for_neutral_type = 7, 
      last_strong_type = 5, 
      prev_for_neutral_type = 6, 
      level = 107 'k', 
      flags = 0 '\000'
---Type <return> to continue, or q <return> to quit---
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 7, 
      last_strong_type = 1, 
      prev_for_neutral_type = 5, 
      level = 97 'a', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 2, 
      next_for_neutral_type = 2, 
      last_strong_type = 5, 
      prev_for_neutral_type = 1, 
      level = 93 ']', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 14450776, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 1, 
      last_strong_type = 7, 
      prev_for_neutral_type = 2, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = -1, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1604, 
      next_for_neutral_type = 5, 
      last_strong_type = 2, 
      prev_for_neutral_type = 6, 
      level = 80 'P', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1604, 
      next_for_neutral_type = 5, 
      last_strong_type = 2, 
      prev_for_neutral_type = 6, 
      level = 80 'P', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 97627120, 
      next_for_neutral_type = 5, 
      last_strong_type = 0, 
      prev_for_neutral_type = 6, 
      level = 211 '\323', 
      flags = 3 '\003'
    }, {
      next_for_neutral_pos = 1604, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 5, 
      level = 80 'P', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 64194949, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 1, 
      level = 111 'o', 
      flags = 244 '\364'
    }, {
      next_for_neutral_pos = 140737294327168, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
---Type <return> to continue, or q <return> to quit---
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1604, 
      next_for_neutral_type = 5, 
      last_strong_type = 1, 
      prev_for_neutral_type = 3, 
      level = 109 'm', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 25296549, 
      next_for_neutral_type = 2, 
      last_strong_type = 2, 
      prev_for_neutral_type = 2, 
      level = 100 'd', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 97606389, 
      next_for_neutral_type = 5, 
      last_strong_type = 2, 
      prev_for_neutral_type = 0, 
      level = 198 '\306', 
      flags = 3 '\003'
    }, {
      next_for_neutral_pos = 1604, 
      next_for_neutral_type = 1, 
      last_strong_type = 1, 
      prev_for_neutral_type = 5, 
      level = 109 'm', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 98560147, 
      next_for_neutral_type = 0, 
      last_strong_type = 6, 
      prev_for_neutral_type = 0, 
      level = 122 'z', 
      flags = 1 '\001'
    }, {
      next_for_neutral_pos = 4294967295, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 4, 
      level = 196 '\304', 
      flags = 82 'R'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 2, 
      level = 214 '\326', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 1, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 0 '\000', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 65530032, 
      next_for_neutral_type = 2, 
      last_strong_type = 3, 
      prev_for_neutral_type = 1, 
      level = 87 'W', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 140737488326336, 
      next_for_neutral_type = 0, 
      last_strong_type = 3, 
      prev_for_neutral_type = 0, 
      level = 109 'm', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 3377734080266241, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 0, 
      level = 10 '\n', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 25296544, 
      next_for_neutral_type = 5, 
      last_strong_type = 3, 
      prev_for_neutral_type = 3, 
---Type <return> to continue, or q <return> to quit---
      level = 67 'C', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 4, 
      prev_for_neutral_type = 2, 
      level = 67 'C', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 25296544, 
      next_for_neutral_type = 1, 
      last_strong_type = 4, 
      prev_for_neutral_type = 4, 
      level = 72 'H', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 49537472, 
      next_for_neutral_type = 0, 
      last_strong_type = 0, 
      prev_for_neutral_type = 7, 
      level = 69 'E', 
      flags = 0 '\000'
    }, {
      next_for_neutral_pos = 0, 
      next_for_neutral_type = 0, 
      last_strong_type = 6, 
      prev_for_neutral_type = 0, 
      level = 122 'z', 
      flags = 1 '\001'
    }}, 
  string = {
    lstring = XIL(0x3b556b5), 
    s = 0x6dade7 <face_for_char+1393> "I\211č@\373\250\aut\017\266\005h\337n", 
    schars = 0, 
    bufpos = 140737488326336, 
    from_disp_str = false, 
    unibyte = false
  }, 
  w = 0x1, 
  paragraph_dir = (unknown: 24796160), 
  separator_limit = 24796160, 
  first_elt = false, 
  new_paragraph = false, 
  frame_window_p = true
}
(gdb) 
(gdb) up
#3  0x000000000050f1b2 in bidi_move_to_visually_next (
    bidi_it=bidi_it <at> entry=0x7fffffff98b0) at bidi.c:3417
(gdb) 



In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-11-09 built on pastel
Repository revision: def1dec144671bb673e495a241d405cc4b24b2c3
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)

Recent messages:

Result: t

Result: nil

Result: nil

Result: nil

Result: (nil nil)

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

Configured features:
XAW3D XPM JPEG TIFF GIF PNG SOUND GPM DBUS NOTIFY INOTIFY GNUTLS LIBXML2
FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS
GMP

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

Major mode: InactiveMinibuffer

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  electric-pair-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
  url-handler-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-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:
/home/monnier/src/emacs/elpa/packages/adaptive-wrap/adaptive-wrap hides /home/monnier/src/emacs/elpa/packages/taskpaper-mode/adaptive-wrap
/home/monnier/src/emacs/elpa/packages/svg/svg hides /home/monnier/src/emacs/work/lisp/svg
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-prj hides /home/monnier/src/emacs/work/lisp/progmodes/ada-prj
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-stmt hides /home/monnier/src/emacs/work/lisp/progmodes/ada-stmt
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-mode hides /home/monnier/src/emacs/work/lisp/progmodes/ada-mode
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-xref hides /home/monnier/src/emacs/work/lisp/progmodes/ada-xref
/home/monnier/src/emacs/elpa/packages/nadvice/nadvice hides /home/monnier/src/emacs/work/lisp/emacs-lisp/nadvice
/home/monnier/src/emacs/elpa/packages/hyperbole/set hides /home/monnier/src/emacs/work/lisp/emacs-lisp/set
/home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp
/home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/work/lisp/obsolete/landmark

Features:
(sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa derived
epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils autoload grep lisp-mnt xscheme
byte-opt unsafep trace testcover shadow scheme re-builder profiler
inf-lisp ielm gmm-utils ert pp ewoc elp edebug cl-indent advice
eieio-opt speedbar sb-image ezimage dframe cl-extra help-fns radix-tree
cl-print debug backtrace find-func skeleton bibtex-style bibtex dabbrev
reftex-cite executable copyright misearch multi-isearch cus-edit
cus-start cus-load wid-edit autorevert filenotify doc-view jka-compr
image-mode dired dired-loaddefs reftex-parse format-spec vc-git
diff-mode filecache reftex-dcr reftex reftex-loaddefs reftex-vars
tex-mode shell pcomplete latexenc server time-date flymake-proc flymake
compile comint ansi-color ring warnings noutline outline easy-mmode
flyspell ispell checkdoc thingatpt help-mode load-dir elec-pair reveal
autoinsert proof-site proof-autoloads cl pg-vars savehist minibuf-eldef
disp-table compact-docstrings cl-seq inline kotl-autoloads info
realgud-recursive-autoloads url-auth vm-autoloads mule-util
lmc-autoloads finder-inf package easymenu epg-config url-handlers
url-parse auth-source eieio eieio-core cl-macs gv eieio-loaddefs
password-cache json map url-vars seq bytecomp byte-compile cconv
cl-loaddefs cl-lib 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 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 threads dbusbind
inotify dynamic-setting font-render-setting x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 357117 51106)
 (symbols 48 31997 0) (strings 32 0 0) (string-bytes 1 0) (vectors 16 139492)
 (vector-slots 8 2576459 162058)
 (floats 8 198 607) (intervals 56 16042 485) (buffers 992 35))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Sun, 11 Nov 2018 16:04:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Sun, 11 Nov 2018 18:03:13 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Date: Sun, 11 Nov 2018 10:03:31 -0500
> 
> I can *currently* reproduce it at will:
> 
>     start `emacs -f gnus`, then enter my IMAP password, then press RET
>     on the first group (INBOX) and *boom*.
> 
> As the backtrace indicates, the crash happens not while running the Gnus
> code that enters the group, displaying the summary of all messages, but
> in the immediately subsequent redisplay.
> 
> If I enter another group, the problem doesn't occur, so I guess it has
> to do with the current content of the summary buffer in my INBOX
> (i.e. probably due to some unusual email message's title).
> 
> The crash happens because of:
> 
>       /* We should never cache on backward scans.  */
>       if (bidi_it->scan_dir == -1)
>         emacs_abort ();
> 
> The content of bidi_it is below, in case it helps,

Thanks, but IME it is nigh impossible to debug these problems without
having the text that causes them.  That's because the real problem is
usually much earlier than where the abort happens, and because bidi
display code is stateful, with some of the state in the cache.

Since this seems to be caused by displaying the group summary, please
try to save the summary to a file and post it.  (To prevent the abort,
turn off bidi-display-reordering before entering the group.)  After
saving the summary to a file, please try visiting the file in
"emacs -Q", which hopefully will reproduce the abort.  If all that
works as I hope, try reducing the file to the minimum that still
reproduces the problem, before posting it.  And pleas post as
compressed archive, to prevent everyone else's Emacs from crashing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Mon, 12 Nov 2018 13:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Mon, 12 Nov 2018 08:43:34 -0500
[Message part 1 (text/plain, inline)]
> Since this seems to be caused by displaying the group summary, please
> try to save the summary to a file and post it.  (To prevent the abort,

OK, I've managed to do that.  The resulting file is attached.

But it doesn't look like a bug in bidi, after all:
- `emacs ~/tmp/foobug.txt`
  crashes right away
- `emacs --eval '(setq bidi-display-reordering nil)' ~/tmp/foobug.txt`
  crashes right away as well!
- `emacs -Q ~/tmp/foobug.txt`
  does not crash
- `emacs --eval '(garbage-collect)' ~/tmp/foobug.txt`
  does not crash either!

Also, when I tried to reproduce it yesterday (in order to produce the
file), I was on another machine and that one did not crash either.
The two machines are both running Debian but have various important
differences: 64bit-vs-32bit and stable-vs-testing.

So, I wouldn't be surprised at all if noone else manages to reproduce
the crash.


        Stefan

[foobug.txt (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Mon, 12 Nov 2018 16:09:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Mon, 12 Nov 2018 18:08:33 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: 33345 <at> debbugs.gnu.org
> Date: Mon, 12 Nov 2018 08:43:34 -0500
> 
> OK, I've managed to do that.  The resulting file is attached.

Thanks.  Doesn't crash here :-(  Tried on MS-Windows and on GNU/Linux.

> But it doesn't look like a bug in bidi, after all:
> - `emacs ~/tmp/foobug.txt`
>   crashes right away
> - `emacs --eval '(setq bidi-display-reordering nil)' ~/tmp/foobug.txt`
>   crashes right away as well!

The last one should have been

  `emacs --eval '(setq-default bidi-display-reordering nil)' ~/tmp/foobug.txt`

> - `emacs -Q ~/tmp/foobug.txt`
>   does not crash
> - `emacs --eval '(garbage-collect)' ~/tmp/foobug.txt`
>   does not crash either!

So we are looking at some strange memory-allocation bug or somesuch?

> Also, when I tried to reproduce it yesterday (in order to produce the
> file), I was on another machine and that one did not crash either.
> The two machines are both running Debian but have various important
> differences: 64bit-vs-32bit and stable-vs-testing.
> 
> So, I wouldn't be surprised at all if noone else manages to reproduce
> the crash.

Can you try Emacs 26 on the same system where Emacs 27 crashes?  And
what about unoptimized build of Emacs 27 -- does it crash as well?

Finally, do you have local changes, or is this stock master HEAD?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Mon, 12 Nov 2018 17:51:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: monnier <at> IRO.UMontreal.CA
Cc: 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Mon, 12 Nov 2018 19:50:23 +0200
> Date: Mon, 12 Nov 2018 18:08:33 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 33345 <at> debbugs.gnu.org
> 
> Can you try Emacs 26 on the same system where Emacs 27 crashes?  And
> what about unoptimized build of Emacs 27 -- does it crash as well?
> 
> Finally, do you have local changes, or is this stock master HEAD?

And one more question: does the system/configuration where you see the
crash differ from the others in the font used to display the offending
text?  The shaping of Arabic could depend on the font being used, due
to differences in OTF features supported by the fonts.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Tue, 13 Nov 2018 18:07:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: monnier <at> IRO.UMontreal.CA
Cc: 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Tue, 13 Nov 2018 20:05:34 +0200
> Date: Mon, 12 Nov 2018 19:50:23 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 33345 <at> debbugs.gnu.org
> 
> And one more question: does the system/configuration where you see the
> crash differ from the others in the font used to display the offending
> text?  The shaping of Arabic could depend on the font being used, due
> to differences in OTF features supported by the fonts.

I've thought about this some more, and I really don't understand how
this could happen.  The offending call to bidi_cache_iterator_state is
from here:

  /* Prepare the sentinel iterator state, and cache it.  When we bump
     into it, scanning backwards, we'll know that the last non-base
     level is exhausted.  */
  if (bidi_cache_idx == bidi_cache_start)
    {
      bidi_copy_it (&sentinel, bidi_it);
      if (bidi_it->first_elt)
	{
	  sentinel.charpos--;	/* cached charpos needs to be monotonic */
	  sentinel.bytepos--;
	  sentinel.ch = '\n';	/* doesn't matter, but why not? */
	  sentinel.ch_len = 1;
	  sentinel.nchars = 1;
	}
      bidi_cache_iterator_state (&sentinel, 1, 0);  <<<<<<<<<<<<<<<<
    }

But this means that the cache is empty, and we can never scan back
(scan_dir = -1) when the cache is empty.  So something very strange
happened there.

Instead of me asking you gobs of questions, perhaps you could give me
an ssh login on that system, and arrange for a GDB session which
already hit the call to emacs_abort to be in a state where I can
switch to it after logging in (with 'screen' or 'tmux', I think).
Then I could look around and see if I find out some clues.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Tue, 13 Nov 2018 18:29:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Tue, 13 Nov 2018 13:28:23 -0500
> But this means that the cache is empty, and we can never scan back
> (scan_dir = -1) when the cache is empty.  So something very strange
> happened there.

I think it's a case of memory corruption and doesn't really have much to
do with bidi code.  But I'm not progressing very fast: it's somewhat
deterministic but it is influenced by elements I'm not aware of, so it's
pretty nasty.

> Instead of me asking you gobs of questions, perhaps you could give me
> an ssh login on that system, and arrange for a GDB session which
> already hit the call to emacs_abort to be in a state where I can
> switch to it after logging in (with 'screen' or 'tmux', I think).
> Then I could look around and see if I find out some clues.

It's a machine that's not reachable from the internet and is off most of
the time.  I haven't yet managed to reproduce it on another machine.
I'll let you know when I'm making progress,
Thanks,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33345; Package emacs. (Wed, 25 Nov 2020 09:54:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 33345 <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Wed, 25 Nov 2020 01:53:21 -0800
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

>> But this means that the cache is empty, and we can never scan back
>> (scan_dir = -1) when the cache is empty.  So something very strange
>> happened there.
>
> I think it's a case of memory corruption and doesn't really have much to
> do with bidi code.  But I'm not progressing very fast: it's somewhat
> deterministic but it is influenced by elements I'm not aware of, so it's
> pretty nasty.
>
>> Instead of me asking you gobs of questions, perhaps you could give me
>> an ssh login on that system, and arrange for a GDB session which
>> already hit the call to emacs_abort to be in a state where I can
>> switch to it after logging in (with 'screen' or 'tmux', I think).
>> Then I could look around and see if I find out some clues.
>
> It's a machine that's not reachable from the internet and is off most of
> the time.  I haven't yet managed to reproduce it on another machine.
> I'll let you know when I'm making progress,

This bug was reported 2 years ago, so just pinging to see if it's still
relevant.  Thanks.




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 25 Nov 2020 14:27:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
bug acknowledged by developer. (Wed, 25 Nov 2020 14:27:02 GMT) Full text and rfc822 format available.

Message #31 received at 33345-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 33345-done <at> debbugs.gnu.org
Subject: Re: bug#33345: 27.0.50; Abort in bidi_cache_iterator_state
Date: Wed, 25 Nov 2020 09:26:15 -0500
> This bug was reported 2 years ago, so just pinging to see if it's still
> relevant.  Thanks.

It's unreproducible and hasn't bit me of late, so let's close it.


        Stefan





Added tag(s) unreproducible. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 25 Nov 2020 21:08:03 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. (Thu, 24 Dec 2020 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 123 days ago.

Previous Next


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