# Strange "..Slate.dll" Crash in VR mode

**URL:** <https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057>\
**Category:** XR Development\
**Tags:** unreal-engine, crash, bug-report, slate, question, CPP\
**Created:** [November 20, 2017, 1:48pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057 "2017-11-20T13:48:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anadre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anadre](https://forums.unrealengine.com/u/anadre)\
**Post date:** [November 20, 2017, 1:48pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/1 "2017-11-20T13:48:32Z")

</div>

**0** Files  
Log  
Dump  
Context  
**1**  
Engine Version 4.18.1  
i5 6600  
GeForce GTX 1060 6GB  
HTC VIVE  
**2**  
During the week I’m trying to understand why and how it crash  
It happens regularly, with a periodicity of 5-15 minutes  
And that I noticed none of the failures point to my module or some sort of asserts  
Always:

```
<IsEnsure>false</IsEnsure>
<IsAssert>false</IsAssert>
<CrashType>Crash</CrashType>

```

And in Callstack(on top) everything is present that modules

```
UE4Editor-SlateCore.dll!UnknownFunction []
UE4Editor-Slate.dll!UnknownFunction []

```

But I do not use slate, or other widgets.  
What classes did I redefine:  
VrCharacter, MyMotionController(+Grip interface), VrCamera, Small Utility class(for log etc) - It’s all  
**3**  
Reasons(in my view):  
I Use UKismetMaterialLibrary::SetVectorParameterValue in VrChar tick function, which each frame sets new values. And I use this collection value in the material. When I disable this function(in C++ code) the Crash do not occur (I tested about 25-30 minutes). Otherwise, it Crash every 5-15 minutes. I’m not sure what exactly it causes a Crash , but it speeds it up for sure. And this happens only in VR mode  
**I can zip my project and send it to the developers if this information is not enough**

**4**  
Callstacks. Almost all the reports were:

```
     Error: Fatal error!
     Error: 
    LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
    [LogWindows: Error:   

     Error: [Callstack] 0x00000000AF64AF8D UE4Editor-SlateCore.dll!UnknownFunction []
     Error: [Callstack] 0x00000000992C662E UE4Editor-Slate.dll!UnknownFunction []
     Error: [Callstack] 0x0000000099292D46 UE4Editor-Slate.dll!UnknownFunction []
     Error: [Callstack] 0x00000000992C7389 UE4Editor-Slate.dll!UnknownFunction []
    Error: [Callstack] 0x0000000099294140 UE4Editor-Slate.dll!UnknownFunction []
    Error: [Callstack] 0x00000000992ED867 UE4Editor-Slate.dll!UnknownFunction []
    Error: [Callstack] 0x00000000992EC953 UE4Editor-Slate.dll!UnknownFunction []
     Error: [Callstack] 0x000000005FD369CA UE4Editor.exe!UnknownFunction []
     Error: [Callstack] 0x000000005FD45430 UE4Editor.exe!UnknownFunction []
     Error: [Callstack] 0x000000005FD454AA UE4Editor.exe!UnknownFunction []
 Error: [Callstack] 0x000000005FD52379 UE4Editor.exe!UnknownFunction []
     Error: [Callstack] 0x000000005FD53D57 UE4Editor.exe!UnknownFunction []
     Error: [Callstack] 0x00000000D4322774 KERNEL32.DLL!UnknownFunction []
  Error: [Callstack] 0x00000000D6A20D51 ntdll.dll!UnknownFunction []
   Error: [Callstack] 0x00000000D6A20D51 ntdll.dll!UnknownFunction []

```

But only 1 time I received (1 of 30 times):

```
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: Ensure condition failed: false [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\SlateRHIRenderer\Private\SlateRHIRenderer.cpp] [Line: 1072]
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: Window isnt valid but being drawn!
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: Stack: 
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: [Callstack] 0x00000000A1962786 UE4Editor-Core.dll!UnknownFunction []
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: [Callstack] 0x00000000A170123A UE4Editor-Core.dll!UnknownFunction []
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: [Callstack] 0x00000000A171B906 UE4Editor-Core.dll!UnknownFunction []
[2017.11.18-18.01.59:528][664]LogOutputDevice: Error: [Callstack] 0x000000009389275B UE4Editor-SlateRHIRenderer.dll!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x00000000A1057C9A UE4Editor-Slate.dll!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x00000000A1024140 UE4Editor-Slate.dll!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x00000000A107D867 UE4Editor-Slate.dll!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x00000000A107C953 UE4Editor-Slate.dll!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x00000000202469CA UE4Editor.exe!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x0000000020255430 UE4Editor.exe!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x00000000202554AA UE4Editor.exe!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x0000000020262379 UE4Editor.exe!UnknownFunction []
[2017.11.18-18.01.59:529][664]LogOutputDevice: Error: [Callstack] 0x0000000020263D57 UE4Editor.exe!UnknownFunction []
[2017.11.18-18.01.59:530][664]LogOutputDevice: Error: [Callstack] 0x00000000D4322774 KERNEL32.DLL!UnknownFunction []
[2017.11.18-18.01.59:530][664]LogOutputDevice: Error: [Callstack] 0x00000000D6A20D51 ntdll.dll!UnknownFunction []

```

This, too, Slate, but there is already a small clue . And as I wrote above, I do not use any widgets  
**5**  
Disassembly UE4Editor-SlateCore.dll!UnknownFunction []

```
00007FFFA7EDAF0D add byte ptr [rdi+rax+32h],dh  
00007FFFA7EDAF11 ror byte ptr [rax-7Dh],0C4h  
00007FFFA7EDAF15 sub bl,al  
00007FFFA7EDAF17 mov rcx,rdx  
00007FFFA7EDAF1A call 00007FFFA7ED4420  
00007FFFA7EDAF1F test eax,eax  
00007FFFA7EDAF21 sete al  
00007FFFA7EDAF24 add rsp,28h  
00007FFFA7EDAF28 ret  
00007FFFA7EDAF29 int 3  
00007FFFA7EDAF2A int 3  
00007FFFA7EDAF2B int 3  
00007FFFA7EDAF2C int 3  
00007FFFA7EDAF2D int 3  
00007FFFA7EDAF2E int 3  
00007FFFA7EDAF2F int 3  
00007FFFA7EDAF30 xorps xmm0,xmm0  
00007FFFA7EDAF33 ucomiss xmm0,dword ptr [rcx+5D0h]  
00007FFFA7EDAF3A jne 00007FFFA7EDAF3F  
00007FFFA7EDAF3C mov al,1  
00007FFFA7EDAF3E ret  
00007FFFA7EDAF3F xor al,al  
00007FFFA7EDAF41 ret  
00007FFFA7EDAF42 int 3  
00007FFFA7EDAF43 int 3  
00007FFFA7EDAF44 int 3  
00007FFFA7EDAF45 int 3  
00007FFFA7EDAF46 int 3  
00007FFFA7EDAF47 int 3  
00007FFFA7EDAF48 int 3  
00007FFFA7EDAF49 int 3  
00007FFFA7EDAF4A int 3  
00007FFFA7EDAF4B int 3  
00007FFFA7EDAF4C int 3  
00007FFFA7EDAF4D int 3  
00007FFFA7EDAF4E int 3  
00007FFFA7EDAF4F int 3  
00007FFFA7EDAF50 movzx eax,byte ptr [rcx+5A1h]  
00007FFFA7EDAF57 shr al,1  
00007FFFA7EDAF59 and al,1  
00007FFFA7EDAF5B ret  
00007FFFA7EDAF5C int 3  
00007FFFA7EDAF5D int 3  
00007FFFA7EDAF5E int 3  
00007FFFA7EDAF5F int 3  
00007FFFA7EDAF60 test byte ptr [rcx],19h  
00007FFFA7EDAF63 setne al  
00007FFFA7EDAF66 ret  
00007FFFA7EDAF67 int 3  
00007FFFA7EDAF68 int 3  
00007FFFA7EDAF69 int 3  
00007FFFA7EDAF6A int 3  
00007FFFA7EDAF6B int 3  
00007FFFA7EDAF6C int 3  
00007FFFA7EDAF6D int 3  
00007FFFA7EDAF6E int 3  
00007FFFA7EDAF6F int 3  
00007FFFA7EDAF70 push rbx  
00007FFFA7EDAF72 sub rsp,20h  
00007FFFA7EDAF76 cmp qword ptr [rcx+6E8h],0  
00007FFFA7EDAF7E mov rbx,rcx  
00007FFFA7EDAF81 je 00007FFFA7EDAF9F  
00007FFFA7EDAF83 mov rcx,qword ptr [rcx+6E8h]  
00007FFFA7EDAF8A mov rax,qword ptr [rcx]  
00007FFFA7EDAF8D call qword ptr [rax+80h] <---- this
00007FFFA7EDAF93 test al,al  
00007FFFA7EDAF95 je 00007FFFA7EDAF9F  
00007FFFA7EDAF97 mov al,1  
00007FFFA7EDAF99 add rsp,20h  
00007FFFA7EDAF9D pop rbx  
00007FFFA7EDAF9E ret  
00007FFFA7EDAF9F xor al,al  
00007FFFA7EDAFA1 add rsp,20h  
00007FFFA7EDAFA5 pop rbx  
00007FFFA7EDAFA6 ret  
00007FFFA7EDAFA7 int 3  
00007FFFA7EDAFA8 int 3  
00007FFFA7EDAFA9 int 3  
00007FFFA7EDAFAA int 3  
00007FFFA7EDAFAB int 3  
00007FFFA7EDAFAC int 3  
00007FFFA7EDAFAD int 3  
00007FFFA7EDAFAE int 3  
00007FFFA7EDAFAF int 3  
00007FFFA7EDAFB0 movzx eax,byte ptr [rcx+18h]  
00007FFFA7EDAFB4 shr al,7  
00007FFFA7EDAFB7 ret  
00007FFFA7EDAFB8 int 3  
00007FFFA7EDAFB9 int 3  
00007FFFA7EDAFBA int 3  
00007FFFA7EDAFBB int 3  
00007FFFA7EDAFBC int 3  
00007FFFA7EDAFBD int 3  
00007FFFA7EDAFBE int 3  
00007FFFA7EDAFBF int 3  
00007FFFA7EDAFC0 movzx eax,byte ptr [rcx+19h]  
00007FFFA7EDAFC4 and al,1  

```

**6**  
_ **As I said above, I zipped the project and I can send it to the developers** _

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3622090e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3622090e](https://forums.unrealengine.com/u/anonymous_user_3622090e)\
**Post date:** [November 20, 2017, 3:09pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/2 "2017-11-20T15:09:59Z")

</div>

Hello anadre,

Could you outline what you were doing in the editor leading up to the crash? Please provide steps including any changes in the project settings. This will help us narrow down why the crash is occurring.

Thanks,

---

<div class="post-metadata">

**Author:** ![anadre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anadre](https://forums.unrealengine.com/u/anadre)\
**Post date:** [November 20, 2017, 3:32pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/3 "2017-11-20T15:32:44Z")

</div>

Hello =)

I specially created a new project, with a minimal set - to minimize the search.  
He contains(To be at the level):

1. Basic simple level (third person с++) But at the level does not contain anything from 3d char, I deleted them Leaving only the simple floor and wall
2. 1 model of a tree SpeedTree(in shader I use the collection parameter in the input “World pos offset”)
3. 1 model of a grass SpeedTree
4. My game mode(just set myVrChar)
5. VRCharacter(c++ code in tick event i set collection parameter), Char contains controllers and Camera classes are redefined, all via C++(I took the code from the OpenVR plugin and remade it for myself)
6. my project settings (see attachments)  
Build.Cs  
Def Engine.ini  
Def Input. ini  
7)It’s all, then I just play in VR mode But only a mine of 5-10, a maximum of 15  
8)I do not click on the controller and do not take objects - it does not crash at that moment. But I noticed such a thing that if I do not set a collection parameter (in tick C++ function, Via UKismetMaterialLibrary::SetVectorParameterValue )- it does not crash (well, at least 30 minutes of testing - I do not know, mb it just speeds up the Crash)  
9)I do not use Blueprints code in this mini level

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3622090e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3622090e](https://forums.unrealengine.com/u/anonymous_user_3622090e)\
**Post date:** [November 21, 2017, 2:15pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/4 "2017-11-21T14:15:26Z")

</div>

Hello,

Do you possibly have a sample project that this is occurring in that you could share?

Thanks,

---

<div class="post-metadata">

**Author:** ![anadre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anadre](https://forums.unrealengine.com/u/anadre)\
**Post date:** [November 21, 2017, 3:27pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/5 "2017-11-21T15:27:52Z")

</div>

Yes, of course. But I want to send the project privately, not for general access. What e-mail can I drop the link to? Or can there be another way to send privately?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3622090e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3622090e](https://forums.unrealengine.com/u/anonymous_user_3622090e)\
**Post date:** [November 21, 2017, 3:41pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/6 "2017-11-21T15:41:40Z")

</div>

Hi,

You can send me a PM through the forums [here](https://forums.unrealengine.com/member/944538--r)

Best,

---

<div class="post-metadata">

**Author:** ![anadre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anadre](https://forums.unrealengine.com/u/anadre)\
**Post date:** [November 21, 2017, 6:40pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/7 "2017-11-21T18:40:28Z")

</div>

Done, Also I made a small readme file inside

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [November 21, 2017, 10:28pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/8 "2017-11-21T22:28:25Z")

</div>

You don’t have symbol files installed so it hard to deduce whats gone wrong from stack alone

---

<div class="post-metadata">

**Author:** ![anadre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anadre](https://forums.unrealengine.com/u/anadre)\
**Post date:** [November 21, 2017, 11:12pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/9 "2017-11-21T23:12:53Z")

</div>

The symbols are those that are installed through the Launcher? They just install, or what other operations should be done?

---

<div class="post-metadata">

**Author:** ![anadre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anadre](https://forums.unrealengine.com/u/anadre)\
**Post date:** [November 22, 2017, 1:11am UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/10 "2017-11-22T01:11:33Z")

</div>

I installed the Symbols, now I can tell a little more about the Crash.  
I hope this helps you fix this problem  
These are all tests of the simple project that I gave you  
If during your tests it does not crash more than 10 minutes then restart the game  
In 2 hours of my tests, it crash 5 times  
**1.**

```
Access violation - code c0000005 (first/second chance not available)
 
 UE4Editor_Slate!<lambda_c42855a8df853c2fca6077897314e16e>::operator()() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1558]
 UE4Editor_Slate!FSlateApplication::ForEachUser() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4464]
 UE4Editor_Slate!FSlateApplication::FinishedInputThisFrame() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1567]
 UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3277]
 UE4Editor!GuardedMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
 UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
 UE4Editor!WinMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
 UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
 kernel32
 ntdll

```

**2**  
Most often it Crash like this:

```
Access violation - code c0000005 (first/second chance not available)

UE4Editor_SlateCore!SWindow::IsVisible() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slatecore\private\widgets\swindow.cpp:1326]
UE4Editor_Slate!PrepassWindowAndChildren() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1336]
UE4Editor_Slate!FSlateApplication::DrawPrepass() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1391]
UE4Editor_Slate!FSlateApplication::PrivateDrawWindows() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1433]
UE4Editor_Slate!FSlateApplication::DrawWindows() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1190]
UE4Editor_Slate!FSlateApplication::TickApplication() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1777]
UE4Editor_Slate!FSlateApplication::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1595]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3378]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll

```

**3**

```
Access violation - code c0000005 (first/second chance not available)

UE4Editor_ApplicationCore!FWindowsWindow::`vftable'()
UE4Editor_SlateCore!SWidget::SlatePrepass() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slatecore\private\widgets\swidget.cpp:493]
UE4Editor_Slate!PrepassWindowAndChildren() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1343]
UE4Editor_Slate!FSlateApplication::DrawPrepass() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1391]
UE4Editor_Slate!FSlateApplication::PrivateDrawWindows() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1433]
UE4Editor_Slate!FSlateApplication::DrawWindows() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1190]
UE4Editor_Slate!FSlateApplication::TickApplication() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1777]
UE4Editor_Slate!FSlateApplication::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1595]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3378]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll

