X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Mon, 8 Aug 2011 18:25:56 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: emacs and large-address awareness under recent snapshots Message-ID: <20110808162556.GM11601@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4E3C79E0 DOT 3030506 AT cornell DOT edu> <20110807113354 DOT GG11601 AT calimero DOT vinschen DOT de> <20110807115056 DOT GI11601 AT calimero DOT vinschen DOT de> <4E3EA497 DOT 7040402 AT cornell DOT edu> <4E3EBAEF DOT 1030004 AT cornell DOT edu> <20110807200222 DOT GK11601 AT calimero DOT vinschen DOT de> <4E3F13D8 DOT 7090608 AT cornell DOT edu> <4E3FE323 DOT 9020201 AT cornell DOT edu> <20110808155048 DOT GA28218 AT calimero DOT vinschen DOT de> <4E40093D DOT 10107 AT cornell DOT edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4E40093D.10107@cornell.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Aug 8 12:05, Ken Brown wrote: > On 8/8/2011 11:50 AM, Corinna Vinschen wrote: > >On Aug 8 09:22, Ken Brown wrote: > >>I attached gdb to the running process and got some more information. > >>It turns out that this has nothing to do with X. It's just that > >>starting emacs under X causes emacs to try to allocate memory, and > >>this makes the problem show up very quickly. > >> > >>It looks to me like emacs gets stuck in morecore_nolock() and/or > >>_malloc_internal_nolock(), which are defined in src/gmalloc.c. > >>Apparently, emacs has a peculiar way of managing memory on Cygwin, > >>and this chokes on the changes to the heap start address as of > >>2011-07-21. I don't know enough programming to fix this. If anyone > >>wants to try, the relevant source files to look at are gmalloc.c, > >>sheap.c, and unexcw.c. The second and third are compiled only in > >>the Cygwin build, and the first also has some Cygwin-specific stuff. > >> > >>Maybe I should take this to the emacs-devel list at some point, but > >>I'll wait a while to see if someone on this list can help. > > > >I had a look into the sources you're mentioning above, but I don't see > >anything suspicious, apart from the fact that emacs uses some static > >buffer of 12 Megs as heap on Cygwin... sometimes. At least that's what > >sheap.c is about, afaics. > > I'll build a debug version and try stepping through the functions I > mentioned. Maybe I can figure out what's happening. I suspect that > it does have something to do with the static heap. Maybe, but the static heap is in the bss segment, so it's not in the application heap starting at 0x80000000, but somewhere within the .bss section's address range from 0x746000 to 0x1380000. There's also this strange comment at the top of sheap.c: simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin; complete rewrite of xemacs Cygwin `unexec' code Whatever "unexec" is. The code is from 2004. I'm concerned that it still tries to workaround some old problem in the Cygwin sbrk implementation in Cygwin 1.5. Unfortunately the comment doesn't contain any hint as to what exact problem this code is trying to workaround. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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