You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No backtrace symbols on MacOS w/ Apple Silicon #577
$ uname -a
Darwin Ramos-M1 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
As expected, this produces a binary that appears to contain debug symbols:
$ file ../../target/lambda/bootstrap/bootstrap
../../target/lambda/bootstrap/bootstrap: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 2.0.0, with debug_info, not stripped
However, all of the backtraces I generate via the backtrace crate look like:
thread 'main' panicked at 'not yet implemented', src/lib.rs:173:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I'm not sure if it's related, but when I build with --release, catch_unwind doesn't even catch the panics. They unwind past the catch and terminate the program. It's unclear if the issue described above is just an issue of missing debug symbols, or something deeper related to stack unwinding. Panics are caught in debug mode, however.
Interestingly, everything works fine when I directly build the Lambda via the Homebrew musl-cross toolchain:
Oh, I should note that I'm invoking the Lambda using sam local start-api from the AWS SAM CLI, though I don't think any differences between the two Docker images should matter here.
I'm not sure if it's related, but when I build with --release, catch_unwind doesn't even catch the panics. They unwind past the catch and terminate the program.
Activity
ramosbugs commentedon Dec 13, 2023
Oh, I should note that I'm invoking the Lambda using
sam local start-apifrom the AWS SAM CLI, though I don't think any differences between the two Docker images should matter here.calavera commentedon Dec 13, 2023
This is because the linker that Cargo Lambda uses by default is probably not keeping that information. See https://www.cargo-lambda.info/guide/cross-compiling.html
this is expected. See https://www.cargo-lambda.info/guide/release-optimizations.html#panic-behavior
ramosbugs commentedon Dec 13, 2023
Would https://github.com/rust-cross/cargo-zigbuild be the appropriate project to open a bug for this behavior, or is the linker part of another component?
I missed that in the docs, thanks! 🙏
calavera commentedon Dec 14, 2023
Yes, cargo-zigbuild is the right place to have a more detailed conversation about that.
ramosbugs commentedon Dec 14, 2023
Thanks, I opened an issue there.