```

- Assert about which I wrote above:

**Summary:** you have invalid SWindow something it removes or nullifies,  
since All the crash + asserts happen at the moment when you try to turn to SWindow or maybe the culprit is TSharedPtr since the link to the window is stored in it

---

<div class="post-metadata">

**Author:** ![Curs0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/curs0/32/470295_2.png) [@Curs0](https://forums.unrealengine.com/u/Curs0)\
**Post date:** [November 27, 2017, 11:01am UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/11 "2017-11-27T11:01:28Z")

</div>

same crash here: VR preview in editor (no crash at all in standalone version), crash occurs both with vive or oculus, crash happens every 5-10 min, most common crash is the following:

```
Access violation - code c0000005 (first/second chance not available)
 
 UE4Editor_SlateCore!SWindow::IsVisible() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\slatecore\private\widgets\swindow.cpp:1326]

```

Epic pls give us at least a workaround  
thanks!

---

<div class="post-metadata">

**Author:** ![Rukarulez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rukarulez](https://forums.unrealengine.com/u/Rukarulez)\
**Post date:** [November 27, 2017, 11:10am UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/12 "2017-11-27T11:10:46Z")

</div>

same crash here… HELP!!

---

<div class="post-metadata">

**Author:** ![Curs0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/curs0/32/470295_2.png) [@Curs0](https://forums.unrealengine.com/u/Curs0)\
**Post date:** [November 27, 2017, 3:35pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/13 "2017-11-27T15:35:27Z")

</div>

some details from crash debug, hope it can helps guys at epic

when crash happens in SWindow.cpp:

bool SWindow::IsVisible() const  
{  
return NativeWindow.IsValid() && NativeWindow-\>IsVisible();  
}

this is NativeWindow status:

```
       - NativeWindow	Ptr=0x000001a099f1f700, SharedRefs=0, WeakRefs=1, Object={Definition=Ptr=0xdddddddddddddddd, SharedRefs=???, WeakRefs=???, Object={Type=??? XDesiredPositionOnScreen=??? YDesiredPositionOnScreen=??? ...} }	TSharedPtr<FGenericWindow,0>
        		[SharedReferenceCount]	0	int
        		[WeakReferenceCount]	1	int
        		[Ptr]	0x000001a099f1f700	void *
        + __vfptr	0x000001a099f1e980 {0x000001a099f1c280, 0xdddddddddddddddd, 0xdddddddddddddddd, 0xdddddddddddddddd, ...}	void * *
        + Definition	Ptr=0xdddddddddddddddd, SharedRefs=???, WeakRefs=???, Object={Type=??? XDesiredPositionOnScreen=??? YDesiredPositionOnScreen=??? ...}	TSharedPtr<FGenericWindowDefinition,0>
        + [Raw View]	{Object=0x000001a099f1f700 {Definition=Ptr=0xdddddddddddddddd, SharedRefs=???, WeakRefs=???, Object={Type=??? XDesiredPositionOnScreen=??? YDesiredPositionOnScreen=??? ...} } ...}	TSharedPtr<FGenericWindow,0>

