Subject: bug#47244: 28.0.50; SIGSEGV in long-runnning Emacs

From: Michael Welsh Duggan <[email-masked]>
Date: Mon, 29 Mar 2021 10:06:43 -0400

Eli Zaretskii <[email-masked]> writes:

>> From: Michael Welsh Duggan <[email-masked]>
>> Cc: Michael Welsh Duggan <[email-masked]>,  Eli Zaretskii <[email-masked]>,
>>   "[email-masked]" <[email-masked]>,  "[email-masked]"
>>  <[email-masked]>,  "[email-masked]" <[email-masked]>
>> Date: Wed, 24 Mar 2021 22:19:35 -0400
>> 
>> > --- a/src/buffer.c
>> > +++ b/src/buffer.c
>> > @@ -2151,6 +2151,9 @@ set_buffer_internal_1 (register struct buffer *b)
>> >
>> >    BUFFER_CHECK_INDIRECTION (b);
>> >
>> > +  if (!BUFFER_LIVE_P (b))
>> > +    error ("Selecting deleted buffer");
>> > +
>> >    old_buf = current_buffer;
>> >    current_buffer = b;
>> >    last_known_column_point = -1;   /* Invalidate indentation cache.  */
>> 
>> Okay.  Building now and will run until...something happens?  Should I be
>> expecting an Emacs error from this?
>
> Yes.
>
>> Should I breakpoint the error() clause?
>
> Better put a breakpoint on this call to 'error' instead, because
> 'error' could be called for unrelated reasons, and it could be caught
> -- you don't want those cases.

I have now hit this breakpoint.  Backtrace included.  xbacktrace was
empty.  I'll leave the gdb session up for forensics.

#0  set_buffer_internal_2 (b=0x5555578f43d8) at ../../master/src/buffer.c:2155
        old_buf = 0x555555593480 <_start>
        tail = XIL(0)
#1  0x0000555555713f28 in set_buffer_internal_1 (b=0x1)
    at ../../master/src/buffer.c:2141
#2  0x00005555556e4ec6 in set_buffer_internal (b=0x5555578f43d8)
    at ../../master/src/buffer.h:1184
#3  0x00005555556e6b21 in command_loop_1 () at ../../master/src/keyboard.c:1289
        cmd = XIL(0x7fffffffde10)
        keybuf = 
          {XIL(0), XIL(0x7ffff2c27c1d), XIL(0x555555765cd4), XIL(0x11cf6b0), XIL(0x7fffffffdd70), XIL(0x55555579e20b), XIL(0x11cf6b0), XIL(0x7ffff257e4c4), XIL(0x555559de7123), XIL(0x7ffff2c27c1d), XIL(0x7ffff2c27c1d), XIL(0x555559de7123), XIL(0x7ffff257e4c4), XIL(0x11cf6b0), XIL(0), XIL(0), XIL(0x555555cc5f80), XIL(0), XIL(0), XIL(0x7fffffffdd70), XIL(0x5555556e3c73), XIL(0xffffddc0), XIL(0x555555cc5f80), XIL(0), XIL(0), XIL(0x7fffffffdda0), XIL(0x555555797d03), make_fixnum(0), XIL(0x7fffffffdde0), XIL(0x55555579b3f4)}
        i = 1
        prev_modiff = 0
        prev_buffer = 0x0
        already_adjusted = false
#4  0x000055555579afef in internal_condition_case
    (bfun=0x5555556e690c <command_loop_1>, handlers=XIL(0x90), hfun=0x5555556e60a8 <cmd_error>) at ../../master/src/eval.c:1439
        val = XIL(0x5555556e3c73)
        c = 0x555555dc13e0
#5  0x00005555556e65d4 in command_loop_2 (ignore=XIL(0))
    at ../../master/src/keyboard.c:1094
        val = make_fixnum(0)
#6  0x000055555579a7fd in internal_catch
    (tag=XIL(0xd9e0), func=0x5555556e65a7 <command_loop_2>, arg=XIL(0))
    at ../../master/src/eval.c:1189
        val = XIL(0xd9e0)
        c = 0x555555daa710
#7  0x00005555556e6573 in command_loop () at ../../master/src/keyboard.c:1073
#8  0x00005555556e5c79 in recursive_edit_1 ()
    at ../../master/src/keyboard.c:720
        count = 1
        val = XIL(0x7fffffffdf50)
#9  0x00005555556e5dfc in Frecursive_edit () at ../../master/src/keyboard.c:789
        count = 0
        buffer = XIL(0)
#10 0x00005555556e2829 in main (argc=2, argv=0x7fffffffe1b8)
    at ../../master/src/emacs.c:2050
        stack_bottom_variable = 0x7ffff617e053
        no_loadup = false
        junk = 0x0
        dname_arg = 0x0
        ch_to_dir = 0x0
        original_pwd = 0x0
        dump_mode = 0x0
        skip_args = 1
        temacs = 0x0
        attempt_load_pdump = true
        rlim = {
          rlim_cur = 10022912,
          rlim_max = 18446744073709551615
        }
        lc_all = 0x0
        sockfd = -1
        module_assertions = false

-- 
Michael Welsh Duggan
([email-masked])