You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Websocket API crash and settings corruption when calling GetCurrentProgramScene while current scene is unset #10532
API should be returning a non-fatal error, and no settings corruption should occur.
Current Behavior
When calling GetCurrentProgramScene via the Websocket API while current scene is unset, a fatal crash occurs.
Then further crashes occur on OBS startup until the %APPDATA%/basic settings directory is deleted.
Steps to Reproduce
Remove All Scenes via the Websocket API (GetSceneList -> RemoveScene)
Request Current Scene via the API (GetCurrentProgramScene)
I've got a minimal golang program that reporduces this issue below, hopefully that is all you need to reproduce this.
If you add a 500ms pause after each iteration of the loop in RemoveAllScenes, does the crash go away? I think this may be a bug related to failure of a check to enforce there being at least one scene in the current collection. My guess is that the check iterates the full scene list, but does not exclude scenes which are "removed" but not destroyed yet, and the removed scenes are still being counted in the check.
If you add a 500ms pause after each iteration of the loop in RemoveAllScenes, does the crash go away? I think this may be a bug related to failure of a check to enforce there being at least one scene in the current collection. My guess is that the check iterates the full scene list, but does not exclude scenes which are "removed" but not destroyed yet, and the removed scenes are still being counted in the check.
I tested with adding both a 500ms and 5000ms delay to all three calls (GetSceneList, RemoveScene, GetCurrentProgramScene), and the bug still occurred in both cases.
However, it did prevent the bug in #10533 from occurring, which would suggest that the two issues I reported may not actually be caused by the same underling issue/bug.
Activity
timmaclean commentedon Apr 14, 2024
FYI, I have reported a separate but similar bug to this one ( #10533 ). I'm mentioning it as they may share a common underlying cause.
tt2468 commentedon Apr 14, 2024
If you add a 500ms pause after each iteration of the loop in RemoveAllScenes, does the crash go away? I think this may be a bug related to failure of a check to enforce there being at least one scene in the current collection. My guess is that the check iterates the full scene list, but does not exclude scenes which are "removed" but not destroyed yet, and the removed scenes are still being counted in the check.
timmaclean commentedon Apr 15, 2024
I tested with adding both a 500ms and 5000ms delay to all three calls (GetSceneList, RemoveScene, GetCurrentProgramScene), and the bug still occurred in both cases.
However, it did prevent the bug in #10533 from occurring, which would suggest that the two issues I reported may not actually be caused by the same underling issue/bug.