Segfault on Linux when unloading module during cook phase
See original GitHub issueI’m consistently getting a segfault (“Signal 11” in UE4 logs) when trying to package a project for Linux.
My environment is:
- Gentoo Linux, kernel 5.16.1
- Unreal Engine 4.27.2 (compiled locally)
- UnrealCLR 1.31
- .NET 6.0 (Gentoo package
dev-dotnet/dotnetcore-sdk-bin-6.0.101::dotnet
)
I can reproduce by:
- Create a UE4 project (any template, C++ or blueprint, seems to have the issue)
- Install UnrealCLR via the install script (
dotnet run --project-path /path/to/my/project
) - At this point, the UE4 editor won’t open the project because it needs to rebuild the UnrealCLR module; I do this with
/path/to/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono /path/to/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Linux -Project=/path/to/UnrealTest.uproject -TargetType=Editor -Progress
- Open the project
- Package for Linux (via
File -> Package Project -> Linux -> Linux
)
The packaging process fails during the cook phase. The editor’s output log just mentions “Signal 11” and redirects me to a Log.txt
file, which in turn redirects me to a Cook-<timestamp>.txt
file, which says:
LogModuleManager: Shutting down and abandoning module UnrealCLR (274)
LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x0000000000000008
LogCore: Fatal error!
0x00007f5a242d07a0 libc.so.6!UnknownFunction(0x3d7a0)
0x00007f5951cc4100 libUE4Editor-UnrealCLR.so!UnrealCLR::Module::ShutdownModule() [/home/captaincrutches/Projects/UnrealTest/Plugins/UnrealCLR/Source/UnrealCLR/Private/UnrealCLR.cpp:1372]
0x00007f5a2d577258 libUE4Editor-Core.so!FModuleManager::UnloadModule(FName, bool) [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp:601]
0x00007f5a2d577eae libUE4Editor-Core.so!FModuleManager::UnloadModulesAtShutdown() [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp:731]
0x0000000000246948 UE4Editor!FEngineLoop::Exit() [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:4294]
0x0000000000246f70 UE4Editor!GuardedMain(char16_t const*) [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Launch/Private/Launch.cpp:193]
0x00007f5a2456f056 libUE4Editor-UnixCommonStartup.so!CommonUnixMain(int, char**, int (*)(char16_t const*), void (*)()) [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Unix/UnixCommonStartup/Private/UnixCommonStartup.cpp:264]
0x00007f5a242bc2fa libc.so.6!UnknownFunction(0x292f9)
0x00007f5a242bc3a8 libc.so.6!__libc_start_main(+0x77)
0x00000000002304d9 UE4Editor!_start()
Here’s the entire files, in case there’s something else significant in there: Cook-2022.01.23-01.27.18.txt Log.txt
I’m brand new to this plugin and even UE4 itself, so it’s entirely possible this is environmental or just me doing something wrong with installation, in which case please do point out my mistake. And of course, let me know if there’s any other logs/info that would help, or if I should make any local code changes to see if they help.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (8 by maintainers)
Great, thanks! Fixed in https://github.com/nxrighthere/UnrealCLR/commit/1f29fa2543f831021618a1efcd7e3792c855a0e0.
Yes, I expect that.
Excellent - that change seems to fix it. My project builds successfully on Linux and I can run the in-engine tests. Thank you!
(There is still a manager that dies in the same place as before - but we’re no longer making another one that’s causing that UB - so I’m gonna call that OK)