lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.64k stars 260 forks source link

Chat Render randomly crashes #899

Closed nguyend24 closed 4 months ago

nguyend24 commented 9 months ago

Checklist

Edition

Command Line Interface

Describe your issue here

This has been happening for the past year now across multiple versions. I use https://github.com/Zibbp/ganymede, which is where I noticed this happening, but the logs below are from running TwitchDownloaderCli directly.

Chatrender will crash and I haven't figured out a predictable pattern to it.

My workaround has been to just keep rerunning chatrender until it eventually succeeds. It usually takes 1-2 additional runs to eventually succeed. Obviously this is a lot of extra time and energy needed.

It happens to about 30-40% of the streams I download.

On Debian 12 on Proxmox, it'll segfault TwitchDownloaderCLI 1.53.4 Copyright (c) lay295 and contributors [STATUS] - Fetching Images [1/2] [STATUS] - Rendering Video: 0% (0h0m2s Elapsed | 5h25m20s Remaining) [LOG] - No valid typefaces were found for some messages. [STATUS] - Rendering Video: 91% (4h14m49s Elapsed | 0h22m57s Remaining)Segmentation fault

I recently decided to try running it on windows 10 and it produced the following stacktrace: windows stacktrace.txt

99% of the streams I download are Korean or Japanese, but this has happened for all languages(kr, jp, en). Attached a Korean chat produced by ganymede 40830451479_fcf57987-8c5b-11ee-b9ae-0242ac120002-chat-convert.json

I've tested on Intel (i3-6300) and AMD (Ryzen 5 1400). I haven't tried a long term test on bare metal yet, I need to find a machine.

Args used: -h 1440 -w 340 --framerate 30 --font-size 13

Add any related files or extra information here

No response

ScrubN commented 9 months ago

How much memory is in the system? I'm wondering if the system is running out of memory when trying to allocate a new bitmap for a frame, resulting in a nullptr read the next time we try to copy from it. That would also explain the inconsistent occurrence.

nguyend24 commented 9 months ago

8GB but I bumped it up to 32GB just now, kicked off a bunch and 1 failed

ScrubN commented 9 months ago

Upon further inspection, it seems that SkiaSharp would throw if a new bitmap failed to allocate. I hate to say it, but I don't have any clue as to what is causing the segfault.

Zibbp commented 9 months ago

I've rendered this chat a few times now without issue. If possible, can you upload the chat.json file as well? The one you posted, chat-convert.json, is before it hits TwitchDownloader and I'd like to try with the chat.json file as well. You may have to exec into the container and grab it from /tmp.

nguyend24 commented 9 months ago

Here ya go.

40830451479_fcf57987-8c5b-11ee-b9ae-0242ac120002-chat.json

ScrubN commented 4 months ago

Closing due to stale + can't repo