obsproject / obsproject/obs-studio
Captured Game Crashes to Desktop When Switching Scenes
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 76.4k
- Forks
- 10.2k
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 12
Description
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
30.2.0
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/n1G7SlTcgGtXC7pW
OBS Studio Crash Log URL
No response
Expected Behavior
The captured game should continue running and be captured by OBS without crashing when switching scenes.
Current Behavior
Upon switching scenes in OBS Studio, the captured game (Half-Life 1) crashes to the desktop without any error message. This crash occurs consistently when switching back to a scene containing the Game Capture source for Half-Life 1. The Windows debugger indicates that the crash is caused by an unhandled exception in graphics_hook32.dll, where the DLL attempts to read from a null pointer, resulting in an access violation (c0000005) error. This issue is only present in OBS version 30.2.0 and does not occur in version 30.1.2 under identical conditions.
Steps to Reproduce
- Launch OBS Studio (version 30.2.0).
- Add a "Game Capture" source to capture Half-Life 1 (hl.exe) window.
- Create a new scene, switch to it and then switch back to the scene containing the "Game Capture" source.
- Observe that the game crashes to the desktop.
Anything else we should know?
- The issue is not reproducible on another device with the same OS and antivirus.
- The crash sometimes occurs when switching to a new scene, not just when switching back.
- The issue persists when running as Administrator and using an admin user.
- The issue persists even when running OBS in "Safe Mode", using a new profile and scene collection, and when trying with a newly downloaded portable version of OBS.
- Windbg (Windows Debugger) points to graphics_hook32.dll attempting to read from a null pointer, leading to an access violation (c0000005).
WinDbg Output
Starting from Scene 2 with no sources, switching to Scene 1 with a game capture source:
ModLoad: 59340000 5937c000 C:\ProgramData\obs-studio-hook\graphics-hook32.dll
[OBS] graphics-hook.dll loaded against process: hl.exe
[OBS] (half life scientist) everything.. seems to be in order
[OBS] Hooked ID3D12CommandQueue::ExecuteCommandLists
[OBS] Hooked D3D12
[OBS] Hooked IDXGISwapChain::Present
[OBS] Hooked IDXGISwapChain::ResizeBuffers
[OBS] Hooked IDXGISwapChain1::Present1
[OBS] Hooked DXGI
[OBS] Hooked SwapBuffers
[OBS] Hooked wglDeleteContext
[OBS] Hooked wglSwapLayerBuffers
[OBS] Hooked wglSwapBuffers
[OBS] Hooked GL
[OBS] Shared-texture OpenGL capture available
[OBS] gl shared texture capture successful
[OBS] Remembering D3D12 queue from present: queue=0x192806B0
Switching from Scene 1 to Scene 2:
[OBS] ------------------ gl capture freed ------------------
[OBS] Found D3D12 device on swap chain: swap=0x19286B30, device=0x168993C0
[OBS] queue=0x192806B0
Switching from Scene 2 to Scene 1 [crashed here]:
[OBS] gl shared texture capture successful
(59bc.3720): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=192c0050 ecx=1769cb84 edx=00000004 esi=00000000 edi=00000000
eip=59342916 esp=1769cb70 ebp=1769cbc8 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
graphics_hook32+0x2916:
59342916 8b06 mov eax,dword ptr [esi] ds:002b:00000000=????????
0:014> !analyze -v
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************
KEY_VALUES_STRING: 1
Key : AV.Dereference
Value: NullPtr
Key : AV.Fault
Value: Read
Key : Analysis.CPU.mSec
Value: 1281
Key : Analysis.Elapsed.mSec
Value: 2567
Key : Analysis.IO.Other.Mb
Value: 0
Key : Analysis.IO.Read.Mb
Value: 1
Key : Analysis.IO.Write.Mb
Value: 0
Key : Analysis.Init.CPU.mSec
Value: 2686
Key : Analysis.Init.Elapsed.mSec
Value: 292290
Key : Analysis.Memory.CommitPeak.Mb
Value: 69
Key : Failure.Bucket
Value: NULL_POINTER_READ_c0000005_graphics-hook32.dll!Unknown
Key : Failure.Hash
Value: {d53de7bf-e052-2ed0-0beb-e165392ff9b2}
Key : Timeline.OS.Boot.DeltaSec
Value: 7970
Key : Timeline.Process.Start.DeltaSec
Value: 122
Key : WER.OS.Branch
Value: ni_release
Key : WER.OS.Version
Value: 10.0.22621.1
Key : WER.Process.Version
Value: 1.1.1.1
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
EXCEPTION_RECORD: (.exr -1)
ExceptionAddress: 59342916 (graphics_hook32+0x00002916)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 00000000
Attempt to read from address 00000000
FAULTING_THREAD: 00003720
PROCESS_NAME: hl.exe
READ_ADDRESS: 00000000
ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.
EXCEPTION_CODE_STR: c0000005
EXCEPTION_PARAMETER1: 00000000
EXCEPTION_PARAMETER2: 00000000
STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
1769cbc8 59344f7e 19286b30 192c0050 1769cd54 graphics_hook32+0x2916
1769cbe8 634f86e9 01286b30 00000000 00000200 graphics_hook32+0x4f7e
1769ccd8 634f9d01 634f9cb5 169aa420 634f9d01 atioglxx!DrvSetCallbackProcs+0x195e79
1769cd24 634a2c37 1769cd54 16a928c8 00000000 atioglxx!DrvSetCallbackProcs+0x197491
1769cd80 632f1ec7 16a928c8 45432892 411cbcc0 atioglxx!DrvSetCallbackProcs+0x1403c7
1769f950 632ef53c 193aeb18 632ef53c 411cbcc0 atioglxx!DllMain+0x8c6d97
1769f9a4 632f472d 07de65b8 45432806 632f4700 atioglxx!DllMain+0x8c440c
1769f9c4 63786161 16a6b888 4543283e 63786109 atioglxx!DllMain+0x8c95fd
1769f9fc 77487ba9 166a9e08 77487b90 1769fa64 atioglxx!eglGetProcAddress+0x7ac61
1769fa0c 7784c10b 166a9e08 8c3bec87 00000000 KERNEL32!BaseThreadInitThunk+0x19
1769fa64 7784c08f ffffffff 77879e5a 00000000 ntdll!__RtlUserThreadStart+0x2b
1769fa74 00000000 63786109 166a9e08 00000000 ntdll!_RtlUserThreadStart+0x1b
SYMBOL_NAME: graphics_hook32+2916
MODULE_NAME: graphics_hook32
IMAGE_NAME: graphics-hook32.dll
STACK_COMMAND: ~14s ; .cxr ; kb
FAILURE_BUCKET_ID: NULL_POINTER_READ_c0000005_graphics-hook32.dll!Unknown
OS_VERSION: 10.0.22621.1
BUILDLAB_STR: ni_release
OSPLATFORM_TYPE: x86
OSNAME: Windows 10
IMAGE_VERSION: 1.8.3.0
FAILURE_ID_HASH: {d53de7bf-e052-2ed0-0beb-e165392ff9b2}
Followup: MachineOwner
---------
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the scene-switching crash with OBS 30.2.0, Half-Life 1, and the Game Capture source, then compare the behavior with OBS 30.1.2. Inspect the graphics_hook32.dll failure at offset 0x2916 using the supplied WinDbg output. Done means switching scenes no longer crashes hl.exe and capture continues normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- computer-graphics, desktop, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100