[PATCH] Fix crash on Linux if sem_wait() is interrupted

Fix a crash where if sem_wait is interrupted then ProcessMonitor::ServeOperation() will crash accessing an invalid monitor->m_operation pointer. The fix is taken from how this same case is already handled in the ProcessMonitor constructor.

Thanks,

Andrew

sem_wait.EINTR.Linux.patch (1.04 KB)

Can we get rid of the "goto" statement and make it a "while(1)" or "for(;;)" like the first part of the fix?

Hi Greg, I’ve removed the goto from the patch but left it in the places where it already existed in the ProcessMonitor, let me know if you would like those updated too.

Cheers,
Andrew

sem_wait.EINTR.Linux-2.patch (1.02 KB)

Patch looks good. No worries on the other goto statements.

Greg

Thanks! I don’t have commit access so if someone else could commit it that would be great.

Andrew

I’ll put it in. I’ll build and run tests on my end first.

Thanks,
Todd

Submitted:

Sending source/Plugins/Process/Linux/ProcessMonitor.cpp
Transmitting file data .
Committed revision 200049.

Thanks for the patch, Andrew!