* Emacs hang under cygwin 1.5.21
@ 2006-09-30 20:57 Sean M. Paus
0 siblings, 0 replies; only message in thread
From: Sean M. Paus @ 2006-09-30 20:57 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 2398 bytes --]
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.dll.
Any thoughts?
Sean
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-30 20:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-30 20:57 Emacs hang under cygwin 1.5.21 Sean M. Paus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.