SceneSwitcher icon indicating copy to clipboard operation
SceneSwitcher copied to clipboard

Hang when clicking quickly between macros

Open TheStaticMage opened this issue 7 months ago • 2 comments

Operating System Info

Ubuntu 24.04

Other OS

No response

OBS Studio Version

31.0.2

Advanced Scene Switcher Version

1.29.3 and a dev build (see comment)

Plugin settings

Any macros with conditions and actions seem to do

OBS Studio Log URL

No response

OBS Studio Crash Log URL

No response

Expected Behavior

No hang

Current Behavior

After clicking quickly between two non-empty macros, the advanced scene switcher UI eventually hangs, taking OBS with it.

Steps to Reproduce

  1. Create two or more macros that have conditions and actions - exact contents didn't seem to matter
  2. In the list of macros, click on one macro, then the other, then on the first one again, etc. as fast as you can
  3. Eventually observe hang, for me within 30 seconds

Anything else we should know?

I reproduced this behavior in both 1.29.3 downloaded from the releases page, and the very latest dev build that I tried from the other issue https://github.com/WarmUpTill/SceneSwitcher/actions/runs/15356018696?pr=1375. For the latest 1.30 build, I reproduced the issue with the option to disable widget caching enabled and disabled. So it looks like this issue may be longer standing than the recent 1.30 widget caching updates.

OBS hung so there was no segfault for this. I sent it a SIGSEGV to be able to generate a backtrace.

From the cutting edge development build:

Core was generated by `/usr/local/bin/obs --multi --profile NDISource --remote-debugging-port=9223'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  futex_wait (private=0, expected=2, futex_word=0x64ad1ddc8a78) at ../sysdeps/nptl/futex-internal.h:146

warning: 146    ../sysdeps/nptl/futex-internal.h: No such file or directory
[Current thread is 1 (Thread 0x736fc16772c0 (LWP 493313))]
(gdb) bt
#0  futex_wait (private=0, expected=2, futex_word=0x64ad1ddc8a78) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait (futex=futex@entry=0x64ad1ddc8a78, private=0) at ./nptl/lowlevellock.c:49
#2  0x0000736fcaca0101 in lll_mutex_lock_optimized (mutex=0x64ad1ddc8a78) at ./nptl/pthread_mutex_lock.c:48
#3  ___pthread_mutex_lock (mutex=0x64ad1ddc8a78) at ./nptl/pthread_mutex_lock.c:93
#4  0x0000736f88bc8699 in __gthread_mutex_lock (__mutex=0x64ad1ddc8a78) at /usr/include/x86_64-linux-gnu/c++/13/bits/gthr-default.h:749
#5  std::mutex::lock (this=0x64ad1ddc8a78) at /usr/include/c++/13/bits/std_mutex.h:113
#6  std::lock_guard<std::mutex>::lock_guard (__m=..., this=<synthetic pointer>) at /usr/include/c++/13/bits/std_mutex.h:249
#7  advss::SaveSceneSwitcher (save_data=0x64ad1e7b03e0, saving=<optimized out>) at /home/runner/work/SceneSwitcher/SceneSwitcher/lib/advanced-scene-switcher.cpp:185
#8  0x000064ace8869b88 in OBSStudioAPI::on_save (this=0x64ad1d01a120, settings=0x64ad1e7b03e0) at /home/runner/work/obs-studio/obs-studio/UI/api-interface.cpp:614
#9  0x000064ace86e8f6f in OBSBasic::Save
    (this=this@entry=0x64ad1cef0400, file=0x64ad258bf660 "/home/XXXREDACTEDXXX/NDIScenes.json")
    at /home/runner/work/obs-studio/obs-studio/UI/window-basic-main.cpp:869
#10 0x000064ace86e9327 in OBSBasic::SaveProjectDeferred (this=0x64ad1cef0400) at /usr/include/c++/13/bits/basic_string.h:222
#11 0x0000736fcb576683 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#12 0x0000736fcc38b3b0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt6Widgets.so.6
#13 0x0000736fcb538448 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#14 0x0000736fcb538635 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#15 0x0000736fcb733a8f in ??? () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#16 0x0000736fca1145c5 in ??? () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x0000736fca173737 in ??? () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x0000736fca113a63 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x0000736fcb7315ef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#20 0x0000736fcb5429a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#21 0x0000736fcb53b35e in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#22 0x000064ace85df4cc in run_program (argv=0x7ffffd690318, argc=<optimized out>, logFile=...) at /home/runner/work/obs-studio/obs-studio/UI/obs-app.cpp:2102
#23 main (argc=<optimized out>, argv=0x7ffffd690318) at /home/runner/work/obs-studio/obs-studio/UI/obs-app.cpp:2639

From the 1.29.3 release:

Core was generated by `/usr/local/bin/obs --multi --profile NDISource --remote-debugging-port=9223'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  futex_wait (private=0, expected=2, futex_word=0x569c34025238) at ../sysdeps/nptl/futex-internal.h:146

warning: 146    ../sysdeps/nptl/futex-internal.h: No such file or directory
[Current thread is 1 (Thread 0x71069f7772c0 (LWP 602445))]
(gdb) bt
#0  futex_wait (private=0, expected=2, futex_word=0x569c34025238) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait (futex=futex@entry=0x569c34025238, private=0) at ./nptl/lowlevellock.c:49
#2  0x00007106a8ca0101 in lll_mutex_lock_optimized (mutex=0x569c34025238) at ./nptl/pthread_mutex_lock.c:48
#3  ___pthread_mutex_lock (mutex=0x569c34025238) at ./nptl/pthread_mutex_lock.c:93
#4  0x00007106629bfcd9 in __gthread_mutex_lock (__mutex=0x569c34025238) at /usr/include/x86_64-linux-gnu/c++/13/bits/gthr-default.h:749
#5  std::mutex::lock (this=0x569c34025238) at /usr/include/c++/13/bits/std_mutex.h:113
#6  std::lock_guard<std::mutex>::lock_guard (__m=..., this=<synthetic pointer>) at /usr/include/c++/13/bits/std_mutex.h:249
#7  advss::SaveSceneSwitcher (save_data=0x569c35356de0, saving=<optimized out>) at /home/runner/work/SceneSwitcher/SceneSwitcher/lib/advanced-scene-switcher.cpp:185
#8  0x0000569c1da6eb88 in OBSStudioAPI::on_save (this=0x569c331bfc20, settings=0x569c35356de0) at /home/runner/work/obs-studio/obs-studio/UI/api-interface.cpp:614
#9  0x0000569c1d8edf6f in OBSBasic::Save
    (this=this@entry=0x569c3307ab20, file=0x569c37c6edd0 "/home/XXXREDACTEDXXX/NDIScenes.json")
    at /home/runner/work/obs-studio/obs-studio/UI/window-basic-main.cpp:869
#10 0x0000569c1d8ee327 in OBSBasic::SaveProjectDeferred (this=0x569c3307ab20) at /usr/include/c++/13/bits/basic_string.h:222
#11 0x00007106a9576683 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#12 0x00007106aa38b3b0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt6Widgets.so.6
#13 0x00007106a9538448 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#14 0x00007106a9538635 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#15 0x00007106a9733a8f in ??? () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#16 0x00007106a81145c5 in ??? () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007106a8173737 in ??? () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007106a8113a63 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007106a97315ef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#20 0x00007106a95429a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#21 0x00007106a953b35e in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
#22 0x0000569c1d7e44cc in run_program (argv=0x7fffa0079358, argc=<optimized out>, logFile=...) at /home/runner/work/obs-studio/obs-studio/UI/obs-app.cpp:2102
#23 main (argc=<optimized out>, argv=0x7fffa0079358) at /home/runner/work/obs-studio/obs-studio/UI/obs-app.cpp:2639

TheStaticMage avatar May 30 '25 22:05 TheStaticMage

Unfortunately, I have not been able to reproduce the problem so far by swapping between macros for a couple of minutes straight.

Image

What types of macros were you using to replicate the issue?

I assume it is related to the option to save settings when swapping between macros. You can disable it like this:

Image

WarmUpTill avatar May 31 '25 11:05 WarmUpTill

My macros look a lot like the ones you created for testing -- I just made a couple of nonsense conditions and actions and then duplicated them.

Here's a video of me experiencing the hang - I am clicking on each one and you can see where it no longer responds. Soon after the screen on the recording goes blank -- that's it crashing.

https://github.com/user-attachments/assets/5b6be002-73c6-4157-9e44-233855294f78

I followed your advice and unchecked the "Save settings when switching between macros" button. After I did so, I clicked until my hand was tired (at least a few minutes) without experiencing the hang. So, I think this avoids the hang for me.

The only difference I could see between your video and mine is that it looks like you were using arrow keys whereas I was clicking the mouse. I'm not sure if that would make a difference?

TheStaticMage avatar Jun 01 '25 03:06 TheStaticMage