UEGitPlugin icon indicating copy to clipboard operation
UEGitPlugin copied to clipboard

[bug] A quick shutdown will cause a crash

Open zhaozigu opened this issue 1 year ago • 3 comments

Steps to Reproduce:

  1. User opens the project in Unreal Editor;
  2. Immediately after entering the interface, quickly close the editor;
  3. This will ultimately trigger an error.
Assertion failed: !IsInGameThread() [File: Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlModule.h] [Line: 128]

Cause of the Crash:

	static inline FGitSourceControlModule* GetThreadSafe()
	{
		IModuleInterface* ModulePtr = FModuleManager::Get().GetModule("GitSourceControl");
		if (!ModulePtr)
		{
			// Main thread should never have this unloaded.
			check(!IsInGameThread());
			return nullptr;
		}
		return static_cast<FGitSourceControlModule*>(ModulePtr);
	}

check triggered an assertion failure.

zhaozigu avatar Aug 08 '24 02:08 zhaozigu

However, this does not seem to be a problem that can be definitively repeated.

zhaozigu avatar Aug 08 '24 05:08 zhaozigu

Do you have the full call stack?

mastercoms avatar Aug 08 '24 21:08 mastercoms

@mastercoms

Assertion failed: !IsInGameThread() [File:E:\work\VersionGit\Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlModule.h] [Line: 128]

UnrealEditor_GitSourceControl!GitSourceControlUtils::UpdateCachedStates() [E:\work\VersionGit\Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlUtils.cpp:2180]
UnrealEditor_GitSourceControl!``FGitSourceControlProvider::CheckRepositoryStatus'::`2'::<lambda_1>::operator()'::`10'::<lambda_2>::operator()() [E:\work\VersionGit\Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlProvider.cpp:170]
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_RenderCore
UnrealEditor_WindowsMoviePlayer
UnrealEditor_WindowsMoviePlayer
UnrealEditor_WindowsMoviePlayer
UnrealEditor_WindowsMoviePlayer
UnrealEditor_Core
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll

I think it's because of the thread.

zhaozigu avatar Aug 09 '24 06:08 zhaozigu