When codestyle.py outputs too slowly (or unexpectedly), restart it instead of crashing.
When the codestyle.py
is too slow in outputting data, the
processOutputStarted
function might miss them, release the
m_mutex
lock and set m_stylechecker
to nullptr.
When the data then later arrives, processOutputStarted is called
again, however without m_mutex
being held and m_stylechecker
no longer valid. This eventually leads to a crash when dereferencing
m_stylechecker
.
The current commit tries to fix this by checking that m_mutex
is
held at the start of processOutputStarted
. If it is not, then we are
in the "late data case". However, in this situation, we do not know
the amount of data that should still arrive and basically the only
way to solve the situation, is to kill the server (and start it again
on the next run). So that is what we do.