Description

Engine built with Clang throws an exception when calling RtlVirtualUnwind with a different thread ID. Engines built with Microsoft compilers do not occur this problem.

 

For example, if starting PIE is blocked for more than 2 seconds, StallDetecter will raise this exception.

Steps to Reproduce
  1. Build the editor with clang
  2. Launch the editor from Visual Studio giving any project and the following command line -ExecCmds="CriticalPathStall.TickStartFrame 2000

 

Result:

Visual Studio reports an access violation in RtlpUnwindPrologue. see call stack.

 

Another repro step

  1. Build the editor with clang
  2. put the following code in any location
    	TArray<uint64> Backtrace;
    	Backtrace.AddUninitialized(100);
    	// Capturing a back trace of another thread
    	int32 NumStackEntries = FPlatformStackWalk::CaptureThreadStackBackTrace(GRenderThreadId, Backtrace.GetData(), Backtrace.Num());
    
  1. Launch the editor and execute the code
     
Callstack

ntdll.dll!RtlpUnwindPrologue()    Unknown
ntdll.dll!RtlpxVirtualUnwind()    Unknown
ntdll.dll!RtlVirtualUnwind()    Unknown
kernel32.dll!RtlVirtualUnwindStub()    Unknown
UnrealEditor-Core-Win64-Debug.dll!FMicrosoftPlatformStackWalk::CaptureStackTraceInternal(unsigned __int64 * OutBacktrace, unsigned int MaxDepth, void * InContext, void * InThreadHandle, unsigned int * OutDepth) Line 120    C++
UnrealEditor-Core-Win64-Debug.dll!FWindowsPlatformStackWalk::CaptureStackTraceByProcess(unsigned __int64 * OutBacktrace, unsigned int MaxDepth, void * InContext, void * InThreadHandle, unsigned int * OutDepth, bool bExternalProcess) Line 280    C++
UnrealEditor-Core-Win64-Debug.dll!FWindowsPlatformStackWalk::CaptureThreadStackBackTrace(unsigned __int64 ThreadId, unsigned __int64 * BackTrace, unsigned int MaxDepth, void * Context) Line 344    C++
UnrealEditor-Core-Win64-Debug.dll!UE::FStallDetectorRunnable::Run() Line 155    C++
UnrealEditor-Core-Win64-Debug.dll!FRunnableThreadWin::Run() Line 146    C++
kernel32.dll!BaseThreadInitThunk()    Unknown
ntdll.dll!RtlUserThreadStart()    Unknown

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-203700 in the post.

1
Login to Vote

Unresolved
ComponentUE - Foundation - Core
Affects Versions5.3
Target Fix5.5
CreatedJan 11, 2024
UpdatedFeb 29, 2024