Subject: bug#16355: closed (Re: bug#16355: Crash/Hang when restoring via Mac "resume" [Mac/NS])

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 26 May 2016 20:20:03 +0000

Your bug report

#16355: Crash/Hang when restoring via Mac "resume" [Mac/NS]

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16355: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16355
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#16355: Crash/Hang when restoring via Mac "resume" [Mac/NS]
From: David Reitter <[email-masked]>
To: Alan Third <[email-masked]>
Cc: [email-masked]
Date: Thu, 26 May 2016 16:19:28 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On May 26, 2016, at 4:16 PM, Alan Third <[email-masked]> wrote:
> Can you confirm whether these crashes are still happening?

The report was from beginning of 2014.  I don’t recall seeing a lot of these crashes more recently, so let’s close the bug.

Subject: Crash/Hang when restoring via Mac "resume" [Mac/NS]
From: David Reitter <[email-masked]>
To: Bug-Gnu-Emacs <[email-masked]>
Date: Sun, 5 Jan 2014 17:21:58 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

If started manually from Finder (rather than automatically after
logging in), Emacs hangs (1).

Sometimes, after a successful reboot and resume of the application, it
hangs when quitting (2).

Usually, when restarting after a boot (with resume), Emacs hangs in
ns_term_init (3).  [Note that this is with a vanilla GNU Emacs --with-ns,
current HEAD, on OS X 10.9.]

The problem is easily reproducible, and I have countless crash reports
from users.  It does not occur with an Emacs 23-based build.

(2) and (3) are in a [autoreleasepool release].

If it is a retain/release issue, NSZombieEnabled=YES won't bring 
up anything during normal runs, and 
I haven't figured out how to do it during resume on 10.9 (without
forking Emacs from within itself, which makes the error go away).

Setting the NSWindow to "not restorable" does not help.
(  [win setRestorable: NO] ).

Any other suggestions on how to debug this?

(1)

(lldb) bt
* thread #1: tid = 0x06bc, 0x00007fff8d996a1a libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
    frame #0: 0x00007fff8d996a1a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff8d995dd5 libsystem_kernel.dylib`mach_msg + 253
    frame #2: 0x00007fff97036315 CoreFoundation`__CFRunLoopServiceMachPort + 181
    frame #3: 0x00007fff97035939 CoreFoundation`__CFRunLoopRun + 1161
    frame #4: 0x00007fff97035275 CoreFoundation`CFRunLoopRunSpecific + 309
    frame #5: 0x00007fff95ee3f0d HIToolbox`RunCurrentEventLoopInMode + 226
    frame #6: 0x00007fff95ee3cb7 HIToolbox`ReceiveNextEventCommon + 479
    frame #7: 0x00007fff95ee3abc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 65
    frame #8: 0x00007fff8f71e28e AppKit`_DPSNextEvent + 1434
    frame #9: 0x00007fff8f71d8db AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    frame #10: 0x000000010029ba5c Aquamacs`-[EmacsApp run](self=0x0000610000124f60, _cmd=0x00007fff90153296) + 300 at nsterm.m:4597
    frame #11: 0x0000000100299478 Aquamacs`ns_select(nfds=0, readfds=0x00007fff5fbfeca0, writefds=0x00007fff5fbfec20, exceptfds=0x0000000000000000, timeout=0x00007fff5fbfebf8, sigmask=0x0000000000000000) + 1016 at nsterm.m:3769
    frame #12: 0x0000000100252c2f Aquamacs`wait_reading_process_output(time_limit=75, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=4328534074, wait_proc=0x0000000000000000, just_wait_proc=0) + 3727 at process.c:4579
    frame #13: 0x00000001000087a5 Aquamacs`sit_for(timeout=300, reading=true, display_option=1) + 597 at dispnew.c:5766
    frame #14: 0x000000010013243d Aquamacs`read_char(commandflag=1, map=4339007302, prev_event=4328534074, used_mouse_menu=0x00007fff5fbff54f, end_time=0x0000000000000000) + 4301 at keyboard.c:2815
    frame #15: 0x000000010012de7d Aquamacs`read_key_sequence(keybuf=0x00007fff5fbff780, bufsize=30, prompt=4328534074, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) + 1757 at keyboard.c:9108
    frame #16: 0x000000010012c9c8 Aquamacs`command_loop_1 + 1224 at keyboard.c:1431
    frame #17: 0x00000001001ea289 Aquamacs`internal_condition_case(bfun=0x000000010012c500, handlers=4328609626, hfun=0x0000000100146330) + 441 at eval.c:1331
    frame #18: 0x0000000100146229 Aquamacs`command_loop_2(ignore=4328534074) + 41 at keyboard.c:1158
    frame #19: 0x00000001001e9871 Aquamacs`internal_catch(tag=4328605818, func=0x0000000100146200, arg=4328534074) + 401 at eval.c:1097
    frame #20: 0x000000010012bacb Aquamacs`command_loop + 187 at keyboard.c:1137
    frame #21: 0x000000010012b994 Aquamacs`recursive_edit_1 + 132 at keyboard.c:776
    frame #22: 0x000000010012bc70 Aquamacs`Frecursive_edit + 320 at keyboard.c:840
    frame #23: 0x0000000100129d22 Aquamacs`main(argc=2, arg

