Bug 13471

Summary: lib/Xt/NextEvent.c:_XtWaitForSomething needs better error handling
Product: xorg Reporter: Clay Harris <cosmos>
Component: Lib/XtAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED DUPLICATE QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: low CC: stephenjturnbull
Version: 7.1 (2006.05)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Clay Harris 2007-11-30 12:38:16 UTC
_XtWaitForSomething calls either select or poll to wait.
On failure, it handles EINTR and EAGAIN fine, but drops to a generic error
handler on any other type of error.  The generic handler calls XtAppWarningMsg
and then continues the loop.

This behavior is acceptable for transient errors, e.g. ENOMEM, but for others,
unless there is a mechanism to correct the error on the fly, the result is
an infinite loop.

You can either assume that the user's XtAppWarningMsg routine will correct the
error in which case you must at least set app->rebuild_fdlist = TRUE before
continuing the loop
OR you assume that the error is permanent and call XtAppErrorMsg instead.
Errors like EINVAL and EFAULT should always be fatal in any case.
Comment 1 Jeremy Huddleston Sequoia 2011-10-03 09:55:05 UTC
Marking as a dupe of #20048 which has more progress/info.

*** This bug has been marked as a duplicate of bug 20048 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.