From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sean M. Paus" Newsgroups: gmane.emacs.devel Subject: Emacs hang under cygwin 1.5.21 Date: Sat, 30 Sep 2006 16:57:01 -0400 Message-ID: <451EDA1D.3070507@pobox.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0575686218==" X-Trace: sea.gmane.org 1159649882 5845 80.91.229.2 (30 Sep 2006 20:58:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2006 20:58:02 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 30 22:57:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GTluD-0000pP-2r for ged-emacs-devel@m.gmane.org; Sat, 30 Sep 2006 22:57:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GTluC-0008IO-Ld for ged-emacs-devel@m.gmane.org; Sat, 30 Sep 2006 16:57:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GTlty-0008IA-BU for emacs-devel@gnu.org; Sat, 30 Sep 2006 16:57:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GTltw-0008Ho-OL for emacs-devel@gnu.org; Sat, 30 Sep 2006 16:57:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GTltw-0008Hl-MC for emacs-devel@gnu.org; Sat, 30 Sep 2006 16:57:36 -0400 Original-Received: from [206.46.252.44] (helo=vms044pub.verizon.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GTlzY-0002as-9B for emacs-devel@gnu.org; Sat, 30 Sep 2006 17:03:24 -0400 Original-Received: from [192.168.0.102] ([71.246.250.105]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J6F00AKBBJE4VX4@vms044.mailsrvcs.net> for emacs-devel@gnu.org; Sat, 30 Sep 2006 15:57:15 -0500 (CDT) Original-To: emacs-devel@gnu.org X-Enigmail-Version: 0.94.0.0 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60339 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============0575686218== Content-type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary=------------enigC05BB80810833AD4F533478F This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC05BB80810833AD4F533478F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Originally posted some of this to help-gnu-emacs. It was suggested that I post here to emacs-devel. I've also posted a version of this to the cygwin mailing list (no responses yet). I've recently upgraded my cygwin installation to 1.5.21. Since then, I have had no luck getting emacs to run. I've tried the stock 21.2 that comes with the cygwin distribution, the test 21.3 that was posted a while back, and I've even downloaded and (well half) built the latest sources from the emacs CVS repository. I can't get past the first execution of bootstrap-emacs.exe. The problem is that emacs just hangs and takes up gobs of CPU. I ultimately tracked this down to a tight infinite loop in _malloc_internal (gmalloc.c). For some reason, align (also in gmalloc.c) is returning a pointer that is smaller than _heapbase. The calculation to determine what block the newly requested memory is in (BLOCK(result+size)) returns a ridiculously huge number. Since _malloc_internal incrementally doubles the new size of the heap until the requested memory fits, at some point the multiplication overflows and newsize gets a value of 0. Since 0 * 2 is always zero, the test for BLOCK(result+size) > newsize always succeeds and _malloc_internal gets stuck in a tight loop multiplying 0 by 2 forever. For example, _heapbase is something around 0x203f4000, but align (really sbrk) returns 0x642000. I've tried to track down why this is happening, but it just gets weirder the more I look. temacs.exe runs with no problem because something called bss_sbrk is used to increase the heap. However, before temacs exits it strips out all of the bss_sbrk stuff, falling back to the standard sbrk. It's the standard sbrk that is returning a pointer < _heapbase. Additionally, (in bootstrap-emacs.exe) _malloc_initialize (in gmalloc.c) doesn't appear to be called, ever, which makes me wonder how _heapinfo and _heapbase are ever being initialized. I ran boostrap-emacs.exe under gdb and had it break in malloc_initialize (somewhere in cygwin1.dll) to see if I could trace when emacs' _malloc_initialize was called. Surprisingly, _malloc_initialized (also in gmalloc.c) already had a value of 1. I have had no luck finding the change to cygwin that caused this. Reputedly, this has been a problem since the 1.5.19 version of cygwin1.dl= l. Any thoughts? Sean --------------enigC05BB80810833AD4F533478F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFHtokulyT9+vyDFcRAshiAJ4gcjVkFzUxLTi9kNgfAMOpHhDbGQCg8bTa tIXj2VD4TroPG/3xnTqncHw= =vV5m -----END PGP SIGNATURE----- --------------enigC05BB80810833AD4F533478F-- --===============0575686218== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0575686218==--