Repository navigation
Fix VM's infinite recursion crash with musl libc - #7558
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughNative C stack checking in the VM was disabled for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/vm/src/vm/mod.rs`:
- Around line 1502-1514: The musl build causes clippy dead_code warnings because
calculate_c_stack_soft_limit, STACK_MARGIN_BYTES and get_stack_bounds become
unreachable; add conditional dead_code allowances for musl by applying cfg_attr
to those symbols (e.g. use #[cfg_attr(any(miri, target_env = "musl"),
allow(dead_code))] on calculate_c_stack_soft_limit, STACK_MARGIN_BYTES, and the
get_stack_bounds function or their containing items) so the allow is active for
musl/miri builds but not for other targets.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 2ad92253-8416-4402-b0d8-0d69eaf571e8
📒 Files selected for processing (1)
crates/vm/src/vm/mod.rs
* Fix VM's infinite recursion crash with musl libc * Lintfix/cleanup warnings
* Fix VM's infinite recursion crash with musl libc * Lintfix/cleanup warnings
Hi!
This fixes a musl-only false-positive
RecursionErrorduring RustPythonfrozen-stdlibbootstrap.I was hitting this while building RustPython-powered part where it must be statically built with musl libc. This is an example:
Built for
x86_64-unknown-linux-musl, that happily crashes during frozen stdlib init with:This error renders the whole VM incapable to run anything from the frozen library.
The problem comes from native C-stack guard in
vm/mod.rs, specificallycheck_c_stack_overflow()function. I opted to the less invasive fix, which just makes the native C-stack probe a no-op ontarget_env = "musl"but leaves the regular Python recursion-depth limit in place.Summary by CodeRabbit