Fix benchexec hangs in container mode if tool cannot be executed
The cause was that some tool-info modules call sys.exit(),
which raises SystemExit, which silently terminates the multiprocessing
worker process instead of being propagated to the caller.
Now we convert this exception into a better one.
@@ -242,4 +242,8 @@ def _call_tool_func(name, args, kwargs):
@param kwargs: Dict of arguments to be passed as keyword arguments.
"""
global tool
+ try:
return getattr(tool, name)(*args, **kwargs)
+ except SystemExit as e:
+ # SystemExit would terminate the worker process instead of being propagated.
+ raise BenchExecException(str(e.code))
