frontend: Cleanup some theme variable handling#13260
Open
Warchamp7 wants to merge 4 commits intoobsproject:masterfrom
Open
frontend: Cleanup some theme variable handling#13260Warchamp7 wants to merge 4 commits intoobsproject:masterfrom
Warchamp7 wants to merge 4 commits intoobsproject:masterfrom
Conversation
If an invalid OBSThemeVariable is passed to this function, then vars[key] ends up initializing a bad value in the vars list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Some adjustments to how theme variables are handled to try and solve a weird crash on startup reported on Discord.
Motivation and Context
A user on Discord reported an issue with 32.0.4 where trying to open OBS simply did nothing. The process would start and then exit before any window was shown.
The various data directories for OBS were being created, but no log file was generated. This suggested the failure was somewhere inside OBSApp::AppInit(). After guiding them through the steps to generate a DMP file using ProcDump, the WinDbg analysis revealed a stack overflow inside
OBSApp_Themes.cppdue to recursive alternating calls betweenEvalMathandParseMathVariable.Looking at the stack frames showed the following
AI Disclosure: An LLM was used to assist with analyzing the DMP file using WinDbg
The invalid
typevalues here led to me looking for ways OBSThemeVariable could be uninitialized or partially initialized.I also cleaned up some other potential pitfalls in the code here, including our recursion guard that was not working correctly in this instance.
How Has This Been Tested?
The same user has tested this build and was able to launch OBS thanks to the fixed recursion check.
I am not sure that whatever bug is causing this issue in the first place has been resolved.
Types of changes
Checklist: