sophia: add deadlock detection procedure and tests