```

when the crash happens, this is status of SlateWindows array has 3 value:

```
- SlateWindows	Num=3	TArray<TSharedRef<SWindow,0>,FDefaultAllocator>
+ [0]	Ptr=0x000001a16ec74110, SharedRefs=1, WeakRefs=45, Object={MoveResizeZone=-842150451 MoveResizeStart={X=-431602080. Y=-431602080. } MoveResizeRect={Left=-1.00000000 ...} ...}	TSharedRef<SWindow,0>
+ [1]	Ptr=0x000001a14b6d5610, SharedRefs=1, WeakRefs=9, Object={...}	TSharedRef<SWindow,0>
+ [2]	Ptr=0x000001a273ce1610, SharedRefs=1, WeakRefs=7, Object={MoveResizeZone=-842150451 MoveResizeStart={X=-431602080. Y=-431602080. } MoveResizeRect={Left=-1.00000000 ...} ...}	TSharedRef<SWindow,0>
+ [Raw View]	{AllocatorInstance={Data=0x000001a1674dd580 {...} } ArrayNum=3 ArrayMax=4 }	TArray<TSharedRef<SWindow,0>,FDefaultAllocator>
```

---

<div class="post-metadata">

**Author:** ![Curs0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/curs0/32/470295_2.png) [@Curs0](https://forums.unrealengine.com/u/Curs0)\
**Post date:** [November 27, 2017, 10:54pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/14 "2017-11-27T22:54:32Z")

</div>

I traced SWindow allocated memory and pointed out when it’s destroyed (just before the game crash as above detailed). Here is call stack:

```
UE4Editor-SlateCore.dll!SWidget::~SWidget() Line 133	
[Inline Frame] UE4Editor-SlateRHIRenderer.dll!SharedPointerInternals::FReferenceControllerOps<0>::ReleaseSharedReference(SharedPointerInternals::FReferenceControllerBase * ReferenceController) Line 351	
[Inline Frame] UE4Editor-SlateRHIRenderer.dll!SharedPointerInternals::FSharedReferencer<0>::{dtor}() Line 445	
UE4Editor-SlateRHIRenderer.dll!FSlateRHIRenderer::DrawWindow_RenderThread(FRHICommandListImmediate & RHICmdList, FSlateRHIRenderer::FViewportInfo & ViewportInfo, FSlateWindowElementList & WindowElementList, bool bLockToVsync, bool bClear) Line 874	
[Inline Frame] UE4Editor-SlateRHIRenderer.dll!FSlateRHIRenderer::DrawWindows_Private::__l29::<lambda_43e86ee7c51f39979e9a39d40b280024>::operator()(FRHICommandListImmediate &) Line 1043	
[Inline Frame] UE4Editor-SlateRHIRenderer.dll!TEnqueueUniqueRenderCommandType<`FSlateRHIRenderer::DrawWindows_Private'::`29'::SlateDrawWindowsCommandName,<lambda_43e86ee7c51f39979e9a39d40b280024> >::DoTask(ENamedThreads::Type) Line 189	
UE4Editor-SlateRHIRenderer.dll!TGraphTask<TEnqueueUniqueRenderCommandType<`FSlateRHIRenderer::DrawWindows_Private'::`29'::SlateDrawWindowsCommandName,<lambda_43e86ee7c51f39979e9a39d40b280024> > >::ExecuteTask(TArray<FBaseGraphTask *,FDefaultAllocator> & NewTasks, ENamedThreads::Type CurrentThread) Line 784	
[Inline Frame] UE4Editor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,FDefaultAllocator> & CurrentThread, ENamedThreads::Type) Line 466	
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 651	
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 560	
UE4Editor-RenderCore.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 327	
UE4Editor-RenderCore.dll!FRenderingThread::Run() Line 478	
UE4Editor-Core.dll!FRunnableThreadWin::Run() Line 76	
UE4Editor-Core.dll!FRunnableThreadWin::GuardedRun() Line 25

