[cmake-developers] Rogue7 dashboards and clang undefined behaviour

Brad King brad.king at kitware.com
Tue Jun 4 13:45:34 EDT 2013


On 06/04/2013 01:30 PM, Sean McBride wrote:
> 'CTestTestFdSetSize' is superficially happening in an OS header's macro:
> 
> static __inline int
> __darwin_fd_isset(int _n, const struct fd_set *_p)
> {
> 	return (_p->fds_bits[_n/__DARWIN_NFDBITS] & (1<<(_n % __DARWIN_NFDBITS)));
> }
> 
> where right right-hand side of the << is apparently 31.  __DARWIN_NFDBITS is 32.
> 
> Alas, gdb refuses to give me a backtrace.  But there are only 9 FD_ISSET() in
> CMake, anyone familiar with this test/code?

The test covers CTest's ability to drive many child processes at once
so the file descriptor set is getting filled up.  The FD_ISSET calls
in Source/kwsys/ProcessUNIX.c will be the ones triggering this.  It
looks to me like the bug is in the OS header macro because the "1<<"
should be "1u<<".

-Brad



More information about the cmake-developers mailing list