Subject: bug#28430: 26.0.50; Segfault on unexpected connection loss

From: Daniel Kraus <[email-masked]>
Date: Wed, 13 Sep 2017 17:12:14 +0800

Hi!

Eli Zaretskii <[email-masked]> writes:

>> From: Daniel Kraus <[email-masked]>
>> Date: Tue, 12 Sep 2017 13:41:20 +0800
>>
>> This bug happens with restclient mode but I suspect it happens
>> for other packages as well?!
>>
>> To reproduce:
>>
>> Start in a process to listen on a port, e.g.
>> #+BEGIN_SRC sh
>> nc -l -p 6543
>> #+END_SRC
>>
>> Start emacs: `emacs --debug-init -Q`
>>
>> Load restclient:
>> #+BEGIN_SRC emacs-lisp
>> (add-to-list 'load-path "/home/daniel/.emacs.d/elpa/restclient-20170727.825")
>> (require 'restclient)
>> #+END_SRC
>> Open new buffer (e.g. 'test.rest') and `M-x restclient-mode`.
>> Type:
>> `GET http://127.0.0.1:6543/`
>> and then press `C-c C-c`
>>
>> Switch to the netcat window and Ctrl-C to break up the connection.
>> Emacs segfaults:
>> #+BEGIN_QUOTE
>> Fatal error 11: Segmentation fault
>
> Can you please run this under GDB, and when Emacs segfaults, produce
> the C backtrace and post it here?

--cut--
#0  0x00007ffff017bc40 in raise () at /usr/lib/libpthread.so.0
#1  0x0000000000597ab9 in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:394
#2  0x0000000000632a74 in die (msg=0x778761 "CONSP (data)", file=0x7786d1 "keyboard.c", line=999) at alloc.c:7419
#3  0x000000000059c3e1 in cmd_error_internal (data=..., context=0x798c6c "error in process sentinel: ") at keyboard.c:999
#4  0x00000000006c5edd in exec_sentinel_error_handler (error_val=...) at process.c:7105
#5  0x0000000000657d51 in internal_condition_case_1 (bfun=0x6c2b0d <read_process_output_call>, arg=..., handlers=..., hfun=0x6c5ebe <exec_sentinel_error_handler>) at eval.c:1352
#6  0x00000000006c609c in exec_sentinel (proc=..., reason=...) at process.c:7158
#7  0x00000000006c6303 in status_notify (deleting_process=0x0, wait_proc=0x0) at process.c:7260
#8  0x00000000006c1353 in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=..., wait_proc=0x0, just_wait_proc=0) at process.c:5199
#9  0x00000000004285e6 in sit_for (timeout=..., reading=true, display_option=1) at dispnew.c:5763
#10 0x00000000005a1080 in read_char (commandflag=1, map=..., prev_event=..., used_mouse_menu=0x7fffffffe2a1, end_time=0x0) at keyboard.c:2724
#11 0x00000000005b0ffd in read_key_sequence (keybuf=0x7fffffffe440, bufsize=30, prompt=..., dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9151
#12 0x000000000059d045 in command_loop_1 () at keyboard.c:1372
#13 0x0000000000657c85 in internal_condition_case (bfun=0x59cbe3 <command_loop_1>, handlers=..., hfun=0x59c1c7 <cmd_error>) at eval.c:1332
#14 0x000000000059c7bd in command_loop_2 (ignore=...) at keyboard.c:1114
#15 0x000000000065712e in internal_catch (tag=..., func=0x59c790 <command_loop_2>, arg=...) at eval.c:1097
#16 0x000000000059c75b in command_loop () at keyboard.c:1093
#17 0x000000000059bcb1 in recursive_edit_1 () at keyboard.c:699
#18 0x000000000059bea6 in Frecursive_edit () at keyboard.c:770
#19 0x000000000059988d in main (argc=2, argv=0x7fffffffe898) at emacs.c:1709
--cut--

Let me know if you need more info or I can do something else to help.

Thanks,
  Daniel