X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 	tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
From: Haojun Bao <baohaojun@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Emacs can't start-process more than 30~40 processes
In-Reply-To: <4A6ECC33.2020306@gmail.com> (Dave Korn's message of "Tue, 28 Jul 	2009 11:00:19 +0100")
References: <83iqhlbgoc.fsf@gmail.com> <4A6727A8.2090905@cornell.edu> 	<83iqhkur2h.fsf@gmail.com> <834osy98jo.fsf_-_@gmail.com> 	<83tz0xtt6c.fsf@gmail.com> <4A6ECC33.2020306@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.96 (cygwin)
Date: Wed, 29 Jul 2009 11:39:29 +0800
Message-ID: <83vdlc5f9q.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Dave Korn <dave.korn.cygwin@googlemail.com> writes:

> Haojun Bao wrote:
>
>> 
>> My question is, is there anyway out of this? Can I just rebase
>> cygwin1.dll to the end of all other DLLs? 
>
>   It ought to work.  Would you mind giving it a try and letting us know if it
> helps?  It might be a good idea to tweak rebaseall to do this for us.
>
Yes, it helped, the max start-process number is improved from ~30 to
~37. I think it's hit another issue.

Here's the details: 

I can't run rebase.exe on cygwin1.dll directly, since the latter is
loaded by the former. I wrote a .bat file to rebase it:

    cd c:\cygwin\bin
    c:
    copy cygwin1.dll 2.dll
    rebase -b 0x45000000 2.dll
    copy 2.dll cygwin1.dll

I did not try to rebase cygwin1.dll to the end of all other DLLs though,
I don't know if that is feasible. Instead, I just make it a lot more far
away from the DLL that's next to it in the address space.

(The old base for cygwin1 is 0x61000000, and next is cygncurses-9.dll
based at 0x61650000, the max cygheap is ~6.6M; new cygwin1 base is
0x45000000, and the next DLL is cygz.dll, with a base 0x54950000, with a
max cygheap ~256M).

After this, the emacs can start more processes, but still not unlimited,
neither will it segfault; it just exits will code 255 after printing
"Wrong type argument: stringp, 0". This must be another issue now, I
will debug it when I have more time.

    $/bin/emacs  --batch -q  --execute '(let ((num 0))
     (while (< num 80)
            (setq num (+ num 1))
            (message "num is %d" num)
            (start-process "hello" nil "/usr/bin/echo")))'
    ---------------- output ----------------
    ...
    ...
    num is 37
    Wrong type argument: stringp, 0
    

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

