I crash Emacs built with GTK on Debian Jessie (unstable), by performing massive scrolling using mouse and the vertical scroll bar. Messages buffer may be used to that or the title screen. After several movements with left button down the scroll bar stops reacting, Emacs as well. As I was afraid it would be difficult to reproduce I decided to debug it. What I found out is that sometimes wait_reading_process_output does not return for really long time and this causes the freeze. On the other hand the loop (inside wait_reading_process_output) works all the time. XTread_socket from xterm.c also is working, but not properly. See the comment from the patch (attached): + // Sometimes gtk_events_pending is true, but gdk_event_handler + // receives nothing and does not increase the count. + // If we ignore these pending events, then we lock up, + // for example with continuos movements of vertical scroll bar. + if (!count) count = 1; I don't think it's the correct patch. Rather investigation is required, why gdk_event_handler is not increasing the count. But I don't feel enough confident with gtk, gdk and Emacs code. A bit tired also. Anyway I offer further help with solving this issue, because I can easily reproduce it. My glib is 2.36.4, libgtk-3-0: 3.8.4-1. Revisions on which I confirmed the freeze: r113450, r114178, r114884. Somehow htmlfontify entered the patch file, but I didn't remove it manually. In GNU Emacs 24.3.50.5 (i686-pc-linux-gnu, GTK+ Version 3.8.4) of 2013-11-04 on jcdeb Bzr revision: 114884 rgm@gnu.org-20131031213910-3509l9e973ne3zy1 Windowing system distributor `The X.Org Foundation', version 11.0.11204000 System Description: Debian GNU/Linux testing (jessie) Important settings: value of $LC_ALL: en_US value of $LANG: pl_PL locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: t Major mode: Outline Minor modes in effect: global-whitespace-mode: t global-hl-line-mode: t recentf-mode: t tooltip-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 size-indication-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-h C-h r C-s p a t c h C-s C-s C-s p a t c h C-x C-f C-g C-x C-f C-x C-f e r t c / t c / M-s o d i f f C-SPC M-w M-x r e p o r Recent messages: Loading grep...done For information about GNU Emacs and the GNU system, type C-h C-a. Mark saved where search started [2 times] Quit completing-read-default: Command attempted to use minibuffer while in minibuffer Making completion list... indent-relative: Buffer is read-only: # Searched 1 buffer; 4 matches for `diff' Mark set Making completion list... Load-path shadows: /usr/share/emacs/site-lisp/auto-autoloads hides /usr/local/share/emacs/site-lisp/auto-autoloads /usr/share/emacs/site-lisp/ssl hides /usr/local/share/emacs/site-lisp/ssl /usr/share/emacs/site-lisp/images hides /usr/local/share/emacs/site-lisp/images /usr/share/emacs/site-lisp/font hides /usr/local/share/emacs/site-lisp/font /usr/share/emacs/site-lisp/devices hides /usr/local/share/emacs/site-lisp/devices /usr/share/emacs/site-lisp/url-hotlist hides /usr/local/share/emacs/site-lisp/url-hotlist /usr/share/emacs/site-lisp/css hides /usr/local/share/emacs/site-lisp/css /usr/share/emacs/site-lisp/docomp hides /usr/local/share/emacs/site-lisp/docomp /usr/share/emacs/site-lisp/custom-load hides /usr/local/share/emacs/site-lisp/custom-load /usr/share/emacs/site-lisp/w3 hides /usr/local/share/emacs/site-lisp/w3 /usr/share/emacs/site-lisp/w3-xemac hides /usr/local/share/emacs/site-lisp/w3-xemac /usr/share/emacs/site-lisp/w3-widget hides /usr/local/share/emacs/site-lisp/w3-widget /usr/share/emacs/site-lisp/w3-vars hides /usr/local/share/emacs/site-lisp/w3-vars /usr/share/emacs/site-lisp/w3-toolbar hides /usr/local/share/emacs/site-lisp/w3-toolbar /usr/share/emacs/site-lisp/w3-style hides /usr/local/share/emacs/site-lisp/w3-style /usr/share/emacs/site-lisp/w3-speak hides /usr/local/share/emacs/site-lisp/w3-speak /usr/share/emacs/site-lisp/w3-speak-table hides /usr/local/share/emacs/site-lisp/w3-speak-table /usr/share/emacs/site-lisp/w3-props hides /usr/local/share/emacs/site-lisp/w3-props /usr/share/emacs/site-lisp/w3-print hides /usr/local/share/emacs/site-lisp/w3-print /usr/share/emacs/site-lisp/w3-parse hides /usr/local/share/emacs/site-lisp/w3-parse /usr/share/emacs/site-lisp/w3-mouse hides /usr/local/share/emacs/site-lisp/w3-mouse /usr/share/emacs/site-lisp/w3-menu hides /usr/local/share/emacs/site-lisp/w3-menu /usr/share/emacs/site-lisp/w3-keymap hides /usr/local/share/emacs/site-lisp/w3-keymap /usr/share/emacs/site-lisp/w3-java hides /usr/local/share/emacs/site-lisp/w3-java /usr/share/emacs/site-lisp/w3-imap hides /usr/local/share/emacs/site-lisp/w3-imap /usr/share/emacs/site-lisp/w3-hotindex hides /usr/local/share/emacs/site-lisp/w3-hotindex /usr/share/emacs/site-lisp/w3-hot hides /usr/local/share/emacs/site-lisp/w3-hot /usr/share/emacs/site-lisp/w3-forms hides /usr/local/share/emacs/site-lisp/w3-forms /usr/share/emacs/site-lisp/w3-fast-parse hides /usr/local/share/emacs/site-lisp/w3-fast-parse /usr/share/emacs/site-lisp/w3-emulate hides /usr/local/share/emacs/site-lisp/w3-emulate /usr/share/emacs/site-lisp/w3-emacs hides /usr/local/share/emacs/site-lisp/w3-emacs /usr/share/emacs/site-lisp/w3-display hides /usr/local/share/emacs/site-lisp/w3-display /usr/share/emacs/site-lisp/w3-dired hides /usr/local/share/emacs/site-lisp/w3-dired /usr/share/emacs/site-lisp/w3-cus hides /usr/local/share/emacs/site-lisp/w3-cus /usr/share/emacs/site-lisp/w3-compat hides /usr/local/share/emacs/site-lisp/w3-compat /usr/share/emacs/site-lisp/w3-cfg hides /usr/local/share/emacs/site-lisp/w3-cfg /usr/share/emacs/site-lisp/w3-auto hides /usr/local/share/emacs/site-lisp/w3-auto /usr/share/emacs/site-lisp/cmake-mode hides /usr/local/share/emacs/site-lisp/cmake-data/cmake-mode /usr/local/share/emacs/site-lisp/flim/md4 hides /usr/local/share/emacs/24.3.50/lisp/md4 /usr/local/share/emacs/site-lisp/flim/hex-util hides /usr/local/share/emacs/24.3.50/lisp/hex-util /usr/local/share/emacs/site-lisp/dictionaries-common/ispell hides /usr/local/share/emacs/24.3.50/lisp/textmodes/ispell /usr/local/share/emacs/site-lisp/dictionaries-common/flyspell hides /usr/local/share/emacs/24.3.50/lisp/textmodes/flyspell /usr/local/share/emacs/site-lisp/flim/sasl-digest hides /usr/local/share/emacs/24.3.50/lisp/net/sasl-digest /usr/local/share/emacs/site-lisp/flim/sasl-ntlm hides /usr/local/share/emacs/24.3.50/lisp/net/sasl-ntlm /usr/local/share/emacs/site-lisp/flim/sasl hides /usr/local/share/emacs/24.3.50/lisp/net/sasl /usr/local/share/emacs/site-lisp/flim/sasl-cram hides /usr/local/share/emacs/24.3.50/lisp/net/sasl-cram /usr/local/share/emacs/site-lisp/flim/ntlm hides /usr/local/share/emacs/24.3.50/lisp/net/ntlm /usr/local/share/emacs/site-lisp/flim/hmac-md5 hides /usr/local/share/emacs/24.3.50/lisp/net/hmac-md5 /usr/local/share/emacs/site-lisp/flim/hmac-def hides /usr/local/share/emacs/24.3.50/lisp/net/hmac-def Features: (shadow sort gnus-util mail-extr emacsbug message format-spec 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 vc-bzr noutline outline misearch multi-isearch jka-compr info disp-table grep compile comint ansi-color ring whitespace hl-line cus-start cus-load yasnippet derived easy-mmode edmacro kmacro help-mode folding-isearch folding cl-macs gv advice help-fns bookmark pp recentf tree-widget wid-edit easymenu cl cl-loaddefs cl-lib server time-date tooltip 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)