From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18396: 24.3.1; On windows, process-send-string can freeze Emacs Date: Wed, 03 Sep 2014 22:01:18 +0300 Message-ID: <83zjegh6kh.fsf@gnu.org> References: <87k35kod3w.fsf@loki.jorgenschaefer.de> <831trsinu3.fsf@gnu.org> <20140903204307.0bcf515c@forcix> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1409770948 11014 80.91.229.3 (3 Sep 2014 19:02:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2014 19:02:28 +0000 (UTC) Cc: 18396@debbugs.gnu.org To: Jorgen Schaefer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 03 21:02:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XPFou-0007yj-UE for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2014 21:02:17 +0200 Original-Received: from localhost ([::1]:47176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPFou-0008Jv-Jv for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2014 15:02:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPFon-0008Ii-7C for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 15:02:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPFog-0001Lf-Vc for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 15:02:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPFog-0001LX-Sq for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 15:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XPFog-0002uY-Bz for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 15:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Sep 2014 19:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 18396-submit@debbugs.gnu.org id=B18396.140977087811133 (code B ref 18396); Wed, 03 Sep 2014 19:02:02 +0000 Original-Received: (at 18396) by debbugs.gnu.org; 3 Sep 2014 19:01:18 +0000 Original-Received: from localhost ([127.0.0.1]:58092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPFnx-0002tU-A3 for submit@debbugs.gnu.org; Wed, 03 Sep 2014 15:01:17 -0400 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:59589) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPFnt-0002tC-QJ for 18396@debbugs.gnu.org; Wed, 03 Sep 2014 15:01:15 -0400 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NBC00J009BZHK00@mtaout26.012.net.il> for 18396@debbugs.gnu.org; Wed, 03 Sep 2014 21:59:11 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NBC00B3KA2NWXA0@mtaout26.012.net.il>; Wed, 03 Sep 2014 21:59:11 +0300 (IDT) In-reply-to: <20140903204307.0bcf515c@forcix> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93001 Archived-At: > Date: Wed, 3 Sep 2014 20:43:07 +0200 > From: Jorgen Schaefer > Cc: 18396@debbugs.gnu.org > > > Using "/" as the default directory on Windows is a bad idea, as that > > is not a fully-qualified absolute file name. > > What would be the equivalent for "out of the way and not blocking any > mount point" (or equivalent) on Windows? I might have a suggestion, if you explain what "out of the way" and "not blocking any mount points" mean. > > Looks like the write to the pipe never returned. This could be > > because the pipe is full and is not being read from the other end > > (Windows pipes have 4K buffers, and you show above more than 6K of > > data). > > That is quite likely the explanation. The Python process does the > equivalent of a REPL, reading one RPC call, evaluating it, and writing > the response. If in the duration of that evaluation Emacs sends more > than 4k of data, it will hang. If the response is larger than 4k, > Python in turn will hang. Resulting in a deadlock. > > Am I missing something? I'd expect Python to continue reading from the pipe once it evaluated one call and sent back the response. It should see that more input is available and continue reading. Could this be an end-of-line format issue? Are you sure the commands used from Emacs side produce Windows-style CRLF EOLs? Or maybe they do, but Python expects Unix-style newline-only EOLs (maybe it's a Cygwin or MSYS Python, for example)? A wrong EOL format might cause Python to fail to realize it was handed a full line of input. > Does Emacs have a chance to check for a pipe to be writable before > doing so? The whole process blocking like this feels a bit weird. I don't know how to do such a check with pipes on Windows. More importantly, how would that help? The pipe will fill up anyway, and the communications with Python will stop. Being able to interrupt with C-g vs killing the subprocess is not such a big win, IMO. > > The obvious way: attach a debugger to Emacs and see where it is hung > > or waiting. It is important to ask the user to produce backtraces > > from all the threads, because at least 2 threads are involved in > > interaction with a subprocess on MS-Windows. > > Thanks. I'll ask, though I'm not sure if the user has a debugger > available. If the user doesn't have GDB, he/she can download one from the MinGW site. I think using a debugger is the only way to understand what happens here.