From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.bugs Subject: bug#18396: 24.3.1; On windows, process-send-string can freeze Emacs Date: Wed, 3 Sep 2014 20:43:07 +0200 Message-ID: <20140903204307.0bcf515c@forcix> References: <87k35kod3w.fsf@loki.jorgenschaefer.de> <831trsinu3.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1409769865 28563 80.91.229.3 (3 Sep 2014 18:44:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2014 18:44:25 +0000 (UTC) Cc: 18396@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 03 20:44:17 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 1XPFXU-0003xA-Cy for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2014 20:44:16 +0200 Original-Received: from localhost ([::1]:47124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPFXU-0002w6-2t for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2014 14:44:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPFXM-0002v6-9o for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 14:44:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPFXG-0004AQ-VA for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 14:44:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPFXG-0004AH-SA for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 14:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XPFXG-0002S5-DI for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2014 14:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jorgen Schaefer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Sep 2014 18:44: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.14097697959364 (code B ref 18396); Wed, 03 Sep 2014 18:44:02 +0000 Original-Received: (at 18396) by debbugs.gnu.org; 3 Sep 2014 18:43:15 +0000 Original-Received: from localhost ([127.0.0.1]:58080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPFWU-0002Qx-LC for submit@debbugs.gnu.org; Wed, 03 Sep 2014 14:43:15 -0400 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:45425) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPFWR-0002Qk-RW for 18396@debbugs.gnu.org; Wed, 03 Sep 2014 14:43:12 -0400 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id 87A922011D7; Wed, 3 Sep 2014 20:43:09 +0200 (CEST) Original-Received: from forcix (port-52353.pppoe.wtnet.de [46.59.205.39]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id F29FA2011D2; Wed, 3 Sep 2014 20:43:08 +0200 (CEST) In-Reply-To: <831trsinu3.fsf@gnu.org> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; i586-pc-linux-gnu) 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:92998 Archived-At: On Wed, 03 Sep 2014 21:03:00 +0300 Eli Zaretskii wrote: > > From: Jorgen Schaefer > > Date: Wed, 03 Sep 2014 18:58:11 +0200 > > > > A user's bug report[1] on my project Elpy has revealed an apparent > > bug in Emacs. > > I'm not sure it is a bug in Emacs. After your explanation, I'm not so sure, either. > > Elpy starts a Python process using `start-process' with > > `process-connection-type' set to nil, `default-directory' set to > > "/", and an unchanged coding system. > > 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? > 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? The same would happen on Unix, except the buffer size is much larger, meaning it's a lot less likely. I guess the Python process could use threading to avoid this. 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'm a bit at a loss now as to how to continue debugging this. > > 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. Jorgen