```

it seems that its SharedReferenceCount goes to 0 and main window is destroyed by the function ReleaseSharedReference

```
	SharedReferenceCount	0
	WeakReferenceCount	20
```

---

<div class="post-metadata">

**Author:** ![Curs0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/curs0/32/470295_2.png) [@Curs0](https://forums.unrealengine.com/u/Curs0)\
**Post date:** [November 27, 2017, 11:34pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/15 "2017-11-27T23:34:43Z")

</div>

this seems to be the same problem described in:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-51146)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-51727)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-51883)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

> **[\[UE-51146 | UE-51883 | UE-51727\] Crash in Editor VR Preview](https://forums.unrealengine.com/questions/730356/ue-51146-ue-51883-ue-51727-crash-in-editor-vr-prev.html)**
>
> Making this post as suggested by the bug pages for UE-51146, UE-51883, UE-51727; as I feel guilty having submitted crash reports at least 100 times with no useful context. In aggregate there is something of a pattern, but the individual instances...

> **[Crash Reproduction hints for UE-51146](https://forums.unrealengine.com/questions/719658/crash-reproduction-hints-for-ue-51146.html)**
>
> We hit the crash mentioned in UE-51146 every minute while printing debug text to the screen. I think you can probably reproduce this in any VR project by playing in VR and printing a few lines of debug text every tick. The crash should happen...

---

<div class="post-metadata">

**Author:** ![Rukarulez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rukarulez](https://forums.unrealengine.com/u/Rukarulez)\
**Post date:** [November 29, 2017, 8:17am UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/16 "2017-11-29T08:17:21Z")

</div>

Epic pls, try to include a fix in 4.18.2 or suggest us a workaround this is slowing down development and we are missing deadlines ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_250b3dab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_250b3dab](https://forums.unrealengine.com/u/anonymous_user_250b3dab)\
**Post date:** [November 29, 2017, 1:31pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/17 "2017-11-29T13:31:16Z")

</div>

This also affects PSVR, and matches the callstacks and descriptions made here. This issue is preventing us from rolling out 4.18.1 to our team.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_250b3dab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_250b3dab](https://forums.unrealengine.com/u/anonymous_user_250b3dab)\
**Post date:** [November 29, 2017, 2:11pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/18 "2017-11-29T14:11:34Z")

</div>

It could be that void FSlateRHIRenderer::DrawWindow\_RenderThread is calling WindowElementList.GetWindow()-\>GetSizeInScreen();  
GetWindow in this case is updating the reference counter. This is happening on RenderThread 2.  
The TSharedPtr is not of the thread-safe flavour.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_250b3dab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_250b3dab](https://forums.unrealengine.com/u/anonymous_user_250b3dab)\
**Post date:** [November 29, 2017, 3:26pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/19 "2017-11-29T15:26:14Z")

</div>

It could be that void FSlateRHIRenderer::DrawWindow\_RenderThread is calling WindowElementList.GetWindow()-\>GetSizeInScreen(); GetWindow in this case is updating the reference counter. This is happening on RenderThread 2. The TSharedPtr is not of the thread-safe flavour.

A work around that I have done is to create a new private pointer to the paint-window and have added a GetSizeInScreen function into FSlateWindowElementList that uses this pointer to call the SWindow’s GetSizeInScreen the Read only pointer is shadowing PaintWindow so that no SharedPtr or WeakPtr.Pin() is used.

i.e.  
In DrawElements.h

```
private:
	/** 
	 * Window which owns the widgets that are being painted but not necessarily rendered to
	 * Widgets are always rendered to the RenderTargetWindow
	 */
	TWeakPtr<SWindow> PaintWindow;
	SWindow* RO_PaintWindow;

