Subject: 24.4.51; Hang after toolbar use
From: David Reitter <[email-masked]>
To: [email-masked]
Date: Sun, 26 Oct 2014 21:57:26 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Emacs hangs reliably when I 

Emacs -Q
double-click on a toolbar icon such as “Search”.

Inspecting this a little, I get this backtrace when I interrupt the process:

    frame #9: 0x00007fff89ca7fd0 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
    frame #10: 0x00000001002b2779 Emacs`-[EmacsApp run](self=0x000000010424c600, _cmd=0x00007fff8a607034) + 297 at nsterm.m:4494
    frame #11: 0x00000001002c31d2 Emacs`ns_read_socket(terminal=0x000000010184e678, hold_quit=0x00007fff5fbfe750) + 818 at nsterm.m:3640
    frame #12: 0x0000000100145a7d Emacs`gobble_input + 173 at keyboard.c:6850
    frame #13: 0x000000010014bc95 Emacs`get_input_pending(flags=1) + 117 at keyboard.c:6771
    frame #14: 0x00000001001487f6 Emacs`detect_input_pending_run_timers(do_display=false) + 54 at keyboard.c:9894

Setting a breakpoint on handle_async_input I see that this function doesn’t get called (during the hang) unless I move the mouse over the mode line.  The keyDown: method in nsterm.m does get called and runs as expected.

During the non-hang (normal) condition, I can see that toolbarClicked: runs twice and puts its events in the queue.  I don’t know the Emacs-side event handling well enough to inspect this further.  

This is Emacs built with “-O0 -g” from git revision 46b813 [that’s for the official git repository at this point], but users have reported similar problems with Aquamacs based on 24.4.1.  They do not mention double-clicks - but they often use the toolbar.  Double-clicks are just a very reliable way for me to reproduce the problem.

If this is not reproducible, please let me know and I’ll help. 

In GNU Emacs 24.4.51.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)
of 2014-10-26 on momo
Windowing system distributor `Apple', version 10.3.1343
Configured using:
`configure --with-ns 'CFLAGS=3D-O0 -g''

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

Major mode: Fundamental

Minor modes in effect:
  which-function-mode: t
  tooltip-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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <escape> x r e p o r t - e m a c s - b=20
<tab> <return>

Recent messages:
.emacs: (lambda (x) ...) quoted with ' rather than with #' [2 times]
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils ghostedit ghostedit-stopwords-en
easy-mmode which-func imenu time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win 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 cocoa ns multi-tty emacs)

Memory information:
((conses 16 79023 7517)
(symbols 48 17503 0)
(miscs 40 80 146)
(strings 32 12886 4753)
(string-bytes 1 347242)
(vectors 16 9945)
(vector-slots 8 421091 15981)
(floats 8 84 97)
(intervals 56 213 15)
(buffers 960 12))