Subject: bug#25178: 26.0.50; Crash when pressing C-g in TTY mode

From: Elias Martenson <[email-masked]>
Date: Tue, 13 Dec 2016 10:52:17 +0800

> Eli Zaretskii <[email-masked]> writes:
>
> > From: Elias Martenson <[email-masked]>
> > Date: Mon, 12 Dec 2016 12:33:01 +0800
> > 
> > Build 2783e0e3899cf92910e97dc8bfda3e47b3df1478 with default options.
> > 
> > Start emacs -nw -Q
> > 
> > Press C-g
> > 
> > This causes the application to crash immediately.
> 
> Doesn't happen to me.
> 
> Can you run this under GDB and show the backtrace from the crash?

It still happens on a completely fresh checkout and install of
8db7b65d66f01e90a05cc9f11c67667233d84ca0

Here is the stack trace:

Thread 1 "emacs" received signal SIGINT, Interrupt.
0x00007fffef71f18c in pselect () from /usr/lib/libc.so.6
(gdb) bt full
#0  0x00007fffef71f18c in pselect () at /usr/lib/libc.so.6
#1  0x000000000069fd6b in xg_select (fds_lim=8, rfds=0x7fffffffdcd0, wfds=0x7fffffffdc50, efds=0x0, timeout=0x7fffffffdc30, sigmask=0x0) at xgselect.c:116
        all_rfds = {fds_bits = {192, 0 <repeats 15 times>}}
        all_wfds = {fds_bits = {0 <repeats 16 times>}}
        tmo = {tv_sec = 0, tv_nsec = 140737488345200}
        tmop = 0x7fffffffdc30
        context = 0x2d825d0
        have_wfds = true
        gfds_buf = 
            {{fd = 7, events = 1, revents = 0}, {fd = 6560509, events = 0, revents = 0}, {fd = -10080, events = 32767, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 1030, events = 0, revents = 0}, {fd = 42, events = 0, revents = 0}, {fd = 11055605, events = 0, revents = 0}, {fd = 11055572, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 88, events = 0, revents = 0}, {fd = 12167591, events = 0, revents = 0}, {fd = 11055572, events = 0, revents = 0}, {fd = 12167420, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 10, revents = 0}, {fd = 12772560, events = 0, revents = 0}, {fd = -11112, events = 32767, revents = 0}, {fd = 5573343, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 12772565, events = 0, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 12772560, events = 0, revents = 0}, {fd = 21486901, events = 0, revents = 0}, {fd = -11064, events = 32767, revents = 0}, {fd = 5570466, events = 0, revents = 0}, {fd = 21486901, events = 0, revents = 0}, {fd = -11040, events = 32767, revents = 0}, {fd = 5570466, events = 0, revents = 0}, {fd = 9, events = 0, revents = 0}, {fd = 5572836, events = 0, revents = 0}, {fd = 2, events = 0, revents = 0}, {fd = 13300048, events = 0, revents = 0}, {fd = 6281605, events = 0, revents = 0}, {fd = 45984, events = 0, revents = 0}, {fd = -136433516, events = 32767, revents = 0}, {fd = 5568885, events = 0, revents = 0}, {fd = 305, events = 0, revents = 0}, {fd = -134537216, events = 32767, revents = 0}, {fd = -268357864, events = 32767, revents = 0}, {fd = -268349704, events = 32767, revents = 0}, {fd = -136431405, events = 32767, revents = 0}, {fd = 305, events = 0, revents = 0}, {fd = -268349704, events = 32767, revents = 0}, {fd = -134537216, events = 32767, revents = 0}, {fd = -10792, events = 32767, revents = 0}, {fd = -10796, events = 32767, revents = 0}, {fd = -136433077, events = 32767, revents = 0}, {fd = 4242610, events = 0, revents = 0}, {fd = 4199752, events = 0, revents = 0}, {fd = -10792, events = 32767, revents = 0}, {fd = 2111285930, events = 0, revents = 0}, {fd = 26, events = 0, revents = 0}, {fd = -268349704, events = 32767, revents = 0}, {fd = -10576, events = 32767, revents = 0}, {fd = -268357864, events = 32767, revents = 0}, {fd = -10796, events = 32767, revents = 0}, {fd = -10592, events = 32767, revents = 0}, {fd = -135176416, events = 32767, revents = 0}, {fd = 106, events = 0, revents = 0}, {fd = 47427648, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = -134224792, events = 32767, revents = 0}, {fd = -10432, events = 32767, revents = 0}, {fd = -135175304, events = 32767, revents = 0}, {fd = 5, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = -10392, events = 32767, revents = 0}, {fd = -136430111, events = 32767, revents = 0}, {fd = 49, events = 0, revents = 0}, {fd = 22169539, events = 0, revents = 0}, {fd = 21486901, events = 0, revents = 0}, {fd = 9562752, events = 0, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 13251680, events = 0, revents = 0}, {fd = -10528, events = 32767, revents = 0}, {fd = 6138465, events = 0, revents = 0}, {fd = 13743104, events = 0, revents = 0}, {fd = 13251680, events = 0, revents = 0}, {fd = -10576, events = 32767, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 257, events = 0, revents = 0}, {fd = -11304, events = 32767, revents = 0}, {fd = 0, events = 6, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 11, events = 0, revents = 0}, {fd = 13251680, events = 0, revents = 0}, {fd = -10528, events = 32767, revents = 0}, {fd = 28272, events = 0, revents = 0}, {fd = 4294032, events = 0, revents = 0}, {fd = -10400, events = 32767, revents = 0}, {fd = 6141648, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 28272, events = 0, revents = 0}, {fd = 1, events = 135, revents = 0}, {fd = 1, events = 0, revents = 0}, {fd = 13251680, events = 0, revents = 0}, {fd = 13743104, events = 0, revents = 0}, {fd = 13254064, events = 0, revents = 0}, {fd = -11392, events = 32767, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 13282336, events = 0, revents = 0}, {fd = 5568885, events = 0, revents = 0}, {fd = 28272, events = 0, revents = 0}, {fd = -10352, events = 32767, revents = 0}, {fd = 6140345, events = 0, revents = 0}, {fd = 13251680, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 5573208, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = -10256, events = 32767, revents = 0}, {fd = 6144162, events = 0, revents = 0}, {fd = 0, events = 0, revents = 0}, {fd = 28272, events = 0, revents = 0},
{fd = 5, events = 0, revents = 0}, {fd = 6, events = 0, revents = 0}, {fd = 13251680, events = 0, revents = 0}, {fd = -10248, events = 32767, revents = 0}, {fd = 5573343, events = 0, revents = 0}, {fd = 13282336, events = 0, revents = 0}}
        gfds = 0x7fffffffd3e0
        gfds_size = 128
        n_gfds = 1
        retval = 0
        our_fds = 0
        max_fds = 7
        context_acquired = true
        i = 1
        nfds = 0
        tmo_in_millisec = -1
        must_free = 0
        need_to_dispatch = 35
#2  0x0000000000676dad in really_call_select (arg=0x7fffffffda20) at thread.c:498
        sa = 0x7fffffffda20
        self = 0xcc69e0 <primary_thread>
#3  0x00000000005d4a02 in flush_stack_call_func (func=0x676d51 <really_call_select>, arg=0x7fffffffda20) at alloc.c:5137
        end = 0x7fffffffd9a0
        self = 0xcc69e0 <primary_thread>
#4  0x0000000000676e2b in thread_select (func=0x69f84f <xg_select>, max_fds=7, rfds=0x7fffffffdcd0, wfds=0x7fffffffdc50, efds=0x0, timeout=0x7fffffffdc30, sigmask=0x0)
    at thread.c:517
        sa = 
          {func = 0x69f84f <xg_select>, max_fds = 7, rfds = 0x7fffffffdcd0, wfds = 0x7fffffffdc50, efds = 0x0, timeout = 0x7fffffffdc30, sigmask = 0x0, result = -1}
#5  0x0000000000651168 in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=0, wait_proc=0x0, just_wait_proc=0)
    at process.c:5345
        process_skipped = false
        channel = 1024
        nfds = 0
        Available = {fds_bits = {64, 0 <repeats 15 times>}}
        Writeok = {fds_bits = {0 <repeats 16 times>}}
        check_write = true
        check_delay = 0
        no_avail = false
        xerrno = 4
        proc = 47321728
        timeout = {tv_sec = 9, tv_nsec = 484656783}
        end_time = {tv_sec = 1481596880, tv_nsec = 100278958}
        timer_delay = {tv_sec = 9, tv_nsec = 484656783}
        got_output_end_time = {tv_sec = 1481596880, tv_nsec = 100278958}
        wait = TIMEOUT
        got_some_output = -1
        retry_for_async = false
        count = 3
        now = {tv_sec = 0, tv_nsec = -1}
