LUA Script Crashing - But Which One?

FerretBomb

Active Member
I am experiencing an intermittent/rare crash on OBS startup, pointing to the LUA library.
I assume that one of the scripts I have installed (Albinou's datetime, CG2121's Advanced Timer, Clock.lua, and Exeldro's Instant Replay) is causing the issue.
Is there any way to determine which LUA script is causing the crash? As OBS never fully starts up and CTDs when the issue happens, there's no way to view the LUA output log, and I didn't find anything in the session or crashlog other than:

0000005A5CB5F7B8 00007FFE56448300 000001FBCCEE6840 00009E74713E788A 000001FBCCEE3020 0000000000000000 lua51.dll!0x7ffe56448300
0000005A5CB5F7C0 00007FFE5F14E452 0000000000000010 00009E74713E788A 00009E74713E788A 0000000000000000 obs-scripting.dll!lua_tick+0xa2
0000005A5CB5F830 00007FFE633A09B3 01D8A72766C1339F 0000000000FE5000 00009E74713E7B80 FFFFFFFFFFFFFFFF obs.dll!obs_graphics_thread_loop+0x233
0000005A5CB5F8F0 00007FFE633A073C FFFFFFFFFFFFFFFF 00007FFE6EE36C30 0000000000000000 0000005A5CB5F9E9 obs.dll!obs_graphics_thread+0x2ec
pointing at LUA, the OBS scripting dll, and the graphics thread for some reason.

As it is intermittent and quite rare (only happening 1-2 times a week) I can't just remove each script to find out when it stops.
 

FerretBomb

Active Member
After 'startup complete' and 'all data cleared' then a horizontal rule.
Which, when checking a log from a non-crashed startup, appears to be when the LUA scripts are loaded.

I've added a 'print("[LUA] <Scriptname> loaded");' to each of the scripts in the script_load function. At the very least it should tell me which scripts are NOT causing the issue. I may move this to the head of script_defaults as it appears to be executed first, and would give the best shot of writing out the problem script's name, assuming the crash isn't caused by the initial script-parse itself somehow.

Would be kinda nice if OBS listed each script in the session-log independently as it was being opened for parsing, to help chase this sort of thing down for general end users.
 

Suslik V

Active Member
All scripts are logged after the "All scene data cleared", so... it is big chance that you reported general bug that is not related to the script's algorithm.

At least, the v28.0.0 successfully logging the scripts, for example:
Code:
14:11:33.450: ---------------------------------
14:11:33.450: ==== Startup complete ===============================================
14:11:33.457: Switched to Preview/Program mode
14:11:33.458: ------------------------------------------------
14:11:33.568: All scene data cleared
14:11:33.568: ------------------------------------------------
14:11:33.594: [obs-scripting]: Loaded lua script: filter-fish-lens.lua
14:11:33.597: [obs-scripting]: Loaded lua script: filter-cornerpin.lua
Then goes the sources settings.

For me, OBS usually not responds and stuck before the "Switched to scene" line (without crash) and this is longtime issue not related to the current releases of the OBS (with or without the scripts).

By the way, what version of OBS you running?
 

FerretBomb

Active Member
Yep, as mentioned, it had the 'all data cleared' message, then a horizontal rule.

05:54:29.005: google_s2t_caption_plugin 0.18b obs_module_post_load
05:54:29.007: ==== Startup complete ===============================================
05:54:29.098: All scene data cleared
05:54:29.098: ------------------------------------------------

Nice! Another excellent change in v28 then, showing the scripts loading. I'm still on 27.2.4 for my prod setup, as I've been burned on early-release upgrading before (got hit with the random-freeze behavior in 27.2.3), so will likely give it 2-4 weeks after 28 goes gold.
 
Top