Subject: bug#39207: WITH dgb symbols Re: bug#39207: 28.0.50; crash when sending gnus message

From: Robert Pluim <[email-masked]>
Date: Wed, 22 Jan 2020 17:58:12 +0100

<snipped> Iʼll leave Gijs to look at the questions about his backtrace.

    >> 18068     /* Some sanity checks.  */
    >> 18069     CHECK_WINDOW_END (w);
    >> 18070     if (Z == Z_BYTE && CHARPOS (opoint) != BYTEPOS (opoint))
    >> 18071       emacs_abort ();
    >> 18072     if (BYTEPOS (opoint) < CHARPOS (opoint))
    >> 18073       emacs_abort ();
    >> 18074
    >> 18075     if (mode_line_update_needed (w))
    >> (gdb) p Z
    >> $1 = 2804
    >> (gdb) p Z_BYTE
    >> $2 = 2804
    >> (gdb) p CHARPOS(opoint)
    >> $3 = 495
    >> (gdb) p BYTEPOS(opoint)
    >> $4 = 497

    Eli> This indeed cannot happen, since $1 and $2 mean the buffer is either
    Eli> unibyte or pure-ASCII (the character count and the byte count are
    Eli> identical), whereas $3 and $4 tell us there's some multibyte character
    Eli> in the buffer before or at buffer position 495.

    Eli> Is the buffer multibyte or not?  (You can tell by looking at the value
    Eli> of 'BVAR (buffer, enable_multibyte_characters)'.)  Also, can you show
    Eli> the entire text of the buffer, which begins at current_buffer->text->beg?
    Eli> You need to exercise caution near the gap (unless it's at the end of
    Eli> the buffer), because the gap is not part of buffer text.

(gdb) pp BVAR(current_buffer,enable_multibyte_characters)
t
(gdb)
(gdb) pp BVAR(buffer,enable_multibyte_characters)
t

Thereʼs one stray \342 in there, but the rest looks like ASCII. The
character gnus should be trying to insert is #x2713, which is
represented as #xE2 #x9C #x93 (\342 \234 \223), so it looks like there
are some bytes missing.

(gdb) p current_buffer->text->beg
$21 = (unsigned char *) 0x555557dbaab0 " . [  32: Robert Pluim", ' ' <repeats 11 times>, "] Re: Font problem on git master\n .     [  23: Eli Zaretskii          ] \n .     <  27: Andreas Schwab         > \n . [  14: Stefan Monnier         ] Re: BNF Mode 0.4.3\n .     [  60: Serghei Iakovlev       ] \n .         [  28: Stefan Monnier         ] \n . [  17: Stefan Kangas          ] Re: master d8da850: Document cairo-related fallout to font-backend settings\n       [  42: Robert Pluim", ' ' <repeats 11 times>, "] \n\342  "

(gdb) p BUF_GAP_END_ADDR(current_buffer)
$22 = (unsigned char *) 0x555557dbb154 "        [  28: Stefan Kangas          ] \n", ' ' <repeats 15 times>, "[  28: Robert Pluim", ' ' <repeats 11 times>, "] \n", ' ' <repeats 19 times>, "[  18: Eli Zaretskii          ] \n", ' ' <repeats 23 times>, "[  28: Robert Pluim", ' ' <repeats 11 times>, "] \n", ' ' <repeats 27 times>, "[  25: Eli Zaretskii          ] \n", ' ' <repeats 15 times>, "[  35: T.V Raman", ' ' <repeats 14 times>, "] \n", ' ' <repeats 19 times>, "[  18: Robert Pluim", ' ' <repeats 11 times>, "] \n", ' ' <repeats 23 times>, "[  27: Robert Pluim", ' ' <repeats 11 times>, "] \n", ' ' <repeats 11 times>, "[  14: Eli Zaretskii          ] \n   [ 212: Alan Mackenzie         ] Re: c-mode pragma and preproc\n   [  18: Dmitry Gutov", ' ' <repeats 11 times>, "] Re: Emacs's set-frame-size can not work well with gnome-shell?\n       [  17: martin rudalics        ] \n", ' ' <repeats 11 times>, "[  24: Dmitry Gutov", ' ' <repeats 11 times>, "] \n", ' ' <repeats 15 times>, "[  17: martin rudalics        ] \n", ' ' <repeats 19 times>, "[  21: Dmitry Gutov", ' ' <repeats 11 times>, "] \n", ' ' <repeats 23 times>, "[  11: martin rudalics        ] \n .", ' ' <repeats 25 times>, "[   9: Dmitry Gutov", ' ' <repeats 11 times>, "] \n       <  58: Dmitry Gutov", ' ' <repeats 11 times>, "> \n       <  19: martin rudalics        > \n", ' ' <repeats 11 times>, "[  13: tumashu", ' ' <repeats 16 times>, "] \n", ' ' <repeats 11 times>, "[  19: tumashu", ' ' <repeats 16 times>, "] \n .     <  21: Dmitry Gutov", ' ' <repeats 11 times>, "> \n   [ 125: Gerry Agbobada         ] Question about composite.c\n       [  83: Eli Zaretskii          ] \n", ' ' <repeats 11 times>, "[  58: Gerry Agbobada         ] \n", ' ' <repeats 15 times>, "[  46: Eli Zaretskii          ] \n", ' ' <repeats 19 times>, "[  35: Gerry Agbobada         ] \n   [   8: Israel", ' ' <repeats 17 times>, "] Test\n   [  18: Paul W. Rankin         ] Re: Making vertical-border char defcustom?\n       [  27: Eli Zaretskii          ] \n   [   8: Bastien", ' ' <repeats 16 times>, "] Re: Help me secure some free time for org-mode in 2020\n   [  80: Anand Tamariya         ] Semantic font-lock for Java\n       [  15: Eli Zaretskii          ] \n", ' ' <repeats 11 times>, "[  17: Eli Zaretskii          ] \n   [  10: Robert Pluim", ' ' <repeats 11 times>, "] Re: master c1b6cf6: * lisp/progmodes/grep.el (grep-read-files-function): New var.\n   [  39: Daniel Pittman         ] Re: Building Emacs (git head, pdumper, macos)\n       [  20: Robert Pluim", ' ' <repeats 11 times>, "] \n   [  19: john", ' ' <repeats 19 times>, "] Question on fonts\n       [  48: Robert Pluim", ' ' <repeats 11 times>, "] \n   [  57: Alan Mackenzie         ] Re: /* FIXME: Call signal_after_change!  */ in callproc.c.  Well, why not?\n   [ 186: Yuan Fu", ' ' <repeats 16 times>, "] Re: Extend gdb to filter registers\n . [  22: Julien Cubizolles      ] Emacs dumps core in Gnus with gnus-uu-mark-thread\n"