When a process using ROOT gets a SIGPIPE, it enters an infinite loop if the SIGPIPE is both on stdout and stderr (e.g. for a redirection).
This one liner (sh) exposes the problem:
The process get stuck trying to handle the SIGPIPE it gets while handling the SIGPIPE...
My suggestion would be to either ignore SIGPIPE or to mask a signal while handling it.