Lords2 installer memory failure
Task: NEW-GAME-LORDS2-DEMO-20261015. Evidence: scratch/runs/20261107-lords2-install-memory/. Follows the PIT calibration repair. The causal investigation used retained evidence. Aranna released shared runtime/source/build at 01:45:13Z; its processes, ports, profiles and all four locks were independently checked before runtime work.
The preceding original's first-remaining-blocker.json.gz establishes more than the final dialog. Child selector 0047 is the runtime's original segment 1, base 00170000. Segment 0057:4024 initializes a 64,000-byte buffer size and calls 0047:1D13 with that size. The C-runtime allocator searches existing blocks, attempts growth, and finally attempts a new arena. The new-arena routine at 1FB8 computes (request + 0x1019) & 0xF000 in 16 bits. For 64,000 this wraps to zero, representing a whole 64 KiB block. At 1FCF it tests BX bit 0x10; the unique captured context has low BX=00D4, CX=DX=0. The branch takes 2035, which returns carry set without calling GlobalAlloc. The allocator's failure handler ultimately selects message resource F10A, then USER.1 displays the retained insufficient-memory text. This is a guest policy decision made before the candidate allocation reaches the emulator's allocator.
BX comes from MOV BX,CS:[0010]. The retained original child recovered from a prior ordinary setup has SHA-256 7dbf696d4f08464ca1e187686368fe89c5b71b3162c094f463d0e5ec4eaca567, 528,080 bytes, at scratch/runs/20261105-lords2-recovered-original-gameplay/generated-setup.exe. Its original segment-1 relocation at offset 0010 is address type 5 (OFFSET), import ordinal, module KERNEL, ordinal 178. This is __WINFLAGS, an absolute export, rather than a callable entry point. The retained malloc code matches this interpretation: bit 0 controls the protected-mode API path and bit 0x10 the standard-mode allocation restriction. The runtime value 00D4 is a thunk offset substituted by our ordinary import resolution. It is neither an observed allocation failure nor evidence that available physical memory is too small.
Wine's KERNEL export specification declares ordinal 178 as an equate. Its KERNEL initialization sets that entry point from GetWinFlags16. Our current absolute-import resolver handles __AHSHIFT and __AHINCR but not __WINFLAGS; its OFFSET relocation therefore writes an allocated thunk offset. The repair adds ordinal 178 to that existing constant-resolution path, using a shared helper for the existing GetWinFlags expression. It changes no machine-result value, timer/calibration output, guest configuration, media or installer check. The guest continues to execute its own policy with the correctly represented export.
retained-causal-analysis.json identifies and hashes the retained snapshot and child image and preserves the relevant block contexts and relocation record. Disassembly excerpts are diagnostic evidence only and are not part of the source change. The generated test/test-win16-winflags-import.js regression fails against both retained PIT modules: zero unrelated imports yields __WINFLAGS=0, while five yield 0x14 and the generated consumer rejects the whole-segment request before GlobalAlloc. All consumers finish with balanced stacks. Thus the failure is reproducible without guest media and depends on thunk ordering.
After the repair, the regression passes on both newly built standard and compatibility modules for existing Windows 3.1 and Windows 4 configurations. It checks chained, additive and LOBYTE relocations, unchanged __AHSHIFT/__AHINCR, equality with the existing callable GetWinFlags result, and actual GlobalAlloc/GlobalSize/GlobalLock/GlobalUnlock/GlobalFree calls with a writable end-of-request address. Existing NE-loader, huge-pointer-import, arena-bounds and GlobalSize/GetUpdateRgn tests pass on the standard module (their paths are hardcoded). The locked full build passes. The changed read-only observer's generated INT/API/near-helper controls pass on both modules, including saturated bounds and armed/disabled full 512 MiB memory and CPU equality. Exact results and tested module identities are in focused-tests.json and tested-modules.json.
The one improved original ran locally from 01:48:01Z to normal cleanup at 01:51:01Z, using published repair f832a18a625ab5bc8460f00fbc19c18f10b504cd. Its executing standard module was SHA-256 762e723515df6ce8c197fd0d23e0b84869657b0b49e673ad4ac2c48f78b8991f (2,181,062 bytes); the tested compatibility module was d8985b213cdd865a24015b37a191086d88511d858c4f58006ab148dab759d7a3 (2,183,708 bytes). All 181 original files and the browser manifest matched their inventories before and after. Actual HTTP responses matched 203 local bodies, with two reconstructed normal dev-server HTML injections and eight retained absent build-info/CARDS probes. Both instantiated emulator instances reported the tested standard module identity.
I personally reviewed the startup and six successive installer screens. Six acknowledged ordinary canvas clicks used the harness's balanced down/wait/up implementation; the last native Yes delivered its observed down/up pair. CPU calibration completed, the installer retained its reported memory and machine values, and its offered Yes continuation was selected. The child now reads CS:[0010]=4429 at the same 0047:1FCF policy block. GlobalAlloc receives flags=2, size=65536 and returns handle 013F, with the expected ten-byte Pascal-frame delta. The original insufficient-memory path is no longer taken. This demonstrates internal installation progress beyond the repaired allocator; it does not establish a completed installation or visible gameplay.
The precise next blocker is an unimplemented KERNEL.92 GetTempDrive(0). Original selector 0057:4E9C pushes zero, 4E9E calls thunk 001F:00DC, with return address 0057:4EA3. The observer's final pending key is 0001005C, argument zero, with no matching return; the child traps at linear EIP 00194E9C, ESP 001F8938. The Wasm crash's internal function 12032 is the implementation called by exported win16_dispatch's guarded wrapper 12064; it ends in the existing unimplemented-ordinal fail-fast path. The local ordinal catalog identifies 92 as GETTEMPDRIVE and the KERNEL dispatcher has no handler. original-causal-result.json, trap-export-index.json, the losslessly compressed after-continue.json.gz and console crash record preserve this evidence. No second original or additional API repair was attempted.
The seven queue acknowledgments include the final ordinary quit, with no unknown/partial input or replay. Probe and Chrome exited zero, and the supervisor terminated its own development server. Independent cleanup verified all four owned PIDs, ports 36929/39865, the owned Chrome profile and its descendants absent, and all four locks free. Runtime/source/build ownership was released at 01:51:31Z. No boat, deployment, guest/media/configuration edit, machine-result adjustment, source archive or automated risk flag occurred. Next work is a documented-semantics investigation and generated regression for GetTempDrive, followed by a separately authorized improved original; installation completion and player movement remain unverified.