[Development] forkfd help on OS X 10.7

Thiago Macieira thiago.macieira at intel.com
Fri Jan 2 18:39:31 CET 2015


Hi

I need a little help with forkfd for OS X 10.7. The builds with forkfd have 
failed on the CI on 10.7 only for no reason I can determine. If you have 
access to 10.7 -- especially those in the CI system -- please build QtCore 
after checking out https://codereview.qt-project.org/102805 and run the 
attached simple program. If it locks up, please rerun with:

	sudo dtruss -dl ./qprocess-test 2>trace

Count to 5, Ctrl+C, then send me the trace file.

The symptom is that waitForFinished() always times out. That means the pipe 
that forkfd() creates never gets activated for reading. Assuming that pipes 
work on OS X 10.7, that means the SIGCHLD handler never wrote to the writing 
end of the pipe.

Unfortunately, I can't tell why it didn't write, which is why I need help. 
When I wrote forkfd, I had OS X 10.8 and it worked fine. I'm running now on 
10.9 and it's still fine.

Possibilities are:
 1) The sigaction(2) call failed, so the SIGCHLD handler never got installed
 2) The status int didn't get set to 1 (unlikely)
 3) waitid(P_ALL) returned no child process needing to be waited on
 4) waitid(P_PID, pid) failed
 5) waitid(P_PID, pid) succeeded but did not set info->si_pid as expected
 6) the write() call failed

The last patch in the series adds debugging / assertions for all cases except 
#3 and #4. That's why I need the dtruss output.


Additionally, there's one particular test (tst_QUndoStack::commandTextFormat) 
that freezes forever on read() from that pipe:
 QtQA::App::TestRunner: 7   libsystem_kernel.dylib        	
0x00007fff9239baf2 read + 10
  QtQA::App::TestRunner: 8   org.qt-project.QtCore         	
0x000000010a4d1e90 TestNamespace::QProcessPrivate::waitForDeadChild() + 64
  QtQA::App::TestRunner: 9   org.qt-project.QtCore         	
0x000000010a48015c TestNamespace::QProcessPrivate::_q_startupNotification() + 
284
  QtQA::App::TestRunner: 10  org.qt-project.QtCore         	
0x000000010a4d11e8 TestNamespace::QProcessPrivate::waitForStarted(int) + 328
  QtQA::App::TestRunner: 11  org.qt-project.QtCore         	
0x000000010a4821bb TestNamespace::QProcess::execute(TestNamespace::QString 
const&) + 187

Note that this backtrace is from a release build so it's missing some frames. 
I'm assuming that QProcess::waitForFinished and 
QProcessPrivate::waitForFinished got inlined. 

If it got to that point in _q_startupNotification, that means the 
childStartedPipe did activate in select() but it contained more than zero 
bytes -- that is, a child startup failure. That shouldn't happen, since the 
test is trying to run lrelease. That's an outlier and does not correspond to 
any of the other failures. Since we've seen problems before when OS X build 
machines suddenly stop finding tools like "cp" on the system, I will assume 
this is just OS X being stupid again (possibly filesystem corruption).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 150 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150102/3a23ef77/attachment.cpp>


More information about the Development mailing list