fix the return status check of subprocess#531
fix the return status check of subprocess#531fouzhe wants to merge 3 commits intojtpereyda:masterfrom
Conversation
The description of `os.waitpid` is:
```
waitpid(...)
waitpid(pid, options) -> (pid, status)
Wait for completion of a given child process.
```
The return value of `os.waitpid` is a tuple thus the `self.exit_status` can not be `None`.
|
boofuzz/boofuzz/utils/debugger_thread_simple.py Lines 155 to 156 in d47fe79 |
The second element of the return value of boofuzz/boofuzz/utils/debugger_thread_simple.py Lines 170 to 171 in d47fe79 boofuzz/boofuzz/utils/debugger_thread_simple.py Lines 183 to 185 in d47fe79 |
|
Ok so with this PR a process exiting with status 0 won't be logged as a crash anymore, will it. Makes sense to me, but will the process monitor automatically start the target process again for the next test case? |
|
It depends on the logic of the process monitor. |
|
True. Currently the logging and error handling are closely interwoven. As far as I can tell a process exiting with status 0 will not generate an error message so the process monitor won't detect a failure. So far so good, that's how it's supposed to be. |
|
Sorry for the delay, I just ran some tests with and without the changes from this PR. I'm using a target process that immediately exits with code 0. The procmon will then restart the target process as expected. Running the same test with the changes from this PR, I get the same behaviour. A failure is detected and the target gets restarted. The only difference is that the log message is less verbose. It's missing the info about the exit code, which I think is really helpful, even if it is code 0 for success. Was this fix intended to change the procmon behaviour so that an exit with code 0 is no longer picked up as a test case failure by boofuzz? |
|
@SR4ven Sorry for the delay. |
|
Ok, thanks for clearing that up @fouzhe. Correct me if I'm wrong, but from my testing this PR doesn't seem to implement this behaviour. Do you intend to implement the behaviour change? |
A typical use case for boofuzz is to target a persistent server, in which case exiting with 0 may be a failure of sorts, indicating a potential DoS. However, this will depend on the use case. We should probably support exit code 0 as a non-failure, but still requiring a restart. |
The description of
os.waitpidis:The return value of
os.waitpidis a tuple thus theself.exit_statuscan not beNone.