Bug 90616

Summary: libICE build fails on array bounds check
Product: xorg Reporter: Remko van der Vossen <bugs>
Component: Lib/ICEAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to change _IceVersion* globals to const variables none

Description Remko van der Vossen 2015-05-24 12:06:58 UTC
Created attachment 116007 [details]
Patch to change _IceVersion* globals to const variables

Recent versions of gcc have array bounds checking turned on by default, this leads to build failures of libICE. As the _IceVersionCount variable in ICElibint.h is not declared const the compiler cannot assume that the nested for loop in ProcessConnectionSetup stays within bounds.

The simple fix is of course to change the declarations of _IceVersionCount, _IceVersions, and the local variable myVersionCount to const declarations, a patch for which is attached to this bug report. I am however not certain that this does not have any ABI impact. The name of file ICElibint.h suggests there is no ABI impact, but I don't know enough of the library to say with certainty.
Comment 1 Alan Coopersmith 2015-07-19 15:38:36 UTC
Correct, the ABI we intend to export is covered in the header files in the
include/X11/ICE/ subdirectory - src/ICElibint.h is considered internal
implementation details of the library.

This looks reasonable and since no one else has suggested an alternative,
nor commented on this, I've gone ahead and pushed to git master so it
starts getting a little testing.

To ssh://git.freedesktop.org/git/xorg/lib/libICE
   8a511da..b1720ed  master -> master

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.