Subject: bug#50096: args-out-of-range in redisplay_internal

From: Juri Linkov <[email-masked]>
Date: Tue, 17 Aug 2021 21:24:29 +0300

>> Should I bisect or do you have an idea what commit caused this?

Meanwhile, I narrowed it down to some commit between
5d7b1d5fc7 and adb6c3f1a4.

> It's more interesting to understand first why does Emacs think these
> "args are out of range".  What is 'object' here:
>
>> #1 0x000055c2daa345d1 in validate_interval_range
>> (object=XIL(0x7f71fab29715), begin=0x7ffdc316c408,
>> end=0x7ffdc316c408, force=false) at textprop.c:159
>
> Ask GDB:
>
>   (gdb) frame 1
>   (gdb) p object
>   (gdb) xtype

(gdb) frame 1
#1  0x000056533c3b51a8 in validate_interval_range (object=XIL(0x7f56134fb6bd), begin=0x7fff7e2e3448, end=0x7fff7e2e3448, force=false) at textprop.c:159
159		args_out_of_range (begin0, end0);
(gdb) p object
$1 = XIL(0x7f56134fb6bd)
(gdb) xtype
Lisp_Vectorlike
PVEC_BUFFER

> If 'object' is a buffer, then
>
>   (gdb) p BUF_BEGV (XBUFFER (object))
>   (gdb) p BUF_ZV (XBUFFER (object))

(gdb) p BUF_BEGV (XBUFFER (object))
$2 = 1
(gdb) p BUF_ZV (XBUFFER (object))
$3 = 1