Skip to content

Fix xcpt4 source decompilation with explicit unresolved SEH state - #969

Merged
gmh5225 merged 5 commits into
devfrom
codex/issue858-wine-source
Oct 14, 2026
Merged

gmh5225 merged 5 commits into
devfrom
codex/issue858-wine-source

Conversation

@gmh5225

@gmh5225 gmh5225 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

The x64 MSVC xcpt4 fixture in #858 aborted source decompilation when an unproved _local_unwind continuation remained an independent machine entry. Preserve its decoded source body by carrying unknown entry register/stack values instead of asserting an entry-relative invocation frame. The original eleven-case analysis matrix now passes, and sub_140001500 retains its guarded SEH/GS body with 114 structured regions, zero fallback regions and an explicit unresolved-frame annotation.

LowIR still validates unwind/prologue consistency, protected-range SP stability and every resolved switch target. Only published ordinary entries may introduce source-only unknown state; an unrelated disconnected protected path still refuses. The x86 MedIR helper seeds those entries and keeps a shared handler’s ordinary and exceptional SP inputs separate. Patch/lift conversion retains strict frame checks, and direct LLVM emission rejects unresolved source frames. This change does not add saved-memory authority across opaque calls or complete native xcpt4 reconstruction.

Add a reusable local Wine/source acceptance script and run it with the full analysis matrix in the focused Windows EH CI lane. It records original executable observations separately from source analysis, checks every runtime result even after exit zero, and allows only the fixture’s compile-time-disabled x64 alignment test 29 to skip. No submodule revisions change.

Validation on 942033df3ff9fd924855ae54b5142d2c6cd5d520, integrated with dev, using the Release/r4 profile with CPU/driver emulation and semantic tests disabled:

  • NeverDLiftTests: 7,143 cases; 7,102 pass, 41 platform/toolchain skips, zero failures (400 seconds). The skips include Apple-only Mach-O/Objective-C execution, unavailable Swift/cross-compilers and optional external parity inputs.
  • NeverDMedEntryFrameTests: 41 pass, including independent/shared entries, unresolved LLVM rejection, malformed unwind/SP controls, complete switch targets and unlisted disconnected roots.
  • NeverDSEHRuntimeMemoryTests: 33 pass, including opaque-call and saved-frame-slot overwrite refusals.
  • NeverDWindowsEHCorpusTests --gtest_filter=WindowsEHModesCorpus.*: all five tests pass, including the original eleven-case matrix and the optimized FH3/registration recursion regressions.
  • check_windows_xcpt4_source.py: local Wine 10 original execution exits 0, with 89 successes and only test 29 skipped; the original full-image source CLI succeeds. Default optimized source output also passes its body/annotation checks, while the LLVM CLI still refuses the unresolved frame.
  • Python acceptance/CI configuration tests: 28 pass. Changed C++ files pass LLVM clang-format 22; git diff --check and the documentation translation check pass.

The complete PE32 application probes have a separate 240-second child limit within their existing 300-second CTest deadline. A single-CPU, single-worker run of the large optimized PE32 xcpt4 succeeded in 123.6 seconds, exceeding the previous 120-second small-probe limit. All five mode tests then passed in 129.4 seconds under that isolated configuration. Static work budgets and output checks are unchanged.

The production code tested above is unchanged in final head dd9fa81ce143e39f06e50e3f70f4b899b7259ffd; its final delta adjusts only the test timeout and documentation. Focused Windows EH/Wine CI is queued on this head. The code changes have complete local validation and the previous CI passed the x64 source acceptance and focused IR/PE checks; the final change is limited to the locally verified subprocess allowance and documentation. The previous run passed the x64 eleven-case matrix and all 597 focused IR/PE checks, then hit the PE32 subprocess time limit.

Follow-up: the focused CI completed all 597 IR/PE checks and all nine corpus checks, then exposed a missing Wine64 package in the new PE64 observation step. PR #970 installs that dependency and is merged to dev. The focused rerun passed, including the original PE64 Wine execution and source acceptance.

@gmh5225
gmh5225 merged commit 0bc843a into dev Oct 14, 2026
13 of 24 checks passed
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.

2 participants