[CMake] cmake on multicore interix'en

Markus Duft markus.duft at salomon.at
Wed Feb 17 05:04:45 EST 2010


Hi all!

I'm porting cmake to interix for use in my company. It seems to work
quite well on single core machines. however, when it comes to multicore,
interix has several severe bugs. fixing those may (better: _will_) take
a lot of time. in the meantime i'm trying to hack around things.

i'm currently stuck with a rather big problem (or two...):

cmakes implementation of how child processes are handled doesn't work
reliably on multicore interix. it seems that every other SIGCHLD is lost
somewhere on the way. i (printf-)debugged cmake a little during
bootstrap, and it seems that at random points in time, SIGCHLD is lost,
and cmake locks up in a select() call on the signal pipe (SIGCHLD is
lost, so nobody will write on the signal pipe). i tried to hardcode a 5
seconds timeout if none is set, and that makes cmake move on (although
of course that one step where it hung fails, since i hit a timeout :]).

what i need now, is a guru for this process handling code, who can tell
me what's the most easy way to hack around loosing signals (i.e. don't
use them anomore :)), without re-writing all of the process handling
code (again).

i thought of introducing some lame timeout when select()ing the signal
pipe, then checking whether the process is still alive (wait()), and
again selecting if it is. what do you think?

one more word to say: although interix is running on top of the windows
kernel, i don't have access to the win32 api, so i can't reuse the win32
code.

the second problem i have is regarding a broken select(). i tried to
work around it by setting KWSYSPE_USE_SELECT, which initially didn't
work, because the code seems b0rked. it seems that there is a wrong
timeout check in that code path. first kwsysProcessGetTimeoutLeft is
called, like in the select() code path, but directly after that, the
timeoutLength members are checkd seperately once more. with this check
it seems that all sub-processes "time out" immediately. if i comment
this check, it works fine (although the above random SIGCHLD propblem
persists of course).

Need more info? I'll be glad to provide it ;)

Thanks in advance for taking the time to help!

Cheers, Markus


More information about the CMake mailing list