(lldb) f 11
frame #11: 0x0000000100299478 Aquamacs`ns_select(nfds=0, readfds=0x00007fff5fbfeca0, writefds=0x00007fff5fbfec20, exceptfds=0x0000000000000000, timeout=0x00007fff5fbfebf8, sigmask=0x0000000000000000) + 1016 at nsterm.m:3769
   3766	    {
   3767	      emacs_abort ();
   3768	    }
-> 3769	  [NSApp run];
   3770	  --apploopnr;
   3771	  emacs_event = NULL;
   3772	  if (nr > 0 && readfds)
(lldb) fr v
(int) nfds = 0
(fd_set *) readfds = 0x00007fff5fbfeca0
(fd_set *) writefds = 0x00007fff5fbfec20
(fd_set *) exceptfds = 0x0000000000000000
(const timespec *) timeout = 0x00007fff5fbfebf8
(const sigset_t *) sigmask = 0x0000000000000000
(int) result = 1
(int) t = 1273043
(int) k = 1
(int) nr = 0
(input_event) event = {
  kind = NO_EVENT
  code = 0
  part = scroll_bar_above_handle
  modifiers = 0
  x = 0
  y = 0
  timestamp = 0
  frame_or_window = 0
  arg = 0
}
(char) c = '\0'

(lldb) f 10
frame #10: 0x000000010029ba5c Aquamacs`-[EmacsApp run](self=0x0000610000124f60, _cmd=0x00007fff90153296) + 300 at nsterm.m:4597
   4594	    self->isFirst = YES;
   4595
   4596	  return self;
-> 4597	}
   4598
   4599	- (void)run
   4600	{
(lldb) fr v
(EmacsApp *) self = 0x0000610000124f60
(SEL) _cmd = "run"
(NSAutoreleasePool *) pool = 0x000060000005ca10
(NSEvent *) event = 0x00007fff5fbfe810
(lldb) po event
[no Objective-C description available]

(2)

(lldb) bt
* thread #1: tid = 0x0fe3, 0x00007fff8eb3f5fd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 409, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x00007fff8eb3f5fd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 409
    frame #1: 0x00007fff94dacd72 CoreFoundation`_CFAutoreleasePoolPop + 50
    frame #2: 0x00007fff8ed54e4c Foundation`-[NSAutoreleasePool release] + 140
    frame #3: 0x00000001002b1521 Aquamacs`ns_read_socket(terminal=0x0000000105a22ba8, hold_quit=0x00007fff5fbfc510) + 273 at nsterm.m:3632
    frame #4: 0x0000000100130ccd Aquamacs`gobble_input + 173 at keyboard.c:6865
    frame #5: 0x0000000100138ebd Aquamacs`handle_async_input + 13 at keyboard.c:7105
    frame #6: 0x000000010012f973 Aquamacs`process_pending_signals + 19 at keyboard.c:7119
    frame #7: 0x0000000100138f2b Aquamacs`unblock_input_to(level=0) + 75 at keyboard.c:7134
    frame #8: 0x000000010012c31e Aquamacs`totally_unblock_input + 14 at keyboard.c:7157
    frame #9: 0x00000001001283dc Aquamacs`terminate_due_to_signal(sig=11, backtrace_limit=40) + 44 at emacs.c:351
    frame #10: 0x0000000100156da8 Aquamacs`handle_fatal_signal(sig=11) + 24 at sysdep.c:1624
    frame #11: 0x0000000100156d7a Aquamacs`deliver_thread_signal(sig=11, handler=0x0000000100156d90) + 154 at sysdep.c:1598
    frame #12: 0x000000010015575a Aquamacs`deliver_fatal_thread_signal(sig=11) + 26 at sysdep.c:1636
    frame #13: 0x00007fff9616a5aa libsystem_platform.dylib`_sigtramp + 26
    frame #14: 0x00007fff8eb3f62b libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 455
    frame #15: 0x00007fff94dacd72 CoreFoundation`_CFAutoreleasePoolPop + 50
    frame #16: 0x00007fff8ed54e4c Foundation`-[NSAutoreleasePool release] + 140
    frame #17: 0x000000010029bab6 Aquamacs`-[EmacsApp run](self=0x0000610000124380, _cmd=0x00007fff8df02296) + 390 at nsterm.m:4602
    frame #18: 0x000000010029b2cb Aquamacs`ns_term_init(display_name=4367432889) + 6459 at nsterm.m:4530
    frame #19: 0x00000001002bf9fb Aquamacs`Fx_open_connection(display=4367432889, resource_string=4328534074, must_succeed=4328534122) + 43 at nsfns.m:2503
    frame #20: 0x00000001001ec6cf Aquamacs`Ffuncall(nargs=4, args=0x00007fff5fbfd6f0) + 1119 at eval.c:2796
    frame #21: 0x00000001002450c7 Aquamacs`exec_byte_code(bytestr=4300060001, vector=4300060037, maxdepth=32, args_template=1024, nargs=0, args=0x00007fff5fbfde30) + 3799 at bytecode.c:919
    frame #22: 0x00000001001ed7c4 Aquamacs`funcall_lambda(fun=4300059957, nargs=0, arg_vector=0x00007fff5fbfde30) + 500 at eval.c:2959
    frame #23: 0x00000001001ec8a1 Aquamacs`Ffuncall(nargs=1, args=0x00007fff5fbfde28) + 1585 at eval.c:2838
    frame #24: 0x00000001002450c7 Aquamacs`exec_byte_code(bytestr=4298936897, vector=4298936933, maxdepth=16, args_template=0, nargs=0, args=0x00007fff5fbfe548) + 3799 at bytecode.c:919
    frame #25: 0x00000001001ed7c4 Aquamacs`funcall_lambda(fun=4298936853, nargs=0, arg_vector=0x00007fff5fbfe548) + 500 at eval.c:2959
    frame #26: 0x00000001001ec8a1 Aquamacs`Ffuncall(nargs=1, args=0x00007fff5fbfe540) + 1585 at eval.c:2838
    frame #27: 0x00000001001e7087 Aquamacs`eval_sub(form=4391690758) + 1527 at eval.c:2131
    frame #28: 0x00000001001ea07c Aquamacs`internal_lisp_condition_case(var=4387480506, bodyform=4391690758, handlers=4391690630) + 1340 at eval.c:1300
    frame #29: 0x0000000100246832 Aquamacs`exec_byte_code(bytestr=4298933505, vector=4298933541, maxdepth=68, args_template=0, nargs=0, args=0x00007fff5fbfef58) + 9794 at bytecode.c:1169
    frame #30: 0x00000001001ed7c4 Aquamacs`funcall_lambda(fun=4298933461, nargs=0, arg_vector=0x00007fff5fbfef58) + 500 at eval.c:2959
    frame #31: 0x00000001001ec8a1 Aquamacs`Ffuncall(nargs=1, args=0x00007fff5fbfef50) + 1585 at eval.c:2838
    frame #32: 0x00000001002450c7 Aquamacs`exec_byte_code(bytestr=4298930305, vector=4298930341, maxdepth=32, args_template=0, nargs=0, args=0x00007fff5fbff5e0) + 3799 at bytecode.c:919
    frame #33: 0x00000001001ed7c4 Aquamacs`funcall_lambda(fun=4298930261, nargs=0, arg_vector=0x00007fff5fbff5e0) + 500 at eval.c:2959
    frame #34: 0x00000001001ebbb6 Aquamacs`apply_lambda(fun=4298930261, args=4328534074) + 438 at eval.c:2898
    frame #35: 0x00000001001e7403 Aquamacs`eval_sub(form=4387394246) + 2419 at eval.c:2204
    frame #36: 0x00000001001eb727 Aquamacs`Feval(form=4387394246, lexical=4328534074) + 151 at eval.c:1977
    frame #37: 0x0000000100146321 Aquamacs`top_level_2 + 33 at keyboard.c:1167
    frame #38: 0x00000001001ea289 Aquamacs`internal_condition_case(bfun=0x0000000100146300, handlers=4328609626, hfun=0x0000000100146330) + 441 at eval.c:1331
    frame #39: 0x00000001001462a7 Aquamacs`top_level_1(ignore=4328534074) + 71 at keyboard.c:1175
    frame #40: 0x00000001001e9871 Aquamacs`internal_catch(tag=4328605818, func=0x0000000100146260, arg=4328534074) + 401 at eval.c:1097
    frame #41: 0x000000010012baa7 Aquamacs`command_loop + 151 at keyboard.c:1136
    frame #42: 0x000000010012b994 Aquamacs`recursive_edit_1 + 132 at keyboard.c:776
    frame #43: 0x000000010012bc70 Aquamacs`Frecursive_edit + 320 at keyboard.c:840
    frame #44: 0x0000000100129d22 Aquamacs`main(argc=2, argv=0x00007fff5fbffcb0) + 5394 at emacs.c:1581
    frame #45: 0x00007fff9393a5fd libdyld.dylib`start + 1

(3)
(lldb) attach 647
Process 647 stopped
Executable module set to "/Users/dr/em24.git/nextstep/Emacs.app/Contents/MacOS/Emacs".
Architecture set to: x86_64-apple-macosx.
(lldb) bt
* thread #1: tid = 0x1d1d, 0x00007fff87fa35fd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 409, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x00007fff87fa35fd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 409
    frame #1: 0x00007fff8e210d72 CoreFoundation`_CFAutoreleasePoolPop + 50
    frame #2: 0x00007fff881b8e4c Foundation`-[NSAutoreleasePool release] + 140
    frame #3: 0x00000001002b07b1 Emacs`ns_read_socket(terminal=0x0000000102213b68, hold_quit=0x00007fff5fbfc690) + 273 at nsterm.m:3611
    frame #4: 0x000000010013873d Emacs`gobble_input + 173 at keyboard.c:6838
    frame #5: 0x0000000100140aad Emacs`handle_async_input + 13 at keyboard.c:7078
    frame #6: 0x00000001001375c3 Emacs`process_pending_signals + 19 at keyboard.c:7092
    frame #7: 0x0000000100140b1b Emacs`unblock_input_to(level=0) + 75 at keyboard.c:7107
    frame #8: 0x00000001001341ae Emacs`totally_unblock_input + 14 at keyboard.c:7130
    frame #9: 0x00000001001300dc Emacs`terminate_due_to_signal(sig=11, backtrace_limit=40) + 44 at emacs.c:352
    frame #10: 0x000000010015e1c8 Emacs`handle_fatal_signal(sig=11) + 24 at sysdep.c:1628
    frame #11: 0x000000010015e19a Emacs`deliver_thread_signal(sig=11, handler=0x000000010015e1b0) + 154 at sysdep.c:1602
    frame #12: 0x000000010015cb7a Emacs`deliver_fatal_thread_signal(sig=11) + 26 at sysdep.c:1640
    frame #13: 0x00007fff8f5ce5aa libsystem_platform.dylib`_sigtramp + 26
    frame #14: 0x00007fff87fa362b libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 455
    frame #15: 0x00007fff8e210d72 CoreFoundation`_CFAutoreleasePoolPop + 50
    frame #16: 0x00007fff881b8e4c Foundation`-[NSAutoreleasePool release] + 140
    frame #17: 0x00000001002a0566 Emacs`-[EmacsApp run](self=0x00006000001210e0, _cmd=0x00007fff87366296) + 390 at nsterm.m:4503
    frame #18: 0x000000010029fd7e Emacs`ns_term_init(display_name=4317146553) + 4446 at nsterm.m:4424
    frame #19: 0x00000001002bd25b Emacs`Fx_open_connection(display=4317146553, resource_string=4328534074, must_succeed=4328534122) + 43 at nsfns.m:1816
    frame #20: 0x00000001001f1c9f Emacs`Ffuncall(nargs=4, args=0x00007fff5fbfd6d0) + 1119 at eval.c:2813
    frame #21: 0x000000010024a907 Emacs`exec_byte_code(bytestr=4300036977, vector=4300037013, maxdepth=32, args_template=1024, nargs=0, args=0x00007fff5fbfde10) + 3799 at bytecode.c:919
    frame #22: 0x00000001001f2d94 Emacs`funcall_lambda(fun=4300036933, nargs=0, arg_vector=0x00007fff5fbfde10) + 500 at eval.c:2976
    frame #23: 0x00000001001f1e71 Emacs`Ffuncall(nargs=1, args=0x00007fff5fbfde08) + 1585 at eval.c:2855
    frame #24: 0x000000010024a907 Emacs`exec_byte_code(bytestr=4298918657, vector=4298918693, maxdepth=16, args_template=0, nargs=0, args=0x00007fff5fbfe528) + 3799 at bytecode.c:919
    frame #25: 0x00000001001f2d94 Emacs`funcall_lambda(fun=4298918613, nargs=0, arg_vector=0x00007fff5fbfe528) + 500 at eval.c:2976
    frame #26: 0x00000001001f1e71 Emacs`Ffuncall(nargs=1, args=0x00007fff5fbfe520) + 1585 at eval.c:2855
    frame #27: 0x00000001001ec777 Emacs`eval_sub(form=4387546438) + 1527 at eval.c:2148
    frame #28: 0x00000001001ef6ff Emacs`internal_lisp_condition_case(var=4328801402, bodyform=4387546438, handlers=4387545718) + 1295 at eval.c:1314
    frame #29: 0x000000010024c045 Emacs`exec_byte_code(bytestr=4298915401, vector=4298915437, maxdepth=68, args_template=0, nargs=0, args=0x00007fff5fbfef38) + 9749 at bytecode.c:1169
    frame #30: 0x00000001001f2d94 Emacs`funcall_lambda(fun=4298915357, nargs=0, arg_vector=0x00007fff5fbfef38) + 500 at eval.c:2976
    frame #31: 0x00000001001f1e71 Emacs`Ffuncall(nargs=1, args=0x00007fff5fbfef30) + 1585 at eval.c:2855
    frame #32: 0x000000010024a907 Emacs`exec_byte_code(bytestr=4298911841, vector=4298911877, maxdepth=48, args_template=0, nargs=0, args=0x00007fff5fbff5e0) + 3799 at bytecode.c:919
    frame #33: 0x00000001001f2d94 Emacs`funcall_lambda(fun=4298911797, nargs=0, arg_vector=0x00007fff5fbff5e0) + 500 at eval.c:2976
    frame #34: 0x00000001001f1186 Emacs`apply_lambda(fun=4298911797, args=4328534074) + 438 at eval.c:2915
    frame #35: 0x00000001001ecaf3 Emacs`eval_sub(form=4387380470) + 2419 at eval.c:2221
    frame #36: 0x00000001001f0cf7 Emacs`Feval(form=4387380470, lexical=4328534074) + 151 at eval.c:1994
    frame #37: 0x000000010014e351 Emacs`top_level_2 + 33 at keyboard.c:1179
    frame #38: 0x00000001001ef8dc Emacs`internal_condition_case(bfun=0x000000010014e330, handlers=4328600602, hfun=0x000000010014e360) + 396 at eval.c:1345
    frame #39: 0x000000010014e2d7 Emacs`top_level_1(ignore=4328534074) + 71 at keyboard.c:1187
    frame #40: 0x00000001001eef14 Emacs`internal_catch(tag=4328596794, func=0x000000010014e290, arg=4328534074) + 356 at eval.c:1109
    frame #41: 0x00000001001338e7 Emacs`command_loop + 151 at keyboard.c:1148
    frame #42: 0x00000001001337d4 Emacs`recursive_edit_1 + 132 at keyboard.c:777
    frame #43: 0x0000000100133ab0 Emacs`Frecursive_edit + 320 at keyboard.c:841
    frame #44: 0x0000000100131a96 Emacs`main(argc=2, argv=0x00007fff5fbffcc0) + 5510 at emacs.c:1637
    frame #45: 0x00007fff8cd9e5fd libdyld.dylib`start + 1