New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #18491 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

XtAppPending and XtAppProcessEvent infloop

Reported by: stephen@… Owned by: jeremyhu@…
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

patch-NextEvent.c-XPOLL_EXCEPT (379 bytes) - added by stephen@… 4 years ago.
patch-NextEvent.c-BLOCK_CORRECTLY (373 bytes) - added by stephen@… 4 years ago.

Change History

Changed 4 years ago by stephen@…

Changed 4 years ago by stephen@…

comment:1 Changed 4 years ago by macsforever2000@…

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

comment:2 Changed 4 years ago by jeremyhu@…

  • Status changed from new to closed
  • Resolution set to fixed

comment:3 Changed 4 years ago by anonymous

  • Milestone Port Bugs deleted

Milestone Port Bugs deleted

comment:4 Changed 3 years ago by ctm@…

  • Cc ctm@… added

Cc Me!

Note: See TracTickets for help on using tickets.