Skip to content

WrongGPU-RR.asi crashes with msvcp140.dll older than 14.40 (constexpr std::mutex, _Mtx_lock null read) #9

Closed

Description

@j0nsh1n

What happened

WrongGPU-RR.asi crashes when the C++ runtime (msvcp140.dll) is older than 14.40:

  • Loaded with OptiScaler's dxgi.dll (plugins/WrongGPU-RR.asi), the game aborts at start: "dxgi.dll" failed to initialize, aborting, c0000005.
  • Loaded late (plugins/WrongGPU-RR-loadlate.asi), the game freezes about 30 s in, right after OptiScaler logs Loaded late.

Both are one fault, a null read at MSVCP140+0x12EB0 inside _Mtx_lock. Backtrace: MSVCP140+0x12EB0 <- WrongGPU-RR.asi+0xE980 <- +0x3255E <- +0x1A0EF (InitializeASI) <- dxgi.dll (OptiScaler).

Cause:

  • The plugin is built with /MD (clean/rr_f/proxy/tools/build.py, CLFLAGS) and linker 14.51.
  • Since VS 2022 17.10, std::mutex is constant-initialised and needs msvcp140.dll 14.40 or newer. The plugin imports _Mtx_lock and _Mtx_unlock but not _Mtx_init_in_situ. OptiScaler's dxgi.dll does import it, and works.
  • Cyberpunk's Proton prefix has msvcp140.dll 14.28.29334. The first lock is probably g_log_mutex in log_line(), from InitializeASI. No wronggpu-rr.log is ever written.
  • The freeze is the game's crash reporter: after the fault on OptiScaler's thread, it suspends every thread for its dump and never resumes them. The game then sits at 0% CPU.

Suggested fix

Add Microsoft's documented switch /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR to CLFLAGS. Alternatively, build the plugin with the static runtime as the other binaries are. A rebuilt plugin should then import _Mtx_init_in_situ. I could not build it, because that needs MSVC.

Confirmed the other way round: after updating the prefix's VC++ runtime to 14.44 (winetricks vcrun2022), the unchanged 0.6.0 plugin loads and runs. Windows players with an old VC++ 2015-2022 redistributable should hit the same crash.

Game and settings

  • Game and version: Cyberpunk 2077 (Steam), current build
  • Upscaler chosen in the game's settings, and its quality mode: DLSS, Quality
  • Resolution, Ray Reconstruction on or off, its mode: 2560x1440, n/a (the crash happens at start)

System

  • WrongGPU version: 0.6.0 (official plugin)
  • GPU and AMD driver version: RX 9070 XT, RADV (Mesa 27.0.0-devel)
  • Windows version: none. Linux (Nobara), GE-Proton 11-11
  • OptiScaler: the WrongGPU edition from the launcher (10.0.0-pre1)

Logs

From Wine (WINEDEBUG=+seh): Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION addr=... info[1]=0 (read of address 0), rax=0. The game's own crash info records the same access violation at 0x0 on OptiScaler's late-load thread.

Activity

  1. added a commit that references this issue on Nov 13, 2026
    6f71930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions