[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#18772: closed (24.3; Emacs deadlocks on subprocess

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18772: closed (24.3; Emacs deadlocks on subprocess write when read is pending)
Date: Mon, 20 Oct 2014 02:41:04 +0000

Your message dated Mon, 20 Oct 2014 05:40:02 +0300
with message-id <address@hidden>
and subject line Re: bug#18772: 24.3; Emacs deadlocks on subprocess write when 
read is pending
has caused the debbugs.gnu.org bug report #18772,
regarding 24.3; Emacs deadlocks on subprocess write when read is pending
to be marked as done.

(If you believe you have received this mail in error, please contact

18772: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18772
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3; Emacs deadlocks on subprocess write when read is pending Date: Sun, 19 Oct 2014 00:06:50 -0700
I have reliably experienced UI freezes under the following conditions:
1) A large read from a subprocess is in progress (2+MBs, around 2
seconds on Windows with w32-pipe-read-delay set to 0).
2) A mid-sized write is sent to the subprocess, from a not very large source
code buffer but large enough to block the write. The subprocess will not
read from its side until it finishes the transfer started in 1.

Killing the subprocess unfreezes Emacs. The error message indicates that
Emacs blocked on the write, complaing about the process being dead while
writing. The process buffer, normally mopped up by the process filter,
is filled with text midway through the transfer, indicating that the process
filter has stopped getting called. Finally locking out the offending
blocking write while the read is still in progress has ensured that the
deadlocks no longer happen. Success of the workaround gives me
confidence that this is an Emacs bug or feature.

Reading through the Emacs source files, it appears that when user calls
process-send-* in elisp eventually Emacs calls send_process in
process.c. If the send blocks it calls wait_reading_process_output,
which in turn should read pending output. Apparently in my case this is
not happening and a deadlock occured instead. My use case has large and
large enough transfers going both ways which may be different from
typical use patterns. Also on Windows reading from the pipe is slow even
when the w32-pipe-read-delay is set to 0 which gives more opportunities
for the deadlock to happen. I note again that this happens reliably
instead of intermittently once the conditions listed above are met.

I hope this bug report will help you in improving Emacs.

Haitao Zhang

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file

In GNU Emacs 24.3.1 (i386-mingw-nt6.2.9200)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.2.9200
Configured using:
 `configure --with-gcc (4.7) --cflags

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: C++/l

Minor modes in effect:
  irony-mode: t
  global-company-mode: t
  company-mode: t
  autopair-global-mode: t
  autopair-mode: t
  delete-selection-mode: t
  cua-mode: t
  recentf-mode: t
  global-auto-revert-mode: t
  tooltip-mode: t
  mouse-wheel-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
  abbrev-mode: t

Recent input:
<wheel-up> <down-mouse-1> <mouse-1> <return> <tab>
i f SPC ( c a c A-H-s-  h e <tab> p <tab> . A-H-s- 
f <backspace> F <backspace> <backspace> . A-H-s-  <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> g e t E <return> SPC =
= SPC " z i p <menu-bar> <buffer> C-a <menu-bar> <buffer>
C-a <up> <up> <up> <up> <up> <up> <up> C-a C-k C-k
<up> <up> <up> <up> C-v <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> C-k C-k <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<down> <down> C-y <up> <tab> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<backspace> ! <right> <right> <right> <right> <right>
<right> <right> <right> <right> <left> <return> <tab>
<down> <down> C-a C-k C-k <up> <up> C-y <up> <up> <up>
<up> <return> <down> <down> <down> <right> <right>
<right> <right> <down> <down> <down> <down> <down>
<left> <left> <left> <left> <left> <left> <right> <right>
<left> <right> C-k C-k C-k C-k C-k C-k C-k C-k C-k
C-k C-k C-k C-k <up> <up> <up> <up> <up> <up> <down>
<down> <up> <up> <up> <down> C-y <up> <up> <up> <up>
<up> <up> <right> <right> <right> <right> <right> <right>
<right> <left> E d g a A-H-s-  <down> <down> <return>
( u r i <right> SPC & & SPC <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <menu-bar> <help-menu> <emacs-manual-bug>
<help-echo> <down-mouse-1> <mouse-2> <wheel-down> <double-wheel-down>
<wheel-down> <double-wheel-down> q <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<menu-bar> <help-menu> <send-emacs-bug-report>

Recent messages:
Mark set [3 times]
Mark set
Sending file request Sat Oct 18 21:05:59 2014
Received first 4038 Sat Oct 18 21:05:59 2014
EOT received 2240641 Sat Oct 18 21:06:01 2014
Sending file request Sat Oct 18 21:06:10 2014
Received first 4038 Sat Oct 18 21:06:10 2014
EOT received 2240785 Sat Oct 18 21:06:13 2014

(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 yasnippet misearch multi-isearch lisp-mnt cl-macs
gv cc-langs cl cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs company-files company-oddmuse
company-keywords company-etags etags company-gtags company-dabbrev-code
company-dabbrev company-capf company-cmake company-ropemacs
company-xcode company-clang company-semantic company-eclim
company-template company-css company-nxml company-bbdb company-elisp
help-mode company-irony irony-completion irony-snippet irony-cdb irony
find-func company edmacro kmacro ediprolog python rx comint ring
ansi-color autopair advice help-fns advice-preload paren cl-lib delsel
cua-base recentf tree-widget wid-edit autorevert solarized-dark-theme
solarized dash autopair-autoloads cmake-mode-autoloads
company-irony-autoloads company-autoloads flycheck-autoloads info
easymenu irony-autoloads js2-mode-autoloads pkg-info-autoloads
epl-autoloads finder-inf request-deferred-autoloads request-autoloads
deferred-autoloads solarized-theme-autoloads dash-autoloads
yasnippet-autoloads package time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win
w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-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 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
w32 multi-tty emacs)

--- End Message ---
--- Begin Message --- Subject: Re: bug#18772: 24.3; Emacs deadlocks on subprocess write when read is pending Date: Mon, 20 Oct 2014 05:40:02 +0300
> Date: Sun, 19 Oct 2014 14:59:03 -0700
> From: Haitao Zhang <address@hidden>
> Cc: address@hidden
> Thank you for the explanation. I filed this bug report late last night before
> seeing your response on the mail list. I will try to get hold a copy of 24.4 
> in
> the near future. Please feel free to close this one. If my problem does not go
> away with the new release I can reopen the ticket.

OK, closing.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]