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.32k stars 7.73k forks source link

swscale-6.dll crash on OBS28 #7323

Open Marstead opened 1 year ago

Marstead commented 1 year ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

28.0.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/I5xqeDQvjW5Vw356

OBS Studio Crash Log URL

https://obsproject.com/logs/GXkOgKcYKV-TwKdO

Expected Behavior

I was live streaming and OBS crashed after about an hour; I was not expecting a crash.

Current Behavior

OBS crashed citing swscale-6.dll. I have not experienced this crash before upgrading to OBS28.

Steps to Reproduce

N/A -- crash occurred after ~1 hour of live streaming

Anything else we should know?

I have other logs from before the upgrade I could provide upon request.

WizardCM commented 1 year ago

Were you toggling a source or scene at the time?

Marstead commented 1 year ago

I was not. Streaming normally with no changes to OBS when the crash occurred

Marstead commented 1 year ago

Hi everyone,

I just experienced this crash a second time. Again, just streaming normally, no unusual events or source/scene toggles.

https://obsproject.com/logs/-qiZaynqbIkEofol

I have all the other logs so if anything else would help please let me know! This is a brand new crash for me on OBS28.

Marstead commented 1 year ago

Hi everyone, just had this crash again. Notably the crash only happens when I am streaming, not recording, and I'm able to continue recording indefinitely after the crash popup occurs (although the stream instantly dies).

https://obsproject.com/logs/gEMGGbYhn4v89DQj

Fenrirthviti commented 1 year ago

Can you provide the normal session log from that stream as well so we can see if there is anything of note around when the crash occurred?

Marstead commented 1 year ago

2022-09-22 12-15-22.txt

Sure, this should be the right one.

Marstead commented 1 year ago

Hello, just experienced this crash again. Here's the crash log: https://obsproject.com/logs/4q-Db0_MdZUVg7a4

Here's the normal session log: 2022-10-12 04-55-25.txt

Marstead commented 1 year ago

I'm still experiencing this crash about once a week: https://obsproject.com/logs/QbIvYRFfTxS4O_C-

This one the crash log shows an unknown fault but it's immediately after swscale-6. Again, this issue has only ever happened on OBS28.

Marstead commented 1 year ago

I'm still experiencing this crash: https://obsproject.com/logs/swihUyjP0UXMEF4W

Like the last one, it shows an unknown fault but it's again immediately after swscale-6.

Here is the normal log: https://obsproject.com/logs/SxHEmS4Ak_WIIxLk

RytoEX commented 1 year ago

It's important to note that this is crashing inside swscale, which is called from our function video_scaler_scale with only a single sws_scale call. We did update our dependencies for OBS Studio 28, but crashes in swscale are exceedingly rare. Given that we have not yet updated dependencies again since then, I'm not surprised that this is still occurring in 28.0.3. You should test in 28.1.2 (or newer), though we haven't changed much with regards to our invocation of swscale, so I wouldn't be surprised if it still occurs there as well.

At this point, the best thing you could do is try to track exactly what you're doing and what sceneitems are active at this time. The best way to do that use a reduced scene collection with as few scenes and sceneitems as possible. Alternatively, if it is actually a bug in swscale and not our invocation of it, you'll probably have to wait until we update dependencies and retest.

Marstead commented 1 year ago

It's important to note that this is crashing inside swscale, which is called from our function video_scaler_scale with only a single sws_scale call. We did update our dependencies for OBS Studio 28, but crashes in swscale are exceedingly rare. Given that we have not yet updated dependencies again since then, I'm not surprised that this is still occurring in 28.0.3. You should test in 28.1.2 (or newer), though we haven't changed much with regards to our invocation of swscale, so I wouldn't be surprised if it still occurs there as well.

At this point, the best thing you could do is try to track exactly what you're doing and what sceneitems are active at this time. The best way to do that use a reduced scene collection with as few scenes and sceneitems as possible. Alternatively, if it is actually a bug in swscale and not our invocation of it, you'll probably have to wait until we update dependencies and retest.

I went ahead and updated OBS today just in case; after updating to OBS28 started this crash I was trying to wait before updating.

Every time this happens it's several hours into a stream with no real changes in active sources. These are the only sources active in all of the affected streams:

1) .PNG Backgrounds, Frames, Etc 2) Slideshows of .PNGs 3) Video Capture: A Logitech C922 Webcam 4) Video Capture: An Elgato 4K60 Pro MK2 Capture Card 5) Window Captures for a LiveSplit Timer & Chatty 6) A CLR Browser source for StreamLabs alerts

Literally nothing else running, no related events, the only thing in common is that this seems to never happen in the first hour or two of streaming, and I'm able to keep recording for awhile after the crash so long as I don't dismiss the pop (stream ends instantly, though). It also only happens once every 1-2 weeks, even though I stream weekdays for 4-5 hours. So a rare crash that happens on average once every 20-40 hours :\

Fenrirthviti commented 1 year ago

I think the best thing that would help is to grab a memory dump of OBS while the "Oops! OBS has crashed" message is still open. You can follow the steps here, and then find either myself (Fenrir) or RytoEX on our Discord to send the link to the file. Do not post a link to the memory dump publicly as it could contain sensitive information pertaining to OBS, such as your stream key.

However, as the call stack contains <unknown>, this typically indicates some kind of external process is causing issues. A full dump might help point to what, though.

Marstead commented 1 year ago

I think the best thing that would help is to grab a memory dump of OBS while the "Oops! OBS has crashed" message is still open. You can follow the steps here, and then find either myself (Fenrir) or RytoEX on our Discord to send the link to the file. Do not post a link to the memory dump publicly as it could contain sensitive information pertaining to OBS, such as your stream key.

