Program stalls when called via Popen4?

Joshua Pollak joshp at cra.com
Thu Mar 20 16:34:32 EST 2003


Hello,

I'm writing an autobuild script for internal use at my company. Its supposed
to check our code out of our source control system, call our build system,
then run our unit tests and email the results to a developer.

Everything seems to be working correctly, EXCEPT that the popen2.Popen4
instance I'm using to actually build our project never returns. When I
'watch' what the subprocess is doing by using 'ps aux', it seems that it
has stalled on the first call to 'echo'! I'm not sure how to debug this
because when I try to duplicate the results manually, everything works
fine. 

Here is the relevant code:

compileCommand = self.params["SetupCmd"] + " && "+self.params["CompileCmd"]
compileProcess =  popen2.Popen4(compileCommand)

compileCommand gets set to this:

source CraVisionKit/Scripts/SetupVisionKit.bsh && cd CraVisionKit && make

The source part is important, because it sets up environment variables
needed by the make command.

the relevant output from running ps aux looks like this:

jpollak   3581  0.2  0.2  3192 2016 pts/6    S    16:21   0:00
        /usr/bin/python ./Autobuild.py Autobuild.rc
jpollak   3584  0.0  0.1  3832 1072 pts/6    S    16:21   0:00 
        /bin/sh -c source CraVisionKit/Scripts/SetupVisionKit.bsh && 
                        cd CraVisionKit && make
jpollak   3586  0.0  0.0  3308  728 pts/6    S    16:21   0:00 
        make
jpollak   3631  0.0  0.0  3304  720 pts/6    S    16:21   0:00 
        make -C UnitTimerFramework BUILD_TYPE= LIB_TYPE=
jpollak   3632  0.0  0.0  3112  416 pts/6    S    16:21   0:00 
        echo Compiling 
libCraVKUnitTimerFramework-09d.so:UnitTimerFrameworkExceptionsd.o

It will sit at that 'echo' for hours if I let it.

Is this a Python problem? Am I doing something wrong? The relevant portion
of the make file looks completely error free, and it of course works from
the command line!

-- 
Joshua Pollak             617-491-3474 x586
Software Engineer             joshp at cra.com
Charles River Analytics




More information about the Python-list mailing list