Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] [Slate] Editor crash after successfully recompiling in-editor

I have a (otherwise perfectly working) projects that will not compile in-editor. More exactly it compiles, but the editor crashes immediatly after compiling. I did not launch the game or start PIE, this happens when simply pressing the "Compile" button.

Compiling from VS2013 is OK, running is OK, wether in PIE or Launch.

Here is the relevant log info :

[2014.04.05-10.17.17:541][193]LogWindows:Error: appError called: Assertion failed: !FindSlateStyle( SlateStyleName ) [File:D:\UnrealEngine\Engine\Source\Runtime\Slate\Private\SlateStyleRegistry.cpp] [Line: 12]

Stack: FWindowsPlatformStackWalk::StackWalkAndDump() 0x68baed6 + 0 bytes [File=d:\unrealengine\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:177] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Core.dll] FDebug::AssertFailed() 0x675f675 + 0 bytes [File=d:\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:176] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Core.dll] FSlateStyleRegistry::RegisterSlateStyle() 0xc576295 + 0 bytes [File=d:\unrealengine\engine\source\runtime\slate\private\slatestyleregistry.cpp:14] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Slate.dll] FSUIResources::Initialize() 0xfd9dec5e + 0 bytes [File=d:\sorcery\source\sorcery\gui\suiresources.cpp:27] [in D:\Sorcery\Binaries\Win64\UE4Editor-Sorcery-4637.dll] FModuleManager::LoadModuleWithFailureReason() 0x67b7cd4 + 0 bytes [File=d:\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:376] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Core.dll] FModuleManager::LoadModule() 0x67b73b0 + 26 bytes [File=d:\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:255] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Core.dll] RebindPackages'::21'::Local::DoHotReload() 0x1038c2e0 + 26 bytes [File=d:\unrealengine\engine\source\runtime\coreuobject\private\uobject\obj.cpp:1876] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-CoreUObject.dll] TBaseStaticDelegateInstance_TwoParams_ThreeVars __ptr64,FDefaultAllocator>,TArray,FOutputDevice & __ptr64>::Execute() 0x1038e627 + 0 bytes [File=d:\unrealengine\engine\source\runtime\core\public\templates\delegateinstancesimpl.inl:820] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-CoreUObject.dll] TBaseStaticDelegateInstance_TwoParams_ThreeVars __ptr64,FDefaultAllocator>,TArray,FOutputDevice & __ptr64>::ExecuteIfSafe() 0x1038e6fa + 0 bytes [File=d:\unrealengine\engine\source\runtime\core\public\templates\delegateinstancesimpl.inl:832] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-CoreUObject.dll] FModuleManager::CheckForFinishedModuleDLLCompile() 0x67a2a7b + 0 bytes [File=d:\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:1912] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Core.dll] FModuleManager::Tick() 0x67c779b + 90 bytes [File=d:\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:68] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Core.dll] UEditorEngine::Tick() 0x32c4c45 + 0 bytes [File=d:\unrealengine\engine\source\editor\unrealed\private\editor.cpp:830] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-UnrealEd.dll] UUnrealEdEngine::Tick() 0x36d9ce6 + 0 bytes [File=d:\unrealengine\engine\source\editor\unrealed\private\unrealedengine.cpp:212] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor-UnrealEd.dll] FEngineLoop::Tick() 0x1277593 + 0 bytes [File=d:\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:1959] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe] GuardedMain() 0x126ce5c + 0 bytes [File=d:\unrealengine\engine\source\runtime\launch\private\launch.cpp:132] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe] GuardedMainWrapper() 0x126ceca + 5 bytes [File=d:\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:120] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe] WinMain() 0x1278ae9 + 17 bytes [File=d:\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:196] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe] __tmainCRTStartup() 0x12798d9 + 21 bytes [File=f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618] [in D:\UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe] Address = 0x227f15dd (filename not found) [in C:\WINDOWS\system32\KERNEL32.DLL] Address = 0x24fd43d1 (filename not found) [in C:\WINDOWS\SYSTEM32\ntdll.dll] Address = 0x24fd43d1 (filename not found) [in C:\WINDOWS\SYSTEM32\ntdll.dll]

Obviously a Slate issue, but this looks internal rather than user code, since no game is running.

I am using UE 4.02 from source.

Product Version: Not Selected
more ▼

asked Apr 05 '14 at 10:20 AM in C++ Programming

avatar image

594 53 63 133

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Apr 28 '15 at 07:43 AM by StrangerGwenn for the following reason:

The question is answered, right answer was accepted

2 answers: sort voted first

I finally found the solution in ShooterGame, with a "hot reload hack" comment. Here, in StartupModule(), before firing up the style instance :


I tried it and it works at last ! I can recompile in the editor.

more ▼

answered Apr 13 '14 at 03:47 PM

avatar image

594 53 63 133

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

