If your copy of xvfb-run is the same as mine, I can confirm I've seen this too.
In my case, the target process caused Xvfb to crash. This means that the wrapper script itself fails at line 171 when tearing down no longer running Xvfb. To work around it I wrapped kill $XVFBPID
in a set +e
/set -e
block. It also helps if you specify --error-file=
so that xvfb-run saves the asynchronous standard error output from Xvfb while your target process is running, so you can get the underlying cause fixed.
Work around:
# Kill Xvfb now that the command has exited.
# Ignore failure of kill since we want to be forgiving of Xvfb itself crashing
set +e
kill $XVFBPID
set -e