Subject: bug#79131: 31.0.50; igc: nested signal, SIGSEGV

From: Gerd Möllmann <[email-masked]>
Date: Sun, 03 Aug 2025 16:06:00 +0200

Pip Cet <[email-masked]> writes:

> Assuming that this interval's "position" cache is correct (I think it
> should be), the code that crashed would try to move on to the next
> interval, which doesn't exist, fall off the end of the world and crash.
>
> But I don't know the interval code that well; is it possible that's a
> valid interval tree if the last few characters don't have properties?

I think an invariant of the interval tree is that it always covers the
whole buffer. We start with

intervals.c<cl-packages>:
   86 INTERVAL
   87 create_root_interval (Lisp_Object parent)
   88 {
   89   INTERVAL new;
   90 
   91   new = make_interval ();
   92 
   93   if (! STRINGP (parent))
   94     {
   95       new->total_length = (BUF_Z (XBUFFER (parent))
   96                            - BUF_BEG (XBUFFER (parent)));
   97       eassert (TOTAL_LENGTH (new) >= 0);
   98       set_buffer_intervals (XBUFFER (parent), new);
   99       new->position = BEG;

where one can see that. Adding text properties splits that interval and
so on, but the total length covered should be the buffer size.