fix(vmm): resolve musl CRT mismatch crash and improve startup diagnostics#372
Merged
DorianZheng merged 2 commits intomainfrom Mar 12, 2026
Merged
Conversation
…tics On Linux, the project .cargo/config.toml specified `linker = "x86_64-linux-musl-gcc"` which forced Ubuntu's system musl CRT objects (v1.2.2), creating an ABI mismatch with Rust's bundled musl CRT. This caused the guest binary to crash at startup with exit code 0 and no output. Changes: - Remove linker directives from project .cargo/config.toml so Linux uses Rust's self-contained musl linking (macOS still needs musl-cross, configured per-user) - Add setup_musl_linker() to setup-macos.sh for per-user ~/.cargo/config.toml - Add macOS linker env var fallback in build-guest.sh - Add guest_check.rs: ELF pre-flight validation (arch, static linking) before injecting guest binary into rootfs ext4 image - Enhance crash_report.rs: exit-code-0 interpretation, console.log analysis (empty/kernel-only/guest-output), actionable diagnostic commands - Fix latent bug: create logs_dir in box filesystem layout - Promote console output log from debug to info in krun engine Tested on Linux (boxlite-dev GCE): `boxlite run alpine:latest -- echo hello` → hello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
linker = "x86_64-linux-musl-gcc"from project.cargo/config.toml— Ubuntu's system musl CRT (v1.2.2) was ABI-incompatible with Rust's bundled musl CRT, causing the guest binary to crash at startup with exit code 0 and no outputguest_check.rsvalidates guest binary architecture and static linking before ext4 injection, catching mismatches early with clear error messages~/.cargo/config.toml(viasetup-macos.sh) and added env var fallback inbuild-guest.shTest plan
cargo test -p boxlite --lib -- guest_check(8 tests pass)cargo test -p boxlite --lib -- crash_report(all tests pass)cargo clippy -p boxlite --tests -- -D warnings(clean)cargo fmt --check(clean)boxlite run alpine:latest -- echo hello→hello(boxlite-dev GCE)