However, as the call stack contains <unknown>, this typically indicates some kind of external process is causing issues. A full dump might help point to what, though.

I'll do my best next time I get a crash, I would expect sometime next week or the week after depending on when it triggers.

My earlier crash reports in this thread do report swscale-6 as the culprit, it's only recently that it's landing on <unknown> now. Not sure what changed but I'll keep an eye out for it and post when I have an update. Thank you all for your help, I know this is a tough one to troubleshoot!

Marstead commented 10 months ago

Miraculously, I've completed evaded this crash for almost the last year, but it just happened again. swscale7.dll once again:

https://obsproject.com/logs/ztTOM30pUTKkLd8J

I struggle to think of anything that's changed in the interim (November 2022 to August 2023), but if anyone has ideas for something to check, let me know.

SuslikV commented 10 months ago

Crash log is not full (ended before all info was written). It is wise to monitor resources consumption during encoding (RAM/VRAM) via Task Manager or else program.

RytoEX commented 10 months ago

Crash log is not full (ended before all info was written). It is wise to monitor resources consumption during encoding (RAM/VRAM) via Task Manager or else program.

The crash log has a size limit of 153600 bytes. It is not uncommon to see them truncated if there are a lot of threads.

Marstead commented 10 months ago

I'll give the memory dump idea a shot next time it crashes. Since it's been nearly a year since the last one, it may be a bit before I get a chance to do so.

I've spent the evening wracking my brain thinking what may have changed between the last crash and this one, and it occurred to me that I recently realized I had disabled "Rescale Output -> 1280x720" under Output -> Streaming earlier this year. I don't stream at a high enough bitrate to get away with a 1080p stream so I was accidentally streaming at 1080p for quite a long time. It was only after catching it recently and turning "Rescale Output" back to 1280x720 that the crash happened. Which I'm guessing is the function of the DLL in the first place, but I guess if anyone else is out there searching this issue for a fix, a temporary fix may be to just not rescale your stream output at all, if you are comfortable streaming at 1080p natively.

RytoEX commented 10 months ago

I'll give the memory dump idea a shot next time it crashes. Since it's been nearly a year since the last one, it may be a bit before I get a chance to do so.

I've spent the evening wracking my brain thinking what may have changed between the last crash and this one, and it occurred to me that I recently realized I had disabled "Rescale Output -> 1280x720" under Output -> Streaming earlier this year. I don't stream at a high enough bitrate to get away with a 1080p stream so I was accidentally streaming at 1080p for quite a long time. It was only after catching it recently and turning "Rescale Output" back to 1280x720 that the crash happened. Which I'm guessing is the function of the DLL in the first place, but I guess if anyone else is out there searching this issue for a fix, a temporary fix may be to just not rescale your stream output at all, if you are comfortable streaming at 1080p natively.

Sure, that makes sense. You have to have engaged the scaler for it to crash there. The problem is that the crash is inside swscale, which isn't our code, and we don't have PDBs for it on Windows to properly debug crashes there.

For what it's worth, I ran a test stream for 1.5 hours on Windows using NVENC with rescale output enabled and didn't run into this crash.

Marstead commented 10 months ago

I'll give the memory dump idea a shot next time it crashes. Since it's been nearly a year since the last one, it may be a bit before I get a chance to do so. I've spent the evening wracking my brain thinking what may have changed between the last crash and this one, and it occurred to me that I recently realized I had disabled "Rescale Output -> 1280x720" under Output -> Streaming earlier this year. I don't stream at a high enough bitrate to get away with a 1080p stream so I was accidentally streaming at 1080p for quite a long time. It was only after catching it recently and turning "Rescale Output" back to 1280x720 that the crash happened. Which I'm guessing is the function of the DLL in the first place, but I guess if anyone else is out there searching this issue for a fix, a temporary fix may be to just not rescale your stream output at all, if you are comfortable streaming at 1080p natively.

Sure, that makes sense. You have to have engaged the scaler for it to crash there. The problem is that the crash is inside swscale, which isn't our code, and we don't have PDBs for it on Windows to properly debug crashes there.

For what it's worth, I ran a test stream for 1.5 hours on Windows using NVENC with rescale output enabled and didn't run into this crash.

When the crash was happening actively, it was once every other week or so, so about one time in 40 hours of streaming. So not a very common occurrence, and there never seemed to be a common pattern (some source being enabled or disabled, some motion happening on-screen etc).

JonJaded commented 6 months ago

Okay, I just got this crash and I'm pretty sure I know why, but not sure whats causing it:

My setup is I use VLC to play music, and I have an extension called "Now Playing in Texts v2" which outputs text files with the currently playing song, album name, artists as well as a jpg/png of the current album art.

I didn't start using the album art in my text scroller till yesterday, and when I did it crashed my OBS with no message at all. Just a hard crash.

I checked event viewer and this is what it tells me

Faulting application name: obs64.exe, version: 30.0.2.0, time stamp: 0x4cf47e78 Faulting module name: swscale-7.dll, version: 7.1.100.0, time stamp: 0x00000000 Exception code: 0x40000015 Fault offset: 0x00000000000463d2 Faulting process id: 0x0x8EBC Faulting application start time: 0x0x1DA3D653BDAED5C Faulting application path: C:\Program Files\obs-studio\bin\64bit\obs64.exe Faulting module path: C:\Program Files\obs-studio\bin\64bit\swscale-7.dll Report Id: 4fe8883b-4444-4401-8749-4a07a505c117 Faulting package full name: Faulting package-relative application ID: