Skip to content

pipeline_workers: keep the rethrown error alive for Wine 11.0's rethrow_exception; pipeline_workers passes under Wine - #2374

Draft
Tauwni wants to merge 2 commits into
ProjectLeonida:mainfrom
Tauwni:fix/pipeline-workers-rethrow-wine
Draft

Tauwni wants to merge 2 commits into
ProjectLeonida:mainfrom
Tauwni:fix/pipeline-workers-rethrow-wine

Conversation

@Tauwni

@Tauwni Tauwni commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Under Wine 11.0, pipeline_workers fails every round of its exceptions() case ("run() rethrew no exception, or not the lowest job's"). On native Windows and macOS it passes.

PipelineWorkers::run() (runtime/src/pipeline_workers.h) keeps the lowest job's error in the exception_ptr of a Batch on its own stack and ends with std::rethrow_exception(batch.error). Wine 11.0's rethrow_exception throws the stored object itself, not a copy. So the unwinding out of run() destroys batch, frees that object while it is still in flight, and the caller's catch (const std::runtime_error&) never sees it. #1086 found the same Wine behaviour in gta6rt's DllMain failure path and keeps a copy there.

Here the error type is whatever a job throws, so a copy of a known type doesn't fit. Instead, a thread_local std::exception_ptr takes the error just before the rethrow and keeps the object alive until that thread's next error. Nothing else changes: the lowest-index rule, the stop and the inline path for one job stay as they are.

Tested on an Apple M3 (macOS 26.5.1) at main fbf100b1b:

pipeline_workers the 18 tests matching pipeline
Wine 11.0 (WineHQ macOS build, x86-64 under Rosetta), clang-cl/lld-link 23.1.6 cross build, xwin SDK 10.0.26100 FAIL on main; PASS with this, 3 runs out of 3 16 pass; vk_pipeline_check_cli (a timeout) and pipeline_cache_seed fail with and without this change
native macOS, Apple clang 17 PASS (as on main) 10/10 pass, no new warnings

d3d12_pipeline_workers, d3d12_pipeline_workers_eager and replay_pipeline_compiles*, which run through PipelineWorkers, pass under Wine with this change.

AI-assisted (Claude Code). No game data.

🤖 Generated with Claude Code

… Wine 11.0's rethrow_exception

Wine 11.0's rethrow_exception throws the stored object itself, not a copy.
run() rethrew batch.error, the exception_ptr of a local Batch, which the
unwinding then freed, so the caller caught no runtime_error. A thread_local
exception_ptr now holds the object until the thread's next error. Same Wine
bug as gta6rt's DllMain failure (ubiquitarianism#1086).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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