Automatic breaking of programs using improper global semaphore protection