Repository navigation
fix(module): define GNU dynamic-module error symbols - #478
Conversation
module-load signals module-open-failed, module-not-gpl-compatible, missing-module-init-function and module-init-failed, but none of these had error-conditions or error-message, so a failed dlopen surfaced as (error "Invalid error symbol" module-open-failed). Register the full syms_of_module set from GNU emacs-module.c, including the module-load-failed parent and the invalid-arity, memory-buffer-too-small and module-out-of-memory conditions.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe standard error registry now includes eight dynamic-module error conditions with defined parent relationships. New tests check their inheritance, condition lists, messages, and formatted error output. ChangesDynamic-module errors
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue is identified in the module-error definitions or tests. The change is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change makes existing module failures catchable under the intended error names without changing module-loading permissions or execution authority. No material new security risk was identified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
|
Why
module-loadsignalsmodule-open-failedand the othermodule-load-failederrors (and the dynamic-module runtime signalsmemory-buffer-too-smallandinvalid-arity), but none of GNU's dynamic-module error symbols haderror-conditionsorerror-message. A faileddlopentherefore surfaced as(error "Invalid error symbol" module-open-failed)instead of a catchablemodule-open-failed, and handlers formodule-load-failednever matched. The MELPA parity notes already record this symptom (Invalid error symbol: module-open-failedin theclosql/sqlite3-apicase).Change
Register the complete
syms_of_moduleset from GNUsrc/emacs-module.c, with GNU's condition lists and messages, in both the obarray error table andErrorRegistry:module-out-of-memoryerrormodule-load-failederrormodule-open-failedmodule-load-failed errormodule-not-gpl-compatiblemodule-load-failed errormissing-module-init-functionmodule-load-failed errormodule-init-failedmodule-load-failed errorinvalid-arityerrormemory-buffer-too-smallerrorNo module-loading behaviour changes; only the error symbols' properties are defined.
Verification
New tests in
neovm-core(runtime/errors/tests/mod.rs, Nextest namesemacs_core::errors::tests::*):registry_module_load_failed_familychecks theErrorRegistryhierarchy.module_error_symbols_match_gnu_emacs_module_cevaluates in the bootstrap evaluator:module-loadof a missing file is caught by amodule-load-failedhandler asmodule-open-failed; each symbol'serror-conditions/error-messageequals GNU's; anderror-message-stringformats amodule-open-failederror.Both fail on the base commit and pass with this change. Focused Linux run with Nextest:
cargo nextest run -p neovm-core --lib -E 'test(~emacs_core::errors::) | test(~dynamic_module) | test(~module_load) | test(~module_open)'102 tests run, 102 passed (the existing error-table and dynamic-module tests plus the two new ones).
cargo fmt --check -p neovm-corepasses. This is a focused selection, not a full-workspace or hosted-CI result.Assistance
This PR is agent-assisted.