drcachesim gets into permanently non working state, leaves subprocess hanging
Reported on x86 with build from source. When drcachesim is abruptly terminated (e.g. broken out of), it can leave the environment in a state where subsequent runs of drcachesim will always fail, with the messages "failed to read from trace", "ERROR: failed to run analyzer".
Looking at strace, it's doing mknod("/tmp/drcachesimpipe"...) and failing with EEXIST. It does this immediately after clone() and leaves the subprocess still existing and suspended.
This could be broken into several subproblems:
- the original failure to clean up after abrupt termination
- the inability to recover from this state when next launched
- the error messages texts are sketchy and not clearly identified as coming from DR
- even after deliberate error termination, it leaves the subprocess existing