public:
	FVector2D GetSizeInScreen() const;

```

Here the RO\_PaintWindow is the added pointer variable.  
And is initialised in the constructor

```
explicit FSlateWindowElementList( TSharedPtr<SWindow> InPaintWindow = nullptr )
	: PaintWindow(InPaintWindow)
	, RO_PaintWindow(InPaintWindow.IsValid() ? InPaintWindow.Get() : nullptr)
	, RenderTargetWindow(nullptr)
	, bNeedsDeferredResolve( false )
	, ResolveToDeferredIndex()
	, MemManager(0)
{
	DrawStack.Push(&RootDrawLayer);
}

```

In DrawElements.cpp check the TWeakPtr is valid before access;

```
FVector2D FSlateWindowElementList::GetSizeInScreen() const
{
	if (PaintWindow.IsValid() && RO_PaintWindow != nullptr)
	{
		return RO_PaintWindow->GetSizeInScreen();
	}
	else
	{
		return FVector2D(0, 0);
	}
}

```

In SlateRHIRenderer.cpp Change the 2 occurences of

```
const FVector2D WindowSize = WindowElementList.GetWindow()->GetSizeInScreen();

```

to

```
const FVector2D WindowSize = WindowElementList.GetSizeInScreen();

```

Game has been running for over an hour now.

---

<div class="post-metadata">

**Author:** ![Shadow.Storm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadow.Storm](https://forums.unrealengine.com/u/Shadow.Storm)\
**Post date:** [November 29, 2017, 4:10pm UTC](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057/20 "2017-11-29T16:10:49Z")

</div>

Hi all,

This has been fixed, and should be in 4.19. I am not able to move the fix to a 4.18 hotfix because it modifies a public header. However, if you do feel like doing source modifications, Lee’s fix is close to what we have done - it is indeed due to the Slate window being referenced on the render thread.

In the meantime, the workaround that we have found is to wait a minute or two after starting the editor before entering VR Mode. That /should/ help avoid crashes until the fix is available.

Thanks!  
Lauren

[Next page](https://forums.unrealengine.com/t/strange-slate-dll-crash-in-vr-mode/410057.md?page=2)
