From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.devel
Subject: Re: "resource temporarily unavailable" errors on windows 7
Date: Mon, 12 Mar 2012 19:24:35 +0200
Message-ID: <83aa3lybos.fsf@gnu.org>
References: <CAH-ciFoNr0U7FfJ488MCLSS+zCc6WFF1YrZsQaXXfbL0V8docw@mail.gmail.com>
Reply-To: Eli Zaretskii <eliz@gnu.org>
NNTP-Posting-Host: plane.gmane.org
X-Trace: dough.gmane.org 1331573083 11707 80.91.229.3 (12 Mar 2012 17:24:43 GMT)
X-Complaints-To: usenet@dough.gmane.org
NNTP-Posting-Date: Mon, 12 Mar 2012 17:24:43 +0000 (UTC)
Cc: emacs-devel@gnu.org
To: Alex Harsanyi <alexharsanyi@gmail.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 12 18:24:42 2012
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1S78z8-0005o8-Kx
	for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2012 18:24:38 +0100
Original-Received: from localhost ([::1]:41231 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1S78z7-0002a5-W2
	for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2012 13:24:37 -0400
Original-Received: from eggs.gnu.org ([208.118.235.92]:38897)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eliz@gnu.org>) id 1S78z0-0002Ya-Aw
	for emacs-devel@gnu.org; Mon, 12 Mar 2012 13:24:36 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eliz@gnu.org>) id 1S78yy-0005IX-Ey
	for emacs-devel@gnu.org; Mon, 12 Mar 2012 13:24:29 -0400
Original-Received: from mtaout21.012.net.il ([80.179.55.169]:59063)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@gnu.org>)
	id 1S78yy-0005IC-66
	for emacs-devel@gnu.org; Mon, 12 Mar 2012 13:24:28 -0400
Original-Received: from conversion-daemon.a-mtaout21.012.net.il by
	a-mtaout21.012.net.il (HyperSendmail v2007.08) id
	<0M0S006008BKKG00@a-mtaout21.012.net.il> for
	emacs-devel@gnu.org; Mon, 12 Mar 2012 19:24:26 +0200 (IST)
Original-Received: from HOME-C4E4A596F7 ([77.124.179.236]) by a-mtaout21.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0M0S006ZK8CPGD80@a-mtaout21.012.net.il>;
	Mon, 12 Mar 2012 19:24:26 +0200 (IST)
In-reply-to: <CAH-ciFoNr0U7FfJ488MCLSS+zCc6WFF1YrZsQaXXfbL0V8docw@mail.gmail.com>
X-012-Sender: halo1@inter.net.il
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 80.179.55.169
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.devel:148977
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/148977>

> Date: Mon, 12 Mar 2012 12:56:13 +0800
> From: Alex Harsanyi <alexharsanyi@gmail.com>
> 
> I keep encountering the following error each time I try to start a
> subprocess under emacs:
> 
>    File error: Spawning child process, resource temporarily unavailable
> 
> This happens on Windows 7, 32 bit with the prebuilt binaries versions
> 23.4, 24.0.93 and 24.0.94 but *not* with Emacs 23.3.  It happens when
> launching all kinds of sub-processes (compilation commands, version
> control commands, diff, aspell, bash, etc).  It also happens on two
> other colleagues computers, also running Windows 7, 32 bit.  If I set
> the Windows XP compatibility flag on emacs.exe, the problem goes away,
> but makes Emacs unusable for me, since the programs I need to run do
> not work when the compatibility mode is set.
> 
> I run a diff between Emacs 23.3 and 23.4 and identified that a new
> allocate_heap() function was added in 23.4.  If I remove the function,
> falling back on the one used in 23.3 than I no longer get the above
> error.  (I attached a patch to show which function I talk about, not
> to suggest removing the function).
> 
> Should this version of allocate_heap() be used on a Windows 7, 32 bit
> platform?

I don't see why not; we need more specific information to make a
decision.

This function is responsible for reserving memory for the Emacs
process at startup.

The question is, why reserving the memory the way allocate_heap does
causes trouble for you.  What that function does is start by asking
for 2GB or reserved memory, and if that fails, asks for less and less
in steps of 8MB.  Can you step through that function with a debugger
and see how much memory it eventually allocates?

Using the version that assumes no USE_LSB_TAG gives you only 256MB,
which is too low a number.  This could be a fallback if we find no
better way, but I'd like first to understand why the current code
fails and how.