Re: 2.3.2 beta 2 hang
Re: 2.3.2 beta 2 hang
- Subject: Re: 2.3.2 beta 2 hang
- From: Greg Parker <email@hidden>
- Date: Tue, 28 Oct 2008 13:00:09 -0700
On Oct 28, 2008, at 6:27 AM, Jamie Kennea wrote:
I've experienced a couple of hangs of X11, i.e. permanent beach
balls. I can't figure out the cause, however I've attached the
output of Activity Monitor's sample.
I see two threads in _xp_synchronize:
1619 -[X11Application(Private)
sendX11NSEvent:]
1619 xp_find_window
1619 xp_synchronize
1619 _xp_synchronize
1619 _xp_async_dequeue
1619 pthread_cond_wait$UNIX2003
1586 __semwait_signal
1586 __semwait_signal
32 0xffffffff
32 _sigtramp
32 _sigtramp
1 __spin_lock
1 __spin_lock
1619 RootlessStartDrawing
1619 xprStartDrawing
1619 xp_lock_window
1619 xp_synchronize
1619 _xp_synchronize
1619 _xp_async_dequeue
1619 pthread_cond_wait$UNIX2003
1619 __semwait_signal
1619 __semwait_signal
I don't like this xp-async stuff at all. I haven't examined the entire
threading structure, but several things look suspicious. Unless
there's some higher-level locking going on, these are likely to be bugs:
* If I understand _xp_synchronize correctly, the above sample has two
threads processing events from the same queue until a target event is
found. But if each thread happens to grab the other thread's target
event, they'll both spin the queue forever without finding what they
want.
* I don't see any locks around the use of next_serial.
* If one thread calls _xp_do_request and another calls
xp_synchronize(), they'll both use the same value from next_serial,
which means at least one will fail to dequeue the event it's looking
for.
* While they're processing the queue the two threads are firing
arbitrary events on effectively random threads. Unless the event
callbacks themselves lock something, you'll get corruption.
There's also a signal that arrived while the main thread was trying to
dequeue. I think that's harmless; it looks like _xp_async_dequeue has
the right spurious wakeup checks around its condition variable. In any
case, the app had presumably already hanged before this sample started.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden