obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
57.19k stars 7.71k forks source link

[Windows 11] OBS crashes during regular Windows shutdown #10848

Open riidefi opened 2 weeks ago

riidefi commented 2 weeks ago

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/krQyPY0gGII9KRai (previous log) https://obsproject.com/logs/qaOHGs2BO4ydjHpB (current log)

OBS Studio Crash Log URL

https://obsproject.com/logs/FqCrvAHYdESIIupf (crash)

Expected Behavior

I would expect the OBS application to cleanly close during a standard Windows shutdown interaction.

Current Behavior

A crash dialog appears noting the exception being raised in the OBS application.

Steps to Reproduce

  1. Open OBS
  2. Stream to Youtube
  3. Stop streaming
  4. Shut down Windows while OBS is still running (but not streaming). Allow Windows to attempt to close OBS itself.

Anything else we should know?

No response

Andre-Satorres commented 1 week ago

Duplicate of https://github.com/obsproject/obs-studio/issues/10833?

Andre-Satorres commented 1 week ago

Btw I just tested it here and I didn't even had to stream to YT, just shutdown Windows 11 with OBS still open. Then, when the PC restarted, I open OBS again, but received this dialog: (it is in portuguese BR)

"Safe Mode OBS Studio did not shut down properly last session. Would you like to start in safe mode (third-party plugins, scripts, and websockets disabled)? Run in safe mode / Run in normal mode"

image

Fenrirthviti commented 1 week ago

Possibly, there's not a lot of information in 10833 on what is causing it. Might be related, might not.

Andre-Satorres commented 1 week ago

image

I think it is related to this logic: On obs-app main, a sentinel file is created. But it is deleted only if the function run_program() ends, which I believe might only happen if the window is closed (on click) image

Then, next time application is started, the sentinel file already exists, and unclean_shutdown is set to TRUE, and trigger the message present in the log, and also in the https://github.com/obsproject/obs-studio/issues/10833 title. image

We should get a product decision: if this message is annoying and we want to get rid of it, let's think on a different approach rather than this sentinel file.

I believe we should put this "delete_safe_mode_sentinel" as required action on application closure

riidefi commented 1 week ago

We should get a product decision: if this message is annoying and we want to get rid of it, let's think on a different approach rather than this sentinel file.

In the case of this issue (#10848), it was not merely a spurious an error dialog upon subsequent application launch (perhaps a false positive), but a genuine application crash (with an error dialog (invalid instruction executed) and a crash report) during the Windows shutdown process. In particular, an invalid instruction was executed thereby invoking a signal handler. See the attached crash report.

Best