Subject: 25.1.50; Emacs hang in MacOS 10.11.4

From: Josh Howard <[email-masked]>
Date: Mon, 16 May 2016 08:35:20 -0700

It's unclear what actions I take to trigger this bug. It seems to happen
after some indeterminate amount of time, though I do suspect there is a
link to my laptop going to sleep/waking, as it appears to happen
somewhat more frequently upon wake up. Emacs tends to hang at least a
couple of times a week, so I ran it with "emacs -Q" in the lldb debugger
and caught this backtrace.

(lldb) bt all
* thread #1: tid = 0x1ec72b, 0x00007fff955ddaf1 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 403, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
* frame #0: 0x00007fff955ddaf1 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 403
frame #1: 0x00007fff863ebc12 CoreFoundation`_CFAutoreleasePoolPop + 50
frame #2: 0x00007fff924579f5 Foundation`-[NSAutoreleasePool release] + 146
frame #3: 0x000000010027797a Emacs`ns_read_socket(terminal=, hold_quit=0x00000001006b94f0) + 250 at nsterm.m:4097
frame #4: 0x0000000100111600 Emacs`gobble_input + 320 at keyboard.c:6810
frame #5: 0x0000000100111205 Emacs`process_pending_signals + 5 at keyboard.c:7062
frame #6: 0x0000000100111200 Emacs`process_pending_signals + 32 at keyboard.c:7076
frame #7: 0x00000001001c911b Emacs`internal_equal(o1=, o2=, depth=, props=false, ht=0) + 651 at fns.c:2297
frame #8: 0x00000001001c89a9 Emacs`Fequal(o1=, o2=) + 57 at fns.c:2248
frame #9: 0x000000010017397a Emacs`compile_pattern(pattern=4299051916, regp=0x0000000000000000, translate=0, posix=false, multibyte=true) + 554 at search.c:227
frame #10: 0x00000001001747cb Emacs`fast_string_match_internal(regexp=, string=4310786804, table=) + 75 at search.c:471
frame #11: 0x00000001001579a2 Emacs`Ffind_file_name_handler [inlined] fast_string_match(regexp=, string=4310786804) + 29 at lisp.h:4020
frame #12: 0x0000000100157985 Emacs`Ffind_file_name_handler(filename=4310786804, operation=17712) + 437 at fileio.c:292
frame #13: 0x0000000100158858 Emacs`Fexpand_file_name(name=4310786804, default_directory=0) + 152 at fileio.c:809
frame #14: 0x00000001001640e9 Emacs`Fdo_auto_save(no_message=41280, current_only=0) + 377 at fileio.c:5515
frame #15: 0x00000001001084de Emacs`shut_down_emacs(sig=11, stuff=0) + 302 at emacs.c:2018
frame #16: 0x0000000100108219 Emacs`terminate_due_to_signal(sig=11, backtrace_limit=40) + 137 at emacs.c:378
frame #17: 0x0000000100138d89 Emacs`handle_fatal_signal(sig=) + 25 at sysdep.c:1635
frame #18: 0x00000001001371f1 Emacs`deliver_fatal_thread_signal [inlined] deliver_thread_signal + 129 at sysdep.c:1609
frame #19: 0x0000000100137182 Emacs`deliver_fatal_thread_signal(sig=) + 18 at sysdep.c:1647
frame #20: 0x0000000100138e42 Emacs`handle_sigsegv(sig=, siginfo=, arg=) + 178 at sysdep.c:1732
frame #21: 0x00007fff96b1e52a libsystem_platform.dylib`_sigtramp + 26
frame #22: 0x00007fff955ddaf2 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 404
frame #23: 0x00007fff8437f987 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 87
frame #24: 0x00007fff8644d067 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #25: 0x00007fff8644cfd7 CoreFoundation`__CFRunLoopDoObservers + 391
frame #26: 0x00007fff8642bef8 CoreFoundation`CFRunLoopRunSpecific + 328
frame #27: 0x00007fff9341171e HIServices`waitForTransaction + 204
frame #28: 0x00007fff94204b07 AppKit`minimizeItemsMaybeBatching + 89
frame #29: 0x00007fff94237f29 AppKit`-[NSWindow(NSWindow_Theme) _minimizeToDock] + 192
frame #30: 0x0000000100266694 Emacs`x_iconify_frame(f=) + 420 at nsterm.m:1615
frame #31: 0x000000010001682c Emacs`Ficonify_frame(frame=) + 108 at frame.c:2140
frame #32: 0x00000001001bf483 Emacs`Ffuncall(nargs=, args=0x400000000a000000) + 1731 at eval.c:2701
frame #33: 0x00000001001b5244 Emacs`Ffuncall_interactively(nargs=, args=) + 68 at callint.c:252
frame #34: 0x00000001001bf3a0 Emacs`Ffuncall(nargs=, args=0x400000000a000000) + 1504 at eval.c:2681
frame #35: 0x00000001001b7731 Emacs`Fcall_interactively(function=, record_flag=0, keys=4353710493) + 9425 at callint.c:840
frame #36: 0x00000001001bf4c7 Emacs`Ffuncall(nargs=, args=0x400000000a000000) + 1799 at eval.c:2708
frame #37: 0x0000000100214391 Emacs`exec_byte_code(bytestr=, vector=4298942077, maxdepth=, args_template=, nargs=, args=) + 3969 at bytecode.c:880
frame #38: 0x00000001001bf26b Emacs`Ffuncall(nargs=2, args=0x400000000a000000) + 1195 at eval.c:2750
frame #39: 0x00000001001bfddc Emacs`call1(fn=12864, arg1=24624) + 60 at eval.c:2560
frame #40: 0x000000010010ce92 Emacs`command_loop_1 + 2818 at keyboard.c:1471
frame #41: 0x00000001001bcd2c Emacs`internal_condition_case(bfun=(Emacs`command_loop_1 at keyboard.c:1248), handlers=, hfun=) + 92 at eval.c:1310
frame #42: 0x000000010012417f Emacs`command_loop_2(ignore=) + 63 at keyboard.c:1099
frame #43: 0x00000001001bc482 Emacs`internal_catch(tag=, func=(Emacs`command_loop_2 at keyboard.c:1095), arg=0) + 82 at eval.c:1075
frame #44: 0x000000010010b72a Emacs`command_loop + 234 at keyboard.c:1078
frame #45: 0x000000010010b59d Emacs`recursive_edit_1 + 205 at keyboard.c:684
frame #46: 0x000000010010b955 Emacs`Frecursive_edit + 373 at keyboard.c:755
frame #47: 0x000000010010a085 Emacs`main(argc=0, argv=) + 6933 at emacs.c:1643
frame #48: 0x00000001000026f9 Emacs`_start + 247
frame #49: 0x0000000100002601 Emacs`start + 33

