I am using QProcess for controlling a background worker process. Recently I noticed that the state() return value is set to Running even when the worker didn't start properly. It is correctly set to NotRunning when the executable cannot be found or cannot be started due to permission problems. However, the executable is linked to some shared libraries, and when they were missing, the executable didn't start properly, but QProcess::state() still returned Running, pid() still returns a nonzero PID and so on.

Now I wonder, how can I catch cases like the aforementioned one to avoid false positives?