kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

wait function raises a TimeoutException when a process returns -1 (Windows) #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a process that has an exit code of -1
2.Launch that process and use wait with no arguments
3.wait function will raise a TimeoutException, but there is no timeout, the 
application exits with -1, so it should return -1 instead

What version of psutil are you using? What Python version?
It happens on 0.2.1 and on trunk as of 18/05/2011

On what operating system? 
Tested on WinXP/Win7

Please provide any additional information below.
trunk/psutil/_psmswindows.py  -> Line 167 & 168 (it checks for -1)
trunk/psutil/_psutil_mswindows.c -> function process_wait

Original issue reported on code.google.com by amnio...@gmail.com on 18 May 2011 at 7:00

GoogleCodeExporter commented 9 years ago
I've modified the code in r971 to return and check for the actual WAIT_TIMEOUT 
value instead of -1, so that should solve this issue. However, If the process 
for some reason returns WAIT_TIMEOUT (0x00000102) then this will still occur. 
Since -1 is a moderately likely return value and 0x00000102 less so, I think 
that's a reasonable compromise.

Original comment by jlo...@gmail.com on 18 May 2011 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 27 Jun 2011 at 5:52

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 8 Jul 2011 at 7:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated csets after the SVN -> Mercurial migration:
r971 == revision 70284e93f610

Original comment by g.rodola on 2 Mar 2013 at 12:00