Daniel's fixes are probably correct, but we haven't gotten around to looking into it. We don't usually see these failures, but that could be a timing issue, or it could be that -fexceptions -fasynchronous-unwind-tables is in our compiler options in our build system and so masks the issue.