Bug 46689

Summary: xscope fd_set debug output is undefined
Product: xorg Reporter: Peter Jeremy <peterjeremy>
Component: App/otherAssignee: Alan Coopersmith <alan.coopersmith>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: jeremyhu
Version: unspecifiedKeywords: patch
Hardware: x86-64 (AMD64)   
OS: FreeBSD   
Whiteboard: 2012BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
Change fd_set debug output to display actual contents of first 32 or 64 bits. none

Description Peter Jeremy 2012-02-27 12:58:00 UTC
Created attachment 57732 [details] [review]
Change fd_set debug output to display actual contents of first 32 or 64 bits.

In xscope-1.3.1, MainLoop() contains debug(128,...) code that appears intended to display the fd_set contents before and after the main select() call.  In most implementations, fd_set will be a struct though it is printed as an int, thus the actual debug output is unlikely to usefully reflect the actual fd_set contents.

I developed the attached patch whilst debugging a problem with the file descriptor sets.
Comment 1 Alan Coopersmith 2012-07-08 11:20:49 UTC
Thanks for the patch - pushed to git master for next release:
http://cgit.freedesktop.org/xorg/app/xscope/commit/?id=e63977f320b8678d66bb061b9502dc0764a5427f

Though in order to build on Solaris, I also had to push an additional fix to use
the Xpoll.h portability macros to deal with the different struct member names
used on different platforms:
http://cgit.freedesktop.org/xorg/app/xscope/commit/?id=b21c6c52bb8109329d7eb63072f8ebf41a42a7f9

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.