AWS Lambda runtime crash stack traces

Hi everyone,

I'm using the Swift AWS Lambda runtime, and I can't seem to find out how to access the stack trace / details of a crash when my code crashes.

I've filled an issue on the Github repository, however I'm not sure if it is an issue from the SDK, or if I'm missunderstanding something regarding stacktraces on non-darwin architectures, especially since from what I understood, it changed with Swift 5.9, so I'm asking it here as well.

I also understood that the app's lifecycle is entirely managed by the SDK (source), so I'm assuming this might be the reason as well.

Any help or guidance is much appreciated :slight_smile:


I did not read the full thing to be honest, but I noticed "illegal instruction" in the github issue so I'd start by asking:

Is it possible you are deploying an ARM version of the binary to an x64 lambda?

The CPU architectures of the lambda configuration and the swift binary must match.

Hi Simon,

Thanks for replying.

The architecture do match, and the lambda is working fine most of the time.

However, I do have a race condition or logic error that makes it crash from time to time, and I can’t get any information or stack trace on the AWS console (other than the illegal instruction message).

Since I can’t reproduce locally, it is a pain to debug, and I’m trying to figure out if there is any way to get the stack trace of the crash.

Thanks for your time!