That looks like it's tried to register your style set (FSUIResources) twice, presumably when the game module was loaded again after compilation.

I assume that when your module loads, you're initialising your style, which is calling FSlateStyleRegistry::RegisterSlateStyle?

Do you also ever call FSlateStyleRegistry::UnRegisterSlateStyle when unloading your module?

more ▼

answered Apr 05 '14 at 11:51 AM

avatar image

Jamie Dale STAFF
7.5k 176 66 304

avatar image StrangerGwenn Apr 05 '14 at 11:55 AM

That's what I do yes, here is the two relevant methods :

 void FSUIResources::Initialize()
     if (!m_UIResources.IsValid())
 void FSUIResources::Shutdown()

From the first method, I shouldn't reload the style...

The resource is declared like this :

 TSharedPtr<FSlateGameResources> m_UIResources
avatar image Jamie Dale STAFF Apr 05 '14 at 11:58 AM

Okay, could you pop a breakpoint in those two functions, compile in the editor, and then let me know which breakpoints get hit. Thanks.

avatar image StrangerGwenn Apr 05 '14 at 12:03 PM

The first one (Initialize) is hit. The code follows through into the if, and calls RegisterSlateStyle which crashes the editor.

avatar image Jamie Dale STAFF Apr 05 '14 at 12:06 PM

Curious, the module has been unloaded and reloaded without FSUIResources::Shutdown being called (hence the null pointer and re-initialisation).

Where are FSUIResources::Initialize and FSUIResources::Shutdown called from?

avatar image StrangerGwenn Apr 05 '14 at 12:10 PM

I redid the test, the Initialize method is called twice (once when starting, a second time after compiling) and Shutdown is never.

Shutdown is supposed to be called from the FProjectname::ShutdownModule() method, and it is really called when I exit the game cleanly, so I don't get it.

avatar image Jamie Dale STAFF Apr 05 '14 at 12:13 PM

Thanks, that sounds like it might be a bug with our hot-reload code.

Unfortunately I can't check this right now, but I'll make a note to check it on Monday when I get in to work and then get back to you.

avatar image StrangerGwenn Apr 05 '14 at 12:18 PM

Thanks a lot !

avatar image Jamie Dale STAFF Apr 07 '14 at 10:34 AM

Okay, I've tried this with the ShooterGame sample and it does look like a bug.

Basically FModuleManager::AbandonModule doesn't call ShutdownModule; I'm not 100% sure that it should, so I'm going to check and get that confirmed one way or the other.

As a workaround, AbandonModule does broadcast a ModulesChangedEvent with ModuleUnloaded as the reason, so you could hook in to that event and unload your style from it.

The following code should do that for you (replace ProjectName with the name of your game module).

 void FProjectName::StartupModule()
     // ...
     FModuleManager::Get().OnModulesChanged().AddSP(this, &FProjectName::HandleModulesChanged);

 void FProjectName::ShutdownModule()
     // ...

     // This will probably still be an issue as this won't get called when the module is abandoned, so you may end up with multiple delegates trying to unload your style. You may have to add a bool to guard against that in HandleModulesChanged.
 void FProjectName::HandleModulesChanged( FName ModuleThatChanged, EModuleChangeReason::Type ReasonForChange )
     static const FName ProjectName("ProjectName");
     if(ModuleThatChanged == ProjectName && ReasonForChange == EModuleChangeReason::ModuleUnloaded)
avatar image Andargor Apr 09 '14 at 01:34 AM

I have the exact same issue as Gwenn, and this solution has not resolved my issue. In fact, it made it worse: instead of crashing on compile, it crashes on editor load :) I have tried recompiling from the command line, to no avail.

avatar image Jamie Dale STAFF Apr 09 '14 at 09:08 AM

I've entered an internal bug regarding this issue, so hopefully it will get triaged soon.

Regarding the workaround I provided, how is it crashing? We use a similar method internally to handle some intermodule dependencies in the editor (which is where I lifted that code from).

avatar image Andargor Apr 09 '14 at 03:34 PM

I have the same log message as in this question: https://answers.unrealengine.com/questions/22051/slate-style-crash-the-editor.html

It may be related to how my paths are defined, trying to figure it out.

avatar image Andargor Apr 10 '14 at 01:20 AM

I've still been attempting to get this to work. It crashes with this line in StartupModule:

FModuleManager::Get().OnModulesChanged().AddSP(this, &FSlateTest1::HandleModulesChanged);

To make it work I have had to implement an AsShared() function. is this how it should look?

TSharedRef<FSlateTest1> AsShared() { return TSharedRef<FSlateTest1>(this); }

avatar image Jamie Dale STAFF Apr 10 '14 at 09:03 AM

The correct way to get an AsShared() function is to derive from TSharedFromThis, eg)

 class FSlateTest1 : public TSharedFromThis<FSlateTest1>
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question