UEGitPlugin icon indicating copy to clipboard operation
UEGitPlugin copied to clipboard

Crash during start up can't LoadModule

Open paulash opened this issue 2 years ago • 12 comments

Hello. Using latest release 3.06, and unreal 5.0.2 me and my coworker are getting crashing randomly in unreal during the initial loading of the plugin. When it happens it seems to happen a few times in a row then go away.

The crash is within ModuleManager.cpp, in LoadModuleCheck. When the plugin attempts to start handing the branch check.

UnrealEditor-Core.dll!FModuleManager::LoadModuleChecked(const FName InModuleName) Line 388 C++ UnrealEditor-GitSourceControl-Win64-DebugGame.dll!FGitSourceControlModule::Get() Line 118 C++ UnrealEditor-GitSourceControl-Win64-DebugGame.dll!GitSourceControlUtils::GetBranchName(const FString & InPathToGitBinary, const FString & InRepositoryRoot, FString & OutBranchName) Line 523 C++ UnrealEditor-GitSourceControl-Win64-DebugGame.dll!FGitSourceControlProvider::CheckRepositoryStatus::__l2::void (void)::__l2::() Line 114 C++ UnrealEditor-GitSourceControl-Win64-DebugGame.dll!FGitSourceControlProvider::CheckRepositoryStatus::__l2::() Line 139 C++ UnrealEditor-GitSourceControl-Win64-DebugGame.dll!UE::Core::Private::Function::TFunctionRefCaller<void (void),void __cdecl(void)>::Call(void * Obj) Line 549 C++

paulash avatar Jul 20 '22 21:07 paulash

What's the actual error? Access violation?

mastercoms avatar Jul 20 '22 21:07 mastercoms

It throws an exception when it validates on this line.

IModuleInterface& FModuleManager::LoadModuleChecked( const FName InModuleName )
{
	IModuleInterface* Module = LoadModule(InModuleName, ELoadModuleFlags::LogFailures);
	checkf(Module, TEXT("%s"), *InModuleName.ToString()); <== throw.

	return *Module;
}

seems like the modules not loading correctly, or its a race condition or something.

paulash avatar Jul 20 '22 21:07 paulash

if I continue passed that, it dies with a read access violation as the provider is junk memory.

paulash avatar Jul 20 '22 21:07 paulash

Ok, thanks, will check it out!

mastercoms avatar Jul 20 '22 21:07 mastercoms

Any update on this, it seems to be becoming worse I have to continually hit rerun till I get in now haha.

paulash avatar Jul 30 '22 18:07 paulash

I haven't been able to spot the race condition yet. As a workaround, you could add || true to this line.

mastercoms avatar Jul 31 '22 14:07 mastercoms

I'm having the exact same issue, @paulash did that workaround solved it?

@mastercoms doing some debugging, could it be related to loading the module in another thread, OR the LoadingPhase, that is currently set to "Default"?

https://docs.unrealengine.com/5.0/en-US/API/Runtime/Projects/ELoadingPhase__Type/

linqen avatar Aug 06 '22 09:08 linqen

Also getting this pretty much every time I open the Project. Have to restart 2 or 3 times for it to finally boot and not throw this error :(

LewisFarrellDev avatar Aug 06 '22 16:08 LewisFarrellDev

I'm having the exact same issue, @paulash did that workaround solved it?

@mastercoms doing some debugging, could it be related to loading the module in another thread, OR the LoadingPhase, that is currently set to "Default"?

https://docs.unrealengine.com/5.0/en-US/API/Runtime/Projects/ELoadingPhase__Type/

Yup, that did indeed work for me. Havent gotten a crash sense.

paulash avatar Aug 06 '22 16:08 paulash

Yup, that did indeed work for me. Havent gotten a crash sense.

Okay great, I will go with that workaround in the meanwhile. Thanks

linqen avatar Aug 06 '22 17:08 linqen

This is all on UE5 right?

mastercoms avatar Aug 08 '22 14:08 mastercoms

This is all on UE5 right?

In my case, yes

linqen avatar Aug 08 '22 16:08 linqen

Just chipping in to say that our team had the same issue, and that the workaround from https://github.com/ProjectBorealis/UEGitPlugin/issues/51#issuecomment-1200437532 fixed it. UE 5.0.3.

heivoll avatar Sep 08 '22 15:09 heivoll

Same, I've had to fork in order to apply this workaround, otherwise this startup crash would bite us every other editor start 🤔 It's quite a nasty one.

sinbad avatar Sep 19 '22 12:09 sinbad

Yeah, I'll have to test the plugin with UE5 more, since it works fine for UE4. So I'm wondering what changed.

mastercoms avatar Sep 19 '22 13:09 mastercoms

I got this once on UE4 as well. So seems like it is much rarer on UE4 but still present. Adding a speculative fix that might work, after investigating.

mastercoms avatar Sep 21 '22 18:09 mastercoms

I tested out the fix this morning and unfortunately it's not fixed in UE5. I got the same crash on around the 5th restart. The workaround is still the only thing that reliably eliminates the crash so far.

sinbad avatar Sep 22 '22 11:09 sinbad

In e37691b578d91bee780158b6413fbc92e656a8d3, I have made the workaround part of the build for UE5, so that people don't have to come into this thread to find it :). Will keep trying to figure out what's going on.

mastercoms avatar Sep 22 '22 23:09 mastercoms

I hate to be the bearer of bad news, but after updating to https://github.com/ProjectBorealis/UEGitPlugin/commit/7d6321da5ebafc732eed1c1e1f604772b0e72541 I got the old startup crash immediately :/ (UE5)

sinbad avatar Oct 18 '22 13:10 sinbad

Wait, sorry, my bad - I think I got mixed up between your release branch and my fork's release branch which wasn't up to date.

sinbad avatar Oct 18 '22 13:10 sinbad