Hi, I use `emacs -nw` intensively for code development, often with 50+ files open for weeks at a time, many of them with indirect buffers created by `clone-indirect-buffer. Every once in a while, emacs will hard-freeze (ignoring both ^Z and ^G^G^G) when I switch to one of these indirect buffers. I'm forced to kill it from another terminal. I attached a snippet of a screenshot showing the terminal state at the time of the freeze. The end of this email contains the relevant output of report-emacs-bug, invoked from a fresh session (since I can't do it for the hung session): Attaching to the hung process with gdb, I see: Thread 1 "emacs" received signal SIGTTOU, Stopped (tty output). 0x00007f60bf9a8960 in __GI_tcsetattr (fd=..., optional_actions=..., termios_p=...) at ../sysdeps/unix/sysv/linux/tcsetattr.c:83 83 ../sysdeps/unix/sysv/linux/tcsetattr.c: No such file or directory. (gdb) xbacktrace "suspend-emacs" (0xc652c910) "suspend-frame" (0xc652cac0) "call-interactively" (0xc652cc80) "command-execute" (0xc652cdd8) The hung process consumes no CPU according to `top`, but if I attempt to continue execution, SIGTTOU is raised repeatedly; telling gdb to silently pass the signal through to emacs leaves gdb working 100% CPU and emacs working 40% CPU, so I suspect SIGTTOU is being raised continuously. Sending SIGUSR2 from the command-line has no visible effect, other than to make gdb hang when attempting to continue execution after attaching to the process; killing gdb with SIGTREM leaves the error message: Detaching from program: /usr/bin/emacs24-x, process 122941 Exception ignored in: Traceback (most recent call last): File "/usr/share/gdb/python/gdb/__init__.py", line 43, in flush def flush(self): KeyboardInterrupt Sending SIGTERM to emacs has no effect. I suspect the call to `suspend-emacs` is due to my unsuccessful ^Z attempt, so the real problem is likely above that point in the stack trace. Next time this happens I will use the techniques mentioned in /usr/share/emacs/24.5/etc/DEBUG to hopefully obtain more information, without the added confound of attempting ^Z or ^G^G^G first. The full backtrace is given at the end of this message. Thanks, Ryan Output of report-emacs-bug: In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian System Description: Ubuntu 16.04.1 LTS Configured using: `configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C++/l Minor modes in effect: sticky-control-mode: t delete-selection-mode: t terminal-mouse-mode: t column-enforce-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: /usr/share/emacs/24.5/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup ~ryan/.el/mouse hides /usr/share/emacs/24.5/lisp/mouse ~ryan/.el/ruby-mode hides /usr/share/emacs/24.5/lisp/progmodes/ruby-mode Features: (vc-dispatcher vc-hg cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ebuff-menu help-mode pp shadow sort gnus-util mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils xterm byte-opt bytecomp byte-compile cl-extra cconv sticky-control delsel cus-start cus-load terminal-mouse minibuf-isearch advice help-fns xcscope org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities time-date noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu easymenu calendar cal-loaddefs two-mode-mode lua-mode edmacro kmacro comint ansi-color ring column-enforce-mode easy-mmode cl-macs cl gv cl-loaddefs cl-lib xterm-extras tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) (gdb) bt full #0 0x00007f60bf9a8960 in __GI_tcsetattr (fd=fd@entry=5, optional_actions=optional_actions@entry=1, termios_p=termios_p@entry=0x7ffec652c780) at ../sysdeps/unix/sysv/linux/tcsetattr.c:83 resultvar = 18446744073709551104 k_termios = {c_iflag = 10241, c_oflag = 1, c_cflag = 191, c_lflag = 2609, c_line = 0 '\000', c_cc = "\a\a\177\025\004\000\001\000\000\000\000\377\000\000\000\000\377\000"} k_termios_old = {c_iflag = 11264, c_oflag = 5, c_cflag = 191, c_lflag = 35377, c_line = 0 '\000', c_cc = "\003\034\177\025\004\000\001\000\021\023\032\377\022\017\027\000\377\000"} retval = #1 0x0000000000502755 in emacs_set_tty (fd=5, settings=settings@entry=0x7ffec652c780, flushp=false) at sysdep.c:777 i = 0 #2 0x0000000000503a01 in init_sys_modes (tty_out=0x13e0960) at sysdep.c:1006 tty = {main = {c_iflag = 10241, c_oflag = 1, c_cflag = 191, c_lflag = 2609, c_line = 0 '\000', c_cc = "\a\a\177\025\004\000\001\000\000\000\000\377\000\000\000\000\377", '\000' , c_ispeed = 15, c_ospeed = 15}} tty_out = 0x13e0960 #3 0x0000000000503cf8 in init_all_sys_modes () at sysdep.c:834 tty = 0x13e0960 #4 0x000000000055c4a2 in unbind_to (count=count@entry=9, value=12392562) at eval.c:3310 quitf = 12392562 #5 0x00000000004f93ca in Fsuspend_emacs (stuffstring=12392562) at keyboard.c:10179 old_height = 70 old_width = 201 width = 0 height = 0 hook = 15877554 #6 0x000000000055d937 in Ffuncall (nargs=, args=args@entry=0x7ffec652c908) at eval.c:2811 fun = 8669533 original_fun = 12439794 numargs = val = internal_args = 0x7ffec652c880 i = count = 8 #7 0x0000000000592b23 in exec_byte_code (bytestr=, vector=9879957, maxdepth=, args_template=, nargs=nargs@entry=0, args=, args@entry=0x0) at bytecode.c:916 targets = {0x592c90 , 0x593c28 , 0x593c30 , 0x593c38 , 0x592a78 , 0x592a80 , 0x594320 , 0x5942c0 , 0x594410 , 0x5943e8 , 0x594520 , 0x594408 , 0x592bb0 , 0x592bb0 , 0x593fa0 , 0x5943c0 , 0x5941e0 , 0x5941e8 , 0x593bb0 , 0x594230 , 0x592c18 , 0x592c20 , 0x592ce0 , 0x5941f0 , 0x594260 , 0x594268 , 0x5942a8 , 0x594270 , 0x592ab8 , 0x592ac0 , 0x594218 , 0x594238 , 0x5942a0 , 0x5942b0 , 0x5942b8 , 0x592e10 , 0x592b00 , 0x592b00 , 0x5943f0 , 0x594278 , 0x593c70 , 0x593c68 , 0x593c78 , 0x592e30 , 0x592b40 , 0x592b40 , 0x592e18 , 0x593c40 , 0x593e90 , 0x593e40 , 0x593ce0 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x593360 , 0x5933f0 , 0x593438 , 0x593480 , 0x5934c8 , 0x594100 , 0x594040 , 0x593510 , 0x5940c0 , 0x594080 , 0x593548 , 0x593580 , 0x5935b0 , 0x5935f0 , 0x593628 , 0x5936b0 , 0x5936e0 , 0x593720 , 0x593760 , 0x593790 , 0x5937c0 , 0x593800 , 0x593840 , 0x593880 , 0x5938c0 , 0x5938f8 , 0x593930 , 0x5939b8 , 0x5939f8 , 0x593a38 , 0x593af0 , 0x593b30 , 0x593b70 , 0x594528 , 0x594568 , 0x5945a0 , 0x5945d8 , 0x594610 , 0x594648 , 0x594680 , 0x594730 , 0x592b80 , 0x594770 , 0x5947a0 , 0x594820 , 0x594860 , 0x5948a0 , 0x5948d0 , 0x594900 , 0x594930 , 0x594960 , 0x592c90 , 0x594990 , 0x5949c0 , 0x5949f0 , 0x594a20 , 0x594a50 , 0x594a80 , 0x592b80 , 0x592c90 , 0x594ab0 , 0x594af0 , 0x594b20 , 0x594b50 , 0x594b90 , 0x594bd0 , 0x594c00 , 0x594cd0 , 0x594d10 , 0x594d50 , 0x594d90 , 0x594dc0 , 0x592c90 , 0x5944d0 , 0x592e68 , 0x593fb8 , 0x592f08 , 0x592fc0 , 0x593040 , 0x593c80 , 0x5944b0 , 0x592cf8 , 0x594418 , 0x594448 , 0x593e10 , 0x593e50 , 0x593ec0 , 0x593f10 , 0x593f50 , 0x593300 , 0x592e38 , 0x594df0 , 0x594e30 , 0x595048 , 0x595070 , 0x5950a0 , 0x5950d0 , 0x595110 , 0x595150 , 0x595190 , 0x5951d0 , 0x594e60 , 0x594ea0 , 0x594ee0 , 0x594f10 , 0x594f50 , 0x594f90 , 0x594fd0 , 0x595010 , 0x5946b8 , 0x5946f0 , 0x593bb8 , 0x593bf0 , 0x592c90 , 0x5930f0 , 0x593178 , 0x5931e8 , 0x593288 , 0x594148 , 0x593660 , 0x593968 , 0x5947d0 , 0x594370 , 0x592d28 , 0x592c90 , 0x592c90 , 0x592dc0 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592d88 } count = op = vectorp = 0x96c198 stack = {pc = 0xa96f4a "\202'", byte_string = 9879921, byte_string_start = 0xa96f2d "\301\302 !\211\030\303>\203\020", next = 0x7ffec652cd00} top = 0x7ffec652c908 result = type = #8 0x000000000055d3af in funcall_lambda (fun=9879869, nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffec652cac0) at eval.c:3044 val = syms_left = 12392562 lexenv = 12392562 i = optional = rest = #9 0x000000000055d74b in Ffuncall (nargs=nargs@entry=1, args=args@entry=0x7ffec652cab8) at eval.c:2872 fun = original_fun = 16024210 numargs = 0 val = internal_args = i = count = 6 #10 0x000000000055eef7 in apply1 (fn=fn@entry=16024210, arg=arg@entry=12392562) at eval.c:2577 gcpro1 = #11 0x00000000005595b1 in Fcall_interactively (function=16024210, record_flag=12392562, keys=12427517) at callint.c:378 input = funval = events = args = visargs = specs = 12392562 filter_specs = teml = up_event = enable = next_event = prefix_arg = 12392562 string = 0x0 tem = varies = i = nargs = mark = arg_from_tty = false gcpro3 = gcpro4 = key_count = record_then_fail = false save_this_command = 16024210 save_last_command = 16518402 save_this_original_command = 16024210 save_real_this_command = 16024210 #12 0x000000000055d91d in Ffuncall (nargs=, args=args@entry=0x7ffec652cc78) at eval.c:2818 fun = 11573845 original_fun = 12529666 numargs = val = internal_args = 0x7ffec652cc80 i = count = 4 #13 0x0000000000592b23 in exec_byte_code (bytestr=, vector=9616213, maxdepth=, args_template=, nargs=nargs@entry=1, args=, args@entry=0x92bb31 ) at bytecode.c:916 targets = {0x592c90 , 0x593c28 , 0x593c30 , 0x593c38 , 0x592a78 , 0x592a80 , 0x594320 , 0x5942c0 , 0x594410 , 0x5943e8 , 0x594520 , 0x594408 , 0x592bb0 , 0x592bb0 , 0x593fa0 , 0x5943c0 , 0x5941e0 , 0x5941e8 , 0x593bb0 , 0x594230 , 0x592c18 , 0x592c20 , 0x592ce0 , 0x5941f0 , 0x594260 , 0x594268 , 0x5942a8 , 0x594270 , 0x592ab8 , 0x592ac0 , 0x594218 , 0x594238 , 0x5942a0 , 0x5942b0 , 0x5942b8 , 0x592e10 , 0x592b00 , 0x592b00 , 0x5943f0 , 0x594278 , 0x593c70 , 0x593c68 , 0x593c78 , 0x592e30 , 0x592b40 , 0x592b40 , 0x592e18 , 0x593c40 , 0x593e90 , 0x593e40 , 0x593ce0 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x593360 , 0x5933f0 , 0x593438 , 0x593480 , 0x5934c8 , 0x594100 , 0x594040 , 0x593510 , 0x5940c0 , 0x594080 , 0x593548 , 0x593580 , 0x5935b0 , 0x5935f0 , 0x593628 , 0x5936b0 , 0x5936e0 , 0x593720 , 0x593760 , 0x593790 , 0x5937c0 , 0x593800 , 0x593840 , 0x593880 , 0x5938c0 , 0x5938f8 , 0x593930 , 0x5939b8 , 0x5939f8 , 0x593a38 , 0x593af0 , 0x593b30 , 0x593b70 , 0x594528 , 0x594568 , 0x5945a0 , 0x5945d8 , 0x594610 , 0x594648 , 0x594680 , 0x594730 , 0x592b80 , 0x594770 , 0x5947a0 , 0x594820 , 0x594860 , 0x5948a0 , 0x5948d0 , 0x594900 , 0x594930 , 0x594960 , 0x592c90 , 0x594990 , 0x5949c0 , 0x5949f0 , 0x594a20 , 0x594a50 , 0x594a80 , 0x592b80 , 0x592c90 , 0x594ab0 , 0x594af0 , 0x594b20 , 0x594b50 , 0x594b90 , 0x594bd0 , 0x594c00 , 0x594cd0 , 0x594d10 , 0x594d50 , 0x594d90 , 0x594dc0 , 0x592c90 , 0x5944d0 , 0x592e68 , 0x593fb8 , 0x592f08 , 0x592fc0 , 0x593040 , 0x593c80 , 0x5944b0 , 0x592cf8 , 0x594418 , 0x594448 , 0x593e10 , 0x593e50 , 0x593ec0 , 0x593f10 , 0x593f50 , 0x593300 , 0x592e38 , 0x594df0 , 0x594e30 , 0x595048 , 0x595070 , 0x5950a0 , 0x5950d0 , 0x595110 , 0x595150 , 0x595190 , 0x5951d0 , 0x594e60 , 0x594ea0 , 0x594ee0 , 0x594f10 , 0x594f50 , 0x594f90 , 0x594fd0 , 0x595010 , 0x5946b8 , 0x5946f0 , 0x593bb8 , 0x593bf0 , 0x592c90 , 0x5930f0 , 0x593178 , 0x5931e8 , 0x593288 , 0x594148 , 0x593660 , 0x593968 , 0x5947d0 , 0x594370 , 0x592d28 , 0x592c90 , 0x592c90 , 0x592dc0 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592c90 , 0x592d88 } count = op = vectorp = 0x92bb58 stack = {pc = 0xab7a57 "\006\006\071\203\233", byte_string = 9616177, byte_string_start = 0xab79e3 "\306\020\211?\205\f", next = 0x0} top = 0x7ffec652cc78 result = type = #14 0x000000000055d447 in funcall_lambda (fun=0, nargs=nargs@entry=1, arg_vector=0x92bb31 , arg_vector@entry=0x7ffec652cdd8) at eval.c:2978 val = syms_left = lexenv = i = optional = rest = #15 0x000000000055d74b in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7ffec652cdd0) at eval.c:2872 fun = original_fun = 12436386 numargs = 1 val = internal_args = i = count = 3 #16 0x000000000055da6a in call1 (fn=, arg1=) at eval.c:2610 ret_ungc_val = gcpro1 = {next = , var = , nvars = 2} args = {12436386, 16024210} #17 0x00000000004f82ed in command_loop_1 () at keyboard.c:1560 cmd = keybuf = {104, 76, 268, 236, 212, 268, 9263360, 140732225736448, 12392562, 27847414, 1, 140732225737104, 27847414, 5633300, 12439986, 27847414, 8698369, 12392562, 0, -8156672133596453632, 27847414, 5172221, 140732225736448, 12392562, 12392562, 5172540, 12640768, 5550502, 12516322, 64} i = prev_modiff = 392 prev_buffer = 0x1a08010 #18 0x000000000055bba7 in internal_condition_case (bfun=bfun@entry=0x4f7f50 , handlers=, hfun=hfun@entry=0x4eec30 ) at eval.c:1348 val = c = #19 0x00000000004ea13e in command_loop_2 (ignore=ignore@entry=12392562) at keyboard.c:1178 val = -512 #20 0x000000000055ba8b in internal_catch (tag=12440034, func=func@entry=0x4ea120 , arg=12392562) at eval.c:1112 val = c = #21 0x00000000004ee817 in command_loop () at keyboard.c:1157 No locals. #22 recursive_edit_1 () at keyboard.c:778 val = 20613024 #23 0x00000000004eeb58 in Frecursive_edit () at keyboard.c:849 buffer = #24 0x0000000000418619 in main (argc=, argv=0x7ffec652d198) at emacs.c:1642 dummy = 0 stack_bottom_variable = 0 '\000' do_initial_setlocale = dumping = skip_args = 1 rlim = {rlim_cur = 8720000, rlim_max = 18446744073709551615} no_loadup = false junk = 0x0 dname_arg = 0x0 ch_to_dir = 0x0 original_pwd =