Aegisub icon indicating copy to clipboard operation
Aegisub copied to clipboard

Occasional crashes when rescanning autoload dir on Windows

Open seproDev opened this issue 2 years ago • 4 comments

I was unable to reproduce these crashes under Linux and they are not 100% consistant.

Tested on both arch1t3cht's build and this build.

Requires certain automations to be installed. Installing l0.Nudge and rescanning the autoload dir a couple times triggers the crash. Though they can also happen on startup causing Aegisub to not even open.

I have observed different behaviors. Sometimes only a script fails to initialize with this error message: image

Rarely I get this exception:

image

Attaching windbg I get this error on crash:

(5a0.1a88): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
aegisub!FT_Stream_OpenLZW+0x10ac335:
00007ff7`7a59a2a5 8b4814          mov     ecx,dword ptr [rax+14h] ds:00008000`00000013=????????
0:035> g
(5a0.1a88): Access violation - code c0000005 (!!! second chance !!!)
aegisub!FT_Stream_OpenLZW+0x10ac335:
00007ff7`7a59a2a5 8b4814          mov     ecx,dword ptr [rax+14h] ds:00008000`00000013=????????

seproDev avatar Aug 06 '22 22:08 seproDev

Are you able to trace which commit introduces this?

petzku avatar Aug 08 '22 09:08 petzku

I did a bunch more testing and it seems to only happen when local config files are being used, as was the case with the two portable CI builds I tried initally.

Using the CI builds with a config file from the appdata folder the crashes no longer happen.

I tested build 8962 from here and that version is also affected. Just using aegisub after setup the crashes don't appear, but switching over to a local config file 8962 also crashes. AegisubDC 9215 also crashes in a simmilar way when using local config files.

So probably an issue with the local config logic used in Aegisub in general.

seproDev avatar Aug 08 '22 13:08 seproDev

Figured this out on the discord. For future reference here the summary. The default autoload/include location is set like this: https://github.com/TypesettingTools/Aegisub/blob/c218db6f349aed809040801c44b59c1d2e0d8739/src/libresrc/default_config.json#L290-L294 When using a local config ?user gets set to the value of ?data https://github.com/TypesettingTools/Aegisub/blob/c218db6f349aed809040801c44b59c1d2e0d8739/src/main.cpp#L182-L184 Causing the lines to effectively be ?data/automation/autoload/|?data/automation/autoload/, which means the automation folders get loaded twice. https://github.com/TypesettingTools/Aegisub/blob/c218db6f349aed809040801c44b59c1d2e0d8739/src/auto4_base.cpp#L325

I would assueme the actual crash happens because of some race condition.

seproDev avatar Aug 08 '22 21:08 seproDev

I posted about this months ago

eddilara avatar Oct 02 '22 08:10 eddilara