all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Halley <halley@play-bow.org>
To: Alan Third <alan@idiocy.org>
Cc: emacs-devel@gnu.org
Subject: Re: UI input unresponsive on macOS
Date: Tue, 3 Jan 2017 08:59:43 -0800	[thread overview]
Message-ID: <AD6E8EF1-2155-4806-AE5C-B654DB7CE594@play-bow.org> (raw)
In-Reply-To: <20170103143621.GA41725@breton.holly.idiocy.org>

[-- Attachment #1: Type: text/plain, Size: 4689 bytes --]


> Can you try the attached patch?

It didn’t fix things, but I did find a way to reproduce the problem at will.

If start emacs, and then you run

    open -a /Applications/Emacs.app whatever_file_here

For a file which isn’t open, then the UI becomes unresponsive to input.  Typing C-G seems to unstick it eventually, but there can be very long delays (I timed one at 49 seconds) before it beeps and the UI becomes responsive.  I’ve seen it spontaneously complete too, again after a long time (at least 30 seconds), but usually it does not complete.

If I look at it with lldb, all of the threads are blocked, and thread 1 looks like:

(lldb) bt
* thread #1: tid = 0x4ad0a2, 0x00007fff9f7ebaff CoreFoundation`__CFRunLoopCollectSources0 + 31, stop reason = signal SIGSTOP
  * frame #0: 0x00007fff9f7ebaff CoreFoundation`__CFRunLoopCollectSources0 + 31
    frame #1: 0x00007fff9f7b91f2 CoreFoundation`__CFSetApplyFunction_block_invoke + 18
    frame #2: 0x00007fff9f7a54ba CoreFoundation`CFBasicHashApply + 122
    frame #3: 0x00007fff9f7b9199 CoreFoundation`CFSetApplyFunction + 185
    frame #4: 0x00007fff9f7eb8be CoreFoundation`__CFRunLoopDoSources0 + 110
    frame #5: 0x00007fff9f7eaf76 CoreFoundation`__CFRunLoopRun + 934
    frame #6: 0x00007fff9f7ea974 CoreFoundation`CFRunLoopRunSpecific + 420
    frame #7: 0x00007fff9ed76acc HIToolbox`RunCurrentEventLoopInMode + 240
    frame #8: 0x00007fff9ed76809 HIToolbox`ReceiveNextEventCommon + 184
    frame #9: 0x00007fff9ed76736 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #10: 0x00007fff9d31cae4 AppKit`_DPSNextEvent + 1120
    frame #11: 0x00007fff9da9721f AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789
    frame #12: 0x00000001001b3866 Emacs`ns_select(nfds=4, readfds=0x00007fff5fbfee00, writefds=0x00007fff5fbfed80, exceptfds=0x0000000000000000, timeout=<unavailable>, sigmask=<unavailable>) + 678 at nsterm.m:4130 [opt]
    frame #13: 0x00000001001a04a8 Emacs`really_call_select(arg=0x00007fff5fbfeba0) + 88 at thread.c:520 [opt]
    frame #14: 0x000000010011ec7c Emacs`flush_stack_call_func(func=<unavailable>, arg=<unavailable>) + 44 at alloc.c:5137 [opt]
    frame #15: 0x00000001001a0447 Emacs`thread_select(func=<unavailable>, max_fds=<unavailable>, rfds=<unavailable>, wfds=<unavailable>, efds=<unavailable>, timeout=<unavailable>, sigmask=0x0000000000000000) + 55 at thread.c:543 [opt]
    frame #16: 0x000000010018400e Emacs`wait_reading_process_output(time_limit=<unavailable>, nsecs=<unavailable>, read_kbd=<unavailable>, do_display=<unavailable>, wait_for_cell=0, wait_proc=<unavailable>, just_wait_proc=<unavailable>) + 4142 at process.c:5350 [opt]
    frame #17: 0x0000000100008005 Emacs`sit_for(timeout=<unavailable>, reading=<unavailable>, display_option=1) + 261 at dispnew.c:5763 [opt]
    frame #18: 0x00000001000c3ab7 Emacs`read_char(commandflag=1, map=4431829235, prev_event=0, used_mouse_menu=0x00007fff5fbff7df, end_time=0x0000000000000000) + 5511 at keyboard.c:2725 [opt]
    frame #19: 0x00000001000c062f Emacs`read_key_sequence(keybuf=<unavailable>, bufsize=30, prompt=<unavailable>, dont_downcase_last=<unavailable>, can_return_switch_frame=<unavailable>, fix_current_buffer=<unavailable>, prevent_redisplay=<unavailable>) + 1839 at keyboard.c:9139 [opt]
    frame #20: 0x00000001000bed32 Emacs`command_loop_1 + 1202 at keyboard.c:1373 [opt]
    frame #21: 0x000000010013d347 Emacs`internal_condition_case(bfun=(Emacs`command_loop_1 at keyboard.c:1264), handlers=<unavailable>, hfun=(Emacs`cmd_error at keyboard.c:943)) + 87 at eval.c:1326 [opt]
    frame #22: 0x00000001000cde20 Emacs`command_loop_2(ignore=<unavailable>) + 48 at keyboard.c:1115 [opt]
    frame #23: 0x000000010013cbfe Emacs`internal_catch(tag=<unavailable>, func=(Emacs`command_loop_2 at keyboard.c:1111), arg=0) + 78 at eval.c:1092 [opt]
    frame #24: 0x00000001000bdf7e Emacs`command_loop + 158 at keyboard.c:1094 [opt]
    frame #25: 0x00000001000bde8f Emacs`recursive_edit_1 + 111 at keyboard.c:700 [opt]
    frame #26: 0x00000001000be0c3 Emacs`Frecursive_edit + 227 at keyboard.c:771 [opt]
    frame #27: 0x00000001000bcc9d Emacs`main(argc=0, argv=<unavailable>) + 6157 at emacs.c:1684 [opt]
    frame #28: 0x00007fffb4d43255 libdyld.dylib`start + 1

The other threads didn’t look interesting, but I could be wrong :)

Sometimes when I “continue” in the debugger it unsticks whatever is stuck, though the file I was trying to open never opens.

> So far the only problem I’ve seen is
> that emacsclient doesn’t return to the shell when it exits.

Yeah, I see that too.

/Bob



[-- Attachment #2: Type: text/html, Size: 13827 bytes --]

  parent reply	other threads:[~2017-01-03 16:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 13:36 UI input unresponsive on macOS Bob Halley
2017-01-03 14:36 ` Alan Third
2017-01-03 15:39   ` Bob Halley
2017-01-03 16:59   ` Bob Halley [this message]
2017-01-03 17:49     ` Alan Third
2017-01-04  3:52       ` Gong-Yi Liao 廖宮毅
2017-01-04 15:38         ` Eli Zaretskii
2017-01-05  4:34           ` Gong-Yi Liao 廖宮毅
2017-01-05 15:37             ` Eli Zaretskii
2017-01-05 17:00               ` Gong-Yi Liao 廖宮毅
2017-10-05  3:40                 ` YAMAMOTO Mitsuharu
2017-11-16 19:33                   ` Alan Third
2017-11-17  1:05                     ` YAMAMOTO Mitsuharu
2017-11-17 13:53                     ` Eli Zaretskii
2017-11-17 17:42                       ` Alan Third
2017-11-18  0:24                         ` YAMAMOTO Mitsuharu
2017-12-02 16:51                           ` Alan Third
2017-01-04 21:09   ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AD6E8EF1-2155-4806-AE5C-B654DB7CE594@play-bow.org \
    --to=halley@play-bow.org \
    --cc=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.