refactor(vmm): improve crash diagnostics and kernel cmdline handling#227
refactor(vmm): improve crash diagnostics and kernel cmdline handling#227DorianZheng merged 1 commit intomainfrom
Conversation
5914b5f to
781453f
Compare
- Add ExitInfo enum (vmm/exit_info.rs) for JSON crash data transfer between shim and library (signal/panic variants with serde) - Add CrashReport struct (litebox/crash_report.rs) for user-friendly error message formatting with context-aware troubleshooting hints - Refactor shim.rs to shim/main.rs + crash_capture.rs directory structure - Extract CrashCapture to handle panic hooks and signal handlers - Fix LIBKRUN_CMDLINE_FIXED_OVERHEAD constant (300 bytes) - Move is_printable_ascii to util module - Update guest_connect to use CrashReport for crash detection Improves crash diagnostics by separating data (ExitInfo) from presentation (CrashReport), enabling better error messages when VM startup fails.
781453f to
83adaa3
Compare
|
@shayne-snap @uran0sH Can you take a look? |
|
Sorry for the late reply. I tested the main branch on my laptop, I saw
|
Hi @shayne-snap. Please open
Check if there is any new generated result |
|
Feel free to let me know if you need more info. |
|
Hi @shayne-snap. The command you showed above works on my side Please
and paste the output and
|
|
|
|
Hi @shayne-snap. Does the node example #222 (comment) failed to start with the latest code too |
|
After running There's NO new generated result(Crash Reports and Diagnostic Reports) in Console App. |
Hi @shayne-snap. So sorry for the inconvenience, please run another test The current error message is still not good for diagnosing issues. I will keep on improving it |
|
After running these commands the output is down below: |
Hi @shayne-snap. I have spent some time optimizing the error message a little bit #240. Can you update to the latest code and try above command again |
|
Hi. Sorry for the late reply. It took a while to redownload everything(I have to use VPN). I updated to the latest code, and ran the commands to remove the old stuff. Here's the output down below:
|
Got it. Let me check |
Actually, Most developers and me dont need to pass the whole |
@shayne-snap Would you mind using a binary search approach to isolate which environment introduced this issue? |
|
@DorianZheng Given that this pull request have already fixed the env vars number is too big issue and the solution works both for you and @uran0sH . It's a low priority task. We can fix it later. I'll try to explore the root cause on my computer and ask for help when I need. How about that? |
Sounds perfect! Thanks again for all the testing. Ping me in the future whenever you find anything 🥰 |




Summary
ExitInfoenum for JSON crash data transfer between shim and libraryCrashReportstruct for user-friendly error message formattingGuestEntrypointBuilderfor managing env vars within kernel cmdline limitsshim.rstoshim/main.rs+crash_capture.rsdirectory structureLIBKRUN_CMDLINE_FIXED_OVERHEADconstant (300 bytes)Architecture
Crash Diagnostics:
ExitInfo(vmm layer): Pure data structure for JSON serialization - shim writes, library readsCrashReport(litebox layer): Presentation/formatting for user-friendly error messagesKernel Cmdline:
GuestEntrypointBuilder: Manages env vars with FILO semantics within arch-specific limits (2KB ARM64, 64KB x86_64)Files Changed
vmm/exit_info.rslitebox/crash_report.rsbin/shim/crash_capture.rsinit/tasks/guest_entrypoint.rsTest plan
cargo test -p boxlite --lib -- vmm::exit_info(5 tests)cargo test -p boxlite --lib -- litebox::crash_report(4 tests)cargo clippy -p boxlite --lib(no warnings)cargo fmt --check(clean)