Crash when using a third party dll in a plugin

Hello everyone,

So here’s the situation : I started working a few months ago on a plugin development project, whose role was to integrate and allow the use of a specific third party C++ library in Unreal Engine (initially on UE 4.26). The project worked just fine, I had a working demo of the plugin, and when Unreal Engine 5 was released I even managed to migrate the demo and have it working on UE5.

Since then, I’ve had a few minor improves and reworks to do on the original library, and now the project crash when I hit the “Play” button with the following crash report :

Unhandled Exception: 0xc06d007e

KERNELBASE

UnrealEditor_SFSPlugin!__delayLoadHelper2() [[D:\a_work\1\s\src\vctools\delayimp\delayhlp.cpp](file:///D:/a/_work/1/s/src/vctools/delayimp/delayhlp.cpp):312]

UnrealEditor_SFSPlugin!_tailMerge_sfslib_dll()

UnrealEditor_SFSPlugin!InitializeModule() [[C:\Users\gchap\Documents\ApexO](file:///C:/Users/user/Documents/UEProjects) Projects\Git\UnrealSimulationLibrary\SFSProject UE5\Plugins\SFSPlugin\Source\SFSPlugin\Private\SFSPlugin.cpp:59]

UnrealEditor_Core!FModuleManager::LoadModuleWithFailureReason() [[D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Modules\ModuleManager.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp):570]

UnrealEditor_Projects!FModuleDescriptor::LoadModulesForPhase() [[D:\build++UE5\Sync\Engine\Source\Runtime\Projects\Private\ModuleDescriptor.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Projects/Private/ModuleDescriptor.cpp):690]

UnrealEditor_Projects!FPluginManager::TryLoadModulesForPlugin() [[D:\build++UE5\Sync\Engine\Source\Runtime\Projects\Private\PluginManager.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Projects/Private/PluginManager.cpp):1583]

UnrealEditor_Projects!FPluginManager::LoadModulesForEnabledPlugins() [[D:\build++UE5\Sync\Engine\Source\Runtime\Projects\Private\PluginManager.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Projects/Private/PluginManager.cpp):1658]

UnrealEditor!FEngineLoop::LoadStartupModules() [[D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp):4118]

UnrealEditor!FEngineLoop::PreInitPostStartupScreen() [[D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp):3469]

UnrealEditor!GuardedMain() [[D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Launch/Private/Launch.cpp):137]

UnrealEditor!GuardedMainWrapper() [[D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Launch/Private/Windows/LaunchWindows.cpp):147]

UnrealEditor!LaunchWindowsStartup() [[D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Launch/Private/Windows/LaunchWindows.cpp):283]

UnrealEditor!WinMain() [[D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp](file:///D:/build/++UE5/Sync/Engine/Source/Runtime/Launch/Private/Windows/LaunchWindows.cpp):330]

UnrealEditor!__scrt_common_main_seh() [[d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl](file:///D:/a01/_work/6/s/src/vctools/crt/vcstartup/src/startup/exe_common.inl):288]

kernel32

ntdll

A few precisions :

  • I also have an other UE5 project (UE5 native, no migration) using this library, that works perfectly and doesn’t crash. I still need to figure out how to fix the migrated UE4 project because the demo is way more advanced on that one, and we need to use it to show the features and characteristics of our library to potential clients.
  • The line 59 in SFSPlugin.cpp mentionned in the crash report is just “IMPLEMENT_MODULE(FSFSPluginModule, SFSPlugin)”
  • When trying to build the project from source code manually, the build runs without any problem and appears to be successful.

I tried to figure out what this exception code means, but the crash report is very unclear to me. I’ve attached the detailed report to this post, if you can help me figure out what that crash means it’d be great.

Thanks in advance !

EDIT : in case that helps, I’ll include my plugin build file as well :

// Copyright Epic Games, Inc. All Rights Reserved.
 
using UnrealBuildTool;
 
public class SFSPlugin : ModuleRules
{
	public SFSPlugin(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
		
		PublicIncludePaths.AddRange(
			new string[] {
				// ... add public include paths required here ...
			}
			);
				
		
		PrivateIncludePaths.AddRange(
			new string[] {
				// ... add other private include paths required here ...
			}
			);
			
		
		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"SFSPluginLibrary",
				"Projects"
				// ... add other public dependencies that you statically link with here ...
			}
			);
			
		
		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				// ... add private dependencies that you statically link with here ...	
			}
			);
		
		
		DynamicallyLoadedModuleNames.AddRange(
			new string[]
			{
				// ... add any modules that your module loads dynamically here ...
			}
			);
	}
}