all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs hangs on Mac OS X
@ 2007-01-03 10:47 Piet van Oostrum
  2007-01-03 13:25 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 4+ messages in thread
From: Piet van Oostrum @ 2007-01-03 10:47 UTC (permalink / raw)


With Emacs.app compiled from the pretest tarball (downloaded Dec 19) I get
a hang fairly often. I can't remember that I had these with the previous
version (from a CVS checkout), or at least much less often. Now I get them
about once a day. I have grabbed a stack trace with gdb:

#0  0xffff85d8 in ___spin_lock_relinquish () at /System/Library/Frameworks/System.framework/PrivateHeaders/ppc/cpu_capabilities.h:186
#1  0x900031b4 in szone_malloc ()
#2  0x900030e4 in malloc_zone_malloc ()
#3  0x907bb488 in CFAllocatorAllocate ()
#4  0x907dc41c in CFRunLoopRunSpecific ()
#5  0x93208740 in RunCurrentEventLoopInMode ()
#6  0x93207d4c in ReceiveNextEventCommon ()
#7  0x9330c940 in ReceiveNextEventInMode ()
#8  0x00158034 in XTread_socket (sd=0, expected=1, hold_quit=0xbfffca6c) at macterm.c:10410
#9  0x0008ad24 in read_avail_input (expected=0) at keyboard.c:6823
#10 0x001387a4 in alarm_signal_handler (signo=0) at atimer.c:397
#11 <signal handler called>
#12 0x9000437c in szone_malloc ()
#13 0x00000000 in ?? ()

I don't have the source of /System/Library/Frameworks/System.framework/
PrivateHeaders/ppc/cpu_capabilities.h, apparently this is compiled into the
system by Apple's developers.

It looks like a malloc call is interrupted by a timer alarm, and then the
system also needs a malloc. Malloc probably not being reentrant this should
be a cause of problems. Maybe the spin_lock stuff is a way to serialize the
malloc calls but this won't work for a signal handler, only for threads.

The timer is probably for poll_for_input.

I think something should be done to prevent mallocs (and probably also
frees) to be interrupted by the alarm signal. Or maybe doing the event loop
in a signal handler is not such a good idea.

Another possibility would be to run the event loop in a different thread
and let it put all events in a synchronized queue, where it can be popped
by read_avail_input.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-03 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-03 10:47 Emacs hangs on Mac OS X Piet van Oostrum
2007-01-03 13:25 ` YAMAMOTO Mitsuharu
2007-01-03 21:39   ` Piet van Oostrum
2007-01-03 23:14     ` YAMAMOTO Mitsuharu

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.