Diagnostics after program crash in tests run from console

We generate some test cases automatically using SwiftCheck and run them on our CI server (in a docker container). Unfortunately, it seems that once in a while, some of the tests can cause a program crash (exit code 4). I suspect this must be something like an integer overflow etc. The problem is that after a crash, Swift has no way to recover and so we get zero diagnostics as to what happened exactly (we don't even know the line that caused the error).

Has anyone ever dealt with a situation like that, and if so, are there are any tricks that could help us here?

(Probably the question could be asked much more generally; after all, a crash could also happen in production somewhere, and in this case we also would have no diagnostics)