#6  0x00000000004252be in sit_for (timeout=122, reading=true, display_option=1)
    at dispnew.c:5763
        sec = 30
        nsec = 0
        do_display = true
#7  0x000000000055bc48 in read_char (commandflag=1, map=18488707, prev_event=0, used_mouse_menu=0x7fffffffe24f, end_time=0x0) at keyboard.c:2722
        tem0 = 5568885
        timeout = 30
        delay_level = 4
        buffer_size = 1
        c = 0
        jmpcount = 3
        local_getcjmp = 
                {{__jmpbuf = {0, -1720637353449548036, 4294032, 140737488349360, 0, 0, -1720637351413213444, 1720636901125723900}, __mask_was_saved = 0, __saved_mask = {__val = {20304512, 13254064, 6140185, 0, 140737488347280, 5568885, 18152640, 13254064, 5703904, 0, 140737488347328, 5568885, 19983315, 140737488347424, 6272424, 0}}}}
        save_jump = 
                {{__jmpbuf = {0, 0, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 16 times>}}}}
        tem = 18488707
        save = 0
        previous_echo_area_message = 0
        also_record = 0
        reread = false
        recorded = false
        polling_stopped_here = false
        orig_kboard = 0x2d23870
#8  0x0000000000568714 in read_key_sequence (keybuf=0x7fffffffe400, bufsize=30, prompt=0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9136
        interrupted_kboard = 0x2d23870
        interrupted_frame = 0xd28688 <bss_sbrk_buffer+400168>
        key = 4545089
        used_mouse_menu = false
        echo_local_start = 0
        last_real_key_start = 0
        keys_local_start = 0
        new_binding = 5
        count = 3
        t = 0
        echo_start = 0
        keys_start = 0
        current_binding = 18488707
        first_event = 0
        first_unbound = 31
        mock_input = 0
        fkey = {parent = 14043411, map = 14043411, start = 0, end = 0}
        keytran = {parent = 13732419, map = 13732419, start = 0, end = 0}
        indec = {parent = 14043443, map = 14043443, start = 0, end = 0}
        shift_translated = false
        delayed_switch_frame = 0
        original_uppercase = 0
        original_uppercase_position = -1
        dummyflag = false
        starting_buffer = 0xd1b400 <bss_sbrk_buffer+346272>
        fake_prefixed_keys = 0
#9  0x0000000000558939 in command_loop_1 () at keyboard.c:1373
        cmd = 140737488348496
        keybuf = 
          {0, 29328, 8321642624, 0, 13251856, 29328, 288, 13283392, 13251856, 0, 140737488348320, 6271814, 4294967296, 140737488348352, 13254064, 0, 0, 140737488348320, 5568885, 0, 140737488348416, 6272424, 14045523, 3, 13254064, 29328, 0, 140737488348400, 5568885, 0}
        i = 0
        prev_modiff = 0
        prev_buffer = 0x0
        already_adjusted = false
#10 0x00000000005f64a5 in internal_condition_case (bfun=0x558528 <command_loop_1>, handlers=19680, hfun=0x557d15 <cmd_error>) at eval.c:1336
        val = 5568885
        c = 0x2d3af10
#11 0x0000000000558232 in command_loop_2 (ignore=0) at keyboard.c:1115
        val = 0
#12 0x00000000005f5d72 in internal_catch (tag=47472, func=0x558209 <command_loop_2>, arg=0) at eval.c:1101
        val = 5568885
        c = 0x2d23940
#13 0x00000000005581d4 in command_loop () at keyboard.c:1094
#14 0x00000000005578f0 in recursive_edit_1 () at keyboard.c:700
        count = 1
        val = 140737488348800
#15 0x0000000000557a6c in Frecursive_edit () at keyboard.c:771
        count = 0
        buffer = 0
#16 0x0000000000555867 in main (argc=3, argv=0x7fffffffe8b8) at emacs.c:1686
        stack_bottom_variable = 0 '\000'
        do_initial_setlocale = true
        dumping = false
        skip_args = 1
        no_loadup = false
        junk = 0x0
        dname_arg = 0x0
        ch_to_dir = 0x0
        original_pwd = 0x0
        disable_aslr = false
        rlim = {rlim_cur = 8720384, rlim_max = 18446744073709551615}
        sockfd = -1
*******************************

This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.