thread #2: tid = 0x1ec747, 0x00007fff8fcb5efa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
frame #0: 0x00007fff8fcb5efa libsystem_kernel.dylib`kevent_qos + 10
frame #1: 0x00007fff95283165 libdispatch.dylib`_dispatch_mgr_invoke + 216
frame #2: 0x00007fff95282dcd libdispatch.dylib`_dispatch_mgr_thread + 52

thread #3: tid = 0x1ec75e, 0x00007fff8fcb507a libsystem_kernel.dylib`__select + 10
frame #0: 0x00007fff8fcb507a libsystem_kernel.dylib`__select + 10
frame #1: 0x000000010026bf3e Emacs`-[EmacsApp fd_handler:](self=, _cmd=, unused=) + 270 at nsterm.m:5549
frame #2: 0x00007fff92468d64 Foundation`__NSThread__start__ + 1351
frame #3: 0x00007fff9093799d libsystem_pthread.dylib`_pthread_body + 131
frame #4: 0x00007fff9093791a libsystem_pthread.dylib`_pthread_start + 168
frame #5: 0x00007fff90935351 libsystem_pthread.dylib`thread_start + 13

thread #4: tid = 0x1ec7d1, 0x00007fff8fcaef72 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'com.apple.NSEventThread'
frame #0: 0x00007fff8fcaef72 libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x00007fff8fcae3b3 libsystem_kernel.dylib`mach_msg + 55
frame #2: 0x00007fff8642d1c4 CoreFoundation`__CFRunLoopServiceMachPort + 212
frame #3: 0x00007fff8642c68c CoreFoundation`__CFRunLoopRun + 1356
frame #4: 0x00007fff8642bed8 CoreFoundation`CFRunLoopRunSpecific + 296
frame #5: 0x00007fff93ff5e99 AppKit`_NSEventThread + 149
frame #6: 0x00007fff9093799d libsystem_pthread.dylib`_pthread_body + 131
frame #7: 0x00007fff9093791a libsystem_pthread.dylib`_pthread_start + 168
frame #8: 0x00007fff90935351 libsystem_pthread.dylib`thread_start + 13

In GNU Emacs 25.1.50.3 (x86_64-apple-darwin15.4.0, NS appkit-1404.46 Version 10.11.4 (Build 15E65))
of 2016-05-12 built on jhoward-23688
Repository revision: 9872736ab7ada8132ebeafa8a699faf93772d7b4
Windowing system distributor 'Apple', version 10.3.1404
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Configured using:
'configure --enable-profiling'

Configured features:
JPEG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message puny seq byte-opt gv bytecomp
byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache
epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev
obarray minibuffer cl-preloaded 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 kqueue
cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 204843 9029)
(symbols 48 20526 0)
(miscs 40 44 166)
(strings 32 18078 6164)
(string-bytes 1 549938)
(vectors 16 34436)
(vector-slots 8 657264 5462)
(floats 8 175 56)
(intervals 56 209 0)
(buffers 976 12))