4.26 Crashes when adding static meshes to custom levels

Hello,

I recently upgraded from 4.18 to 4.26. I built the project from source on Lubuntu 18.04.5 LTS.

When I open the FPS template level I am able to click on static meshes and drag them into the world editor just fine.

Whenever I try to add static meshes to one of the levels I’ve created from scratch the editor crashes with the following error…

Assertion failed: !GIsRHIInitialized || !GRHISupportsRHIThread [File:Runtime/RHI/Public/RHIStaticStates.h] [Line: 98]

libUE4Editor-Core.so!FGenericPlatformMisc::RaiseException(unsigned int) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMisc.cpp:472]
libUE4Editor-Core.so!FOutputDevice::LogfImpl(char16_t const*, ...) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Core/Private/Misc/OutputDevice.cpp:61]
libUE4Editor-Core.so!AssertFailedImplV(char const*, char const*, int, char16_t const*, __va_list_tag*) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Core/Private/Misc/AssertionMacros.cpp:102]
libUE4Editor-Core.so!FDebug::CheckVerifyFailedImpl(char const*, char const*, int, char16_t const*, ...) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Core/Private/Misc/AssertionMacros.cpp:455]
libUE4Editor-ChaosNiagara.so!TStaticStateRHI<TStaticSamplerState<(ESamplerFilter)1, (ESamplerAddressMode)1, (ESamplerAddressMode)1, (ESamplerAddressMode)1, 0, 1, 0u, (ESamplerCompareFunction)0>, TRefCountPtr<FRHISamplerState>, FRHISamplerState*>::FStaticStateResource::~FStaticStateResource() [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/RHI/Public/RHIStaticStates.h:98]
libc.so.6!UnknownFunction(0x43160)
libc.so.6!exit(+0x19)
libX11.so.6!_XDefaultError(+0x27)
libX11.so.6!_XError(+0x119)
libX11.so.6!UnknownFunction(0x3d7ea)
libX11.so.6!_XReply(+0x3e3)
libX11.so.6!XTranslateCoordinates(+0x8a)
libUE4Editor-ApplicationCore.so!X11_SetWindowPosition [/SDL-gui-backend/src/video/x11/SDL_x11window.c:876]
libUE4Editor-ApplicationCore.so!SDL_SetWindowPosition_REAL [/SDL-gui-backend/src/video/SDL_video.c:1962]
libUE4Editor-SlateCore.so!FDragDropOperation::OnDragged(FDragDropEvent const&) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/SlateCore/Private/Input/DragAndDrop.cpp:45]
libUE4Editor-Slate.so!FSlateUser::NotifyPointerMoveComplete(FPointerEvent const&, FWidgetPath const&) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateUser.cpp:974]
libUE4Editor-Slate.so!FSlateApplication::RoutePointerMoveEvent(FWidgetPath const&, FPointerEvent const&, bool) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:5200]
libUE4Editor-Slate.so!FSlateApplication::ProcessMouseMoveEvent(FPointerEvent const&, bool) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:5594]
libUE4Editor-Slate.so!FSlateApplication::OnMouseMove() [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:5518]
libUE4Editor-ApplicationCore.so!FLinuxApplication::ProcessDeferredMessage(SDL_Event) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxApplication.cpp:336]
libUE4Editor-ApplicationCore.so!FLinuxPlatformApplicationMisc::PumpMessages(bool) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp:428]
UE4Editor!FEngineLoop::Tick() [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:4746]
UE4Editor!GuardedMain(char16_t const*) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Launch/Private/Launch.cpp:171]
libUE4Editor-UnixCommonStartup.so!CommonUnixMain(int, char**, int (*)(char16_t const*), void (*)()) [/mnt/DATA-1/GameDev/Engines/UnrealEngine/UnrealEngine_4.26.0/UnrealEngine-release/Engine/Source/Runtime/Unix/UnixCommonStartup/Private/UnixCommonStartup.cpp:264]
libc.so.6!__libc_start_main(+0xe6)
UE4Editor!_start()

I have the same error with Unreal Editor 4.26 and Kubuntu 18.04

It occurs when I drag any object to the editor.

I think the actual problem is while the GL Window should be moved and the corresponding X Error which is showing just before the backtrace and the actual assertion is:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  40 (X_TranslateCoords)
  Resource id in failed request:  0x28861ef
  Serial number of failed request:  1280
  Current serial number in output stream:  1280

More detailed analysis brought out that the problem occurs when dragging an object to the map. It occurs just in this moment when the dragging object is moved from the side bar or the object browser to the map window.
I think there changes the CursorDecoratorWindow and somehow the window which should be Moved will get unvalid.

Perhaps it is because in this moment the CursorDecoratorWindow changes from the small window to the actual object.

As even can be seen in the Backtrace it crashes while translating the coordinates of the X11 window the second time:

X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display),
                                  attrs.x, attrs.y, &x, &y, &childReturn);

I assume the window of the parent variable is not valid anymore.

The crash will not happen if I prevent the movement of the CursorDecoratorWindow while drag and drop completly by remove line 46 from Runtime/SlateCore/Private/Input/DragAndDrop.cpp:

CursorDecoratorWindow->MoveWindowTo(Position);

For sure the cursor decorator window will not move with the mouse anymore after that.

I can confirm that this solves the issue for me as well.

After removing the line I am able to add models to the level.

Thank you so much!

Yeah but it will not really solve the issue it is only a workaround.

I was having exactly this issue on Kubuntu 20.10. The workaround of commenting out the line mentioned above and recompiling seems to have worked for me.

Other than preventing these crashes what are the other consequences of the workaround? Is it likely to prevent me from doing something else in the engine at a later point?

I am using it for a while and didn’t see any issue due to that change, and in any case it looks like the impact would be very minor if existent whatsoever.

However, I can see a similar issue happening when dragging a tab from a window into another window (for example opening a blueprint and moving that tab to the main window). It should be fixable in a similar way by removing the similar line in FDockingDragOperation::OnDragged() at Engine/Source/Runtime/Slate/Private/Framework/Docking/FDockingDragOperation.cpp
I’m not sure if there are other places where this happens.

I’m very new to UE, so I’m not sure why this broke and what would be the correct way of fixing this, but hey, it works for me ™!

Thank you! Thank you! Thank you! Now I don’t have to constantly worry about the editor crashing! This saves so much time!

As to the impact of the change, it makes it so the drag and drop window appears in the center of the screen instead of by the cursor, but, that doesn’t really matter to me.