Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#18491 closed defect (fixed)

XtAppPending and XtAppProcessEvent infloop

Reported by: yaseppochi (Stephen J. Turnbull) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Cc: ctm@…
Port: xorg-libXt

Description

XtAppPending can block; this is a complex of X.org bugginess reported as http://bugs.freedesktop.org/show_bug.cgi?id=20048.

On recent Mac OS X (10.5.6 and 10.4.11+security update 2008-008), one of the problems results in an infloop in _XtWaitForSomething, the basic event gathering function for both XtAppPending and XtAppProcessEvent. I have no clue why, but under certain circumstances poll(2) will return with a fd in POLLNVAL state (ie, not open). _XtWaitForSomething ignores this, and loops looking for input, but I guess the POLLNVAL fd is at the head of the queue and never gets processed. (That's idle speculation, to be honest I really have no clue why this happens.)

The attached patch patch-NextEvent.c-XPOLL_EXCEPT teaches _XtWaitForSomething to notice this event, which fixes the infloop for me. I recommend application to MacPorts strongly (see the bug referenced above for rationale).

A second patch seems to me to be correct in principle, but it is neither necessary nor sufficient to fix the infloop. Since I've got it, Ill post it here for your consideration.

Attachments (2)

patch-NextEvent.c-XPOLL_EXCEPT (379 bytes) - added by yaseppochi (Stephen J. Turnbull) 16 years ago.
patch-NextEvent.c-BLOCK_CORRECTLY (373 bytes) - added by yaseppochi (Stephen J. Turnbull) 16 years ago.

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by yaseppochi (Stephen J. Turnbull)

Changed 16 years ago by yaseppochi (Stephen J. Turnbull)

comment:1 Changed 16 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to jeremyhu@…

comment:2 Changed 16 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

comment:3 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

comment:4 Changed 15 years ago by ctm@…

Cc: ctm@… added

Cc Me!

Note: See TracTickets for help on using tickets.