Skip to content

fix: handle NULL method in LMF during WASM exception unwinding#156

Merged
jeromelaban merged 1 commit intomainfrom
dev/jela/lmf-nested
Apr 10, 2026
Merged

fix: handle NULL method in LMF during WASM exception unwinding#156
jeromelaban merged 1 commit intomainfrom
dev/jela/lmf-nested

Conversation

@jeromelaban
Copy link
Copy Markdown
Member

When hot reload applies metadata deltas across multiple generations, the LMF (Last Managed Frame) chain can contain entries with NULL method pointers — caused by partially initialized JIT frames during skeleton type creation or ALC unloading.
WASM is the only architecture that hard-asserts on (*lmf)->method (exceptions-wasm.c:66). x86 returns FALSE gracefully; AMD64/ARM64 don't depend on the method field at all.

  • Add patch 0005 to Uno.DotnetRuntime.WebAssembly: skip NULL method LMF entries and return FALSE, matching x86 behavior
  • Add WASM runtime test exercising multi-generation hot reload via MetadataUpdater.ApplyUpdate with Roslyn EmitDifference deltas

When hot reload applies metadata deltas across multiple generations, the LMF (Last Managed Frame) chain can contain entries with NULL method pointers — caused by partially initialized JIT frames during skeleton type creation or ALC unloading.
                                                                                                                                                                                                                                       WASM is the only architecture that hard-asserts on (*lmf)->method (exceptions-wasm.c:66). x86 returns FALSE gracefully; AMD64/ARM64 don't depend on the method field at all.
- Add patch 0005 to Uno.DotnetRuntime.WebAssembly: skip NULL method LMF entries and return FALSE, matching x86 behavior
- Add WASM runtime test exercising multi-generation hot reload via MetadataUpdater.ApplyUpdate with Roslyn EmitDifference deltas
@jeromelaban jeromelaban merged commit ec9a1dd into main Apr 10, 2026
12 checks passed
@jeromelaban jeromelaban deleted the dev/jela/lmf-nested branch April 10, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant