Intermittent SIGSEGV crashes on startup on IOS devices

Intermittent crashes on IOS devices. We are having trouble getting a proper trace : can’t repro on office devices. The .ips file we get from QA don’t seem to desymbolicate completely when loaded into xcode ( see xcode-log.txt )

Attachments:

.ips from device : kards-2025-04-23-084635.UNKNOWN ( should have .crash extension - this is the .ips file, renamed to have .crash extension )

runtime log from 3uTools : 23042025_084659_652_iPhone.LOG

<br> “exception” : {“codes”:“0x0000000000000001, 0x0000000000003768”,“rawCodes”:[1,14184],“type”:“EXC_BAD_ACCESS”,“signal”:“SIGSEGV”,“subtype”:“KERN_INVALID_ADDRESS at 0x0000000000003768”},

We will persist in trying to replicate the crash when connected to xcode, but as it is very intermittent, this is tricky.

So far QA seems to be getting fairly consistent crashes on an iPhone 14 device, even with a fairly bare test project

Ok, got a proper stacktrace, steps for ref

IncludeCrashReporter=True

Client sends report to Testflight

Testflight->Crashes->Open in XCode

Seems to be InitDynamicShadows root cause

Thread 20 name: Thread 20 Crashed: 0 libsystem_kernel.dylib 0x00000001ddfb42ec __pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x00000001f1da7c0c pthread_kill + 268 (pthread.c:1721) 2 libsystem_c.dylib 0x000000019d2b3ba0 abort + 180 (abort.c:118) 3 kards 0x0000000100909ca4 FGenericPlatformMisc::RequestExit(bool, char16_t const*) + 112 (GenericPlatformMisc.cpp:936) 4 kards 0x0000000100a67ffc FIOSPlatformMisc::RequestExit(bool, char16_t const*) + 16 (IOSPlatformMisc.cpp:1860) 5 kards 0x0000000100a67ffc FIOSErrorOutputDevice::Serialize(char16_t const*, ELogVerbosity::Type, FName const&) + 184 (IOSErrorOutputDevice.cpp:29) 6 kards 0x0000000100b463a0 FOutputDevice::LogfImpl(char16_t const*, ...) + 220 (OutputDevice.cpp:70) 7 kards 0x0000000100aaae74 void FOutputDevice::Logf<char16_t [49], char const*, char const*, int, char16_t*>(char16_t const (&) [49], char const*, char const*, int, char16_t*) + 20 (OutputDevice.h:249) 8 kards 0x0000000100aaae74 AssertFailedImplV(char const*, char const*, int, void*, char16_t const*, char*) + 104 (AssertionMacros.cpp:148) 9 kards 0x0000000100aaae74 FDebug::CheckVerifyFailedImpl2(char const*, char const*, int, char16_t const*, ...) + 308 (AssertionMacros.cpp:646) 10 kards 0x0000000103f7af7c TArray<FMeshBatchAndRelevance, TConcurrentLinearArrayAllocator<FSceneRenderingBlockAllocationTag>>::RangeCheck(int) const + 52 (Array.h:758) 11 kards 0x0000000103f7af7c TArray<FMeshBatchAndRelevance, TConcurrentLinearArrayAllocator<FSceneRenderingBlockAllocationTag>>::operator[](int) const + 52 (Array.h:843) 12 kards 0x0000000103f7af7c FProjectedShadowInfo::SetupMeshDrawCommandsForProjectionStenciling(FSceneRenderer&, FInstanceCullingManager&) + 2568 (ShadowSetup.cpp:2629) 13 kards 0x0000000103fb83dc FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&)::$_23::operator()() + 780 (ShadowSetup.cpp:4714) 14 kards 0x0000000103fb83dc decltype(Forward<FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&)::$_23&>(fp)()) Invoke<FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&)::$_23&>(FS... + 780 (Invoke.h:47) 15 kards 0x0000000103fb83dc UE::Tasks::Private::TExecutableTaskBase<FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&)::$_23, void, void>::ExecuteTask() + 824 (TaskPrivate.h:855) 16 kards 0x0000000100a8aaec UE::Tasks::Private::FTaskBase::TryExecuteTask() + 192 (TaskPrivate.h:504) 17 kards 0x0000000100a8b030 UE::Tasks::Private::FTaskBase::TryUnlock(bool&) + 424 (TaskPrivate.h:610) 18 kards 0x0000000103f878c0 UE::Tasks::Private::FTaskBase::TryLaunch(unsigned long long) + 72 (TaskPrivate.h:381) 19 kards 0x0000000103f878c0 void UE::Tasks::Private::FTaskHandle::Launch<FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&)::$_23, UE::Tasks::Private::FTaskHandle&>(char16_t const*, FSceneRenderer::Gath... + 228 (Task.h:153) 20 kards 0x0000000103f878c0 UE::Tasks::TTask<TInvokeResult<FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&)::$_23>::Type> UE::Tasks::Launch<FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShad... + 228 (Task.h:292) 21 kards 0x0000000103f878c0 FSceneRenderer::GatherShadowDynamicMeshElements(FDynamicShadowsTaskData&) + 8228 (ShadowSetup.cpp:4694) 22 kards 0x0000000103f8b178 FSceneRenderer::FinishGatherShadowPrimitives(FDynamicShadowsTaskData*) + 1248 (ShadowSetup.cpp:5321) 23 kards 0x0000000103f94f50 FSceneRenderer::FinishInitDynamicShadows(FRDGBuilder&, FDynamicShadowsTaskData*) + 1396 (ShadowSetup.cpp:6549) 24 kards 0x0000000103f96174 FSceneRenderer::InitDynamicShadows(FRDGBuilder&, FInstanceCullingManager&) + 44 (ShadowSetup.cpp:6622) 25 kards 0x0000000103f96174 FMobileSceneRenderer::InitDynamicShadows(FRDGBuilder&, FInstanceCullingManager&) + 936 (ShadowSetupMobile.cpp:308) 26 kards 0x000000010393df98 FMobileSceneRenderer::InitViews(FRDGBuilder&, FSceneTexturesConfig&, FInstanceCullingManager&, FVirtualTextureUpdater*, FMobileSceneRenderer::FInitViewTaskDatas&) + 6016 (MobileShadingRenderer.cpp:713) 27 kards 0x0000000103941b60 FMobileSceneRenderer::Render(FRDGBuilder&) + 2936 (MobileShadingRenderer.cpp:1033) 28 kards 0x0000000103e0e3dc RenderViewFamilies_RenderThread(FRHICommandListImmediate&, TArray<FSceneRenderer*, TSizedDefaultAllocator<32>> const&) + 1432 (SceneRendering.cpp:0) 29 kards 0x0000000103e0e3dc FRendererModule::BeginRenderingViewFamilies(FCanvas*, TArrayView<FSceneViewFamily*, int>)::$_36::operator()(FRHICommandListImmediate&) const + 1596 (SceneRendering.cpp:5119) 30 kards 0x0000000103e10ff4 TEnqueueUniqueRenderCommandType<TRenderCommandTag<FRendererModule::BeginRenderingViewFamilies(FCanvas*, TArrayView<FSceneViewFamily*, int>)::TSTR_FDrawSceneCommand5113>, FRendererModule::BeginRende... + 16 (RenderingThread.h:263) 31 kards 0x0000000103e10ff4 TGraphTask<TEnqueueUniqueRenderCommandType<TRenderCommandTag<FRendererModule::BeginRenderingViewFamilies(FCanvas*, TArrayView<FSceneViewFamily*, int>)::TSTR_FDrawSceneCommand5113>, FRendererModule:... + 812 (TaskGraphInterfaces.h:1235) 32 kards 0x0000000100846b70 FBaseGraphTask::Execute(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32>>&, ENamedThreads::Type, bool) + 64 (TaskGraphInterfaces.h:840) 33 kards 0x0000000100846b70 FNamedTaskThread::ProcessTasksNamedThread(int, bool) + 1560 (TaskGraph.cpp:760) 34 kards 0x0000000100845564 FNamedTaskThread::ProcessTasksUntilQuit(int) + 200 (TaskGraph.cpp:650) 35 kards 0x000000010226e354 RenderingThreadMain(FEvent*) + 1600 (RenderingThread.cpp:413) 36 kards 0x0000000102287ee4 FRenderingThread::Run() + 60 (RenderingThread.cpp:564) 37 kards 0x00000001009a94c8 FRunnableThreadPThread::Run() + 276 (PThreadRunnableThread.cpp:25) 38 kards 0x000000010092b748 FRunnableThreadPThread::_ThreadProc(void*) + 120 (PThreadRunnableThread.h:187) 39 libsystem_pthread.dylib 0x00000001f1da606c _pthread_start + 136 (pthread.c:931) 40 libsystem_pthread.dylib 0x00000001f1da10d8 thread_start + 8 (:-1)

Hmm. Here’s another from our TestProject, which shows something different

Thread 8 Crashed: 0 TestProject 0x0000000102e1faa4 Modules_Initialize() + 592 1 TestProject 0x0000000102f921a8 FTraceAuxiliary::Initialize(char16_t const*) + 4080 2 TestProject 0x0000000108f3aa7c FEngineLoop::PreInitPreStartupScreen(char16_t const*) + 396 3 TestProject 0x0000000108f2f864 FEngineLoop::PreInit(char16_t const*) + 24 4 TestProject 0x0000000108f2f500 FAppEntry::Init() + 128 5 TestProject 0x000000010380b0d4 -[IOSAppDelegate MainAppThread:] + 300 6 Foundation 0x0000000199c0d6c8 __NSThread__start__ + 724 (NSThread.m:991) 7 libsystem_pthread.dylib 0x000000022338137c _pthread_start + 136 (pthread.c:931) 8 libsystem_pthread.dylib 0x000000022337c494 thread_start + 8 (:-1)

Hi Tuomas,

This issue was resolved by CL#39110670 and further resolved in CL#41112091.

Best regards

Hi Tuomas,

Apologies, the links have been updated in the previous response.

Best regards.

Hi Tuomas,

The CLs above should have addressed the assertiong that was triggering within InitDynamicShadows which you reported earlier. This seems to be a different issue. Can you confirm the command line being used when this crash reading the results of syscal task_info occurs? Does the issue occur on different devices/iOS versions?

Best regards.

Latest test round, only crashing on an iPad (9th generation), iOS 17.6.1

2 crashes out of 15 launches

ADD: TestProject : no crashes : O

Have tried disabling a bunch of plugins in main project to no avail. Hmm hmm

[Image Removed]

Hi Tuomas,

We haven’t successfully reproduced locally, however, based on the crash info, believe the diff below should resolve. If you are able to confirm, it would be greatly appreciated.

[Image Removed]Note that the code in question should only be included in non shipping builds.

Best regards.

Thanks Tuomas, we’ll stay on the lookout for the issue or updates from your end/

Best regards.

I don’t know how to locate a CL in github by CL#. Please provide github links or hashes?

In perforce, I presume this would be easier. Perhaps we should request p4 access to engine?

Super thanks! Will report back on Monday to confirm we have solved it.

Still crashing. Will repro on a test project as well as soon as I can

  1. Can you confirm the command line being used when this crash reading the results of syscal task_info occurs? I am not sure what this means? I can’t see syscal or task_info in the crash log.
  2. Crash per devices, with a test run of 10 launches per device :

Round 1

iPhone 13 mini // iOS 18.1 ( not crashing )

iPhone 14 // iOS 18.2.1 - 1 crash

iPhone 11 pro max // iOS 15.0 - 1 crash

iPad (9th generation) // iOS 17.1 ( not crashing )

Round 2

iPhone 13 mini // iOS 18.1

iPhone 14 // iOS 18.2.1 - 1 crash

iPhone 11 pro max // iOS 15.0

iPad (9th generation) // iOS 17.1

NOTE : I can’t get the TestProject to crash any more, hmm. Proceeding to strip out non-essential plugins to see if that makes a difference…

We have integrated changes mentioned in this thread:

https://github.com/EpicGames/UnrealEngine/commit/c2f5dcbeb2936ff7fd2b9af8e2f3f6322505ce80

https://github.com/EpicGames/UnrealEngine/commit/330de5ad0c5f3712a2141905b1aa1e6a88f93951

and from another thread:

https://github.com/EpicGames/UnrealEngine/commit/639640629e0684271dc553440d56f1e080a7da0b

https://github.com/EpicGames/UnrealEngine/commit/56d7d2b7bdc3389eed554121aa88c760f85cfc08

Roger that - will test first thing tomorrow.

Current state :

<< iPhone 11 Pro Max ( iOS 15 ) - 3/12 crashes >>

iPad 9gen 2021 ( iOS 17.6.1 ) - 0/12 crashes

iPhone 13 mini ( iOS 18.3.2 ) - 0/12 crashes

iPhone 8 ( iOS 16.7.7 ) - 0/12 crashes

iPhone X ( iOS 16.5.1 ) - 0/12 crashes

iPhone Xs ( iOS 18.1.1 ) - 0/12 crashes

iPad 8 ( iOS 18.1.1 ) - 0/12 crashes

I am acquiring the iPhone 11 tomorrow to see if I can get repro and more clues…

EDIT : Added iOS versions and more devices. So far iOS 15 only, hmm.