[Xquartz-dev] ALLOCATE_LOCAL / crashes

Greg Parker gparker at apple.com
Thu Dec 6 21:44:10 PST 2007

On Dec 6, 2007, at 9:07 PM, Ben Byer wrote:
> So, it seems that ALLOCATE_LOCAL is responsible for at least some of  
> the "rootless crashes" we're seeing -- specifically, all of the ones  
> where the crash fell in any of the mi* functions.
> (My understanding is that ALLOCATE_LOCAL is more dangerous to use on  
> Leopard due to virtual memory layout -- it should never be used to  
> allocate more than about a kilobyte, and I just saw miFillPolyArc  
> crash by trying to allocate 900k.)
> http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commit;h=7caf51d1a5a86ae884e0087795636222c082962c

ALLOCATE_LOCAL has caused trouble since XDarwin's earliest days.  
(Symptom then: remotely run Solaris Netscape on some golfing web page,  
then select all. Crash while filling some very large number of  
rectangles.)  The problem can be simple stack overflow, or exceeding  
the maximum single stack frame. (The latter may only be a problem on  
ppc with old versions of gcc.)

I see that the Xserver thread is using the default pthread stack size,  
only 500K. Boosting that to 8MB (matching the stack size for the main  
thread) would help, but you'll still probably have pathological cases.  
Linux gets to grow its stack until it runs into some other allocation,  
so it can cope better with alloca(bignum).

Still, 900KB? How big of an arc was it trying to draw?

Greg Parker     gparker at apple.com     Runtime Wrangler

More information about the Xquartz-dev mailing list