UE 4.25.1 crashing at startup on iOS 18.4

Hi!

We have gotten a huge increase in crashes on the iOS version of our game with the release of iOS 18.4.

All version of our game is affected, and it only happens on iOS 18.4. The previous versions of iOS are unaffected.

We are using UE 4.25.1.

Analyzing crash logs and testing the game, has not revealed any one point for the crash, but we have gathered some data which could help.

  • There might be a race condition. A few times the game does not crash on startup, and then works as intended.
  • It only happens in builds with the Shipping configuration
  • Several of the crashes happen in AsyncLoading.cpp during engine initialization.
    • MyActorClass -> ConstructorHelpers::FObjectFinder -> AsyncLoading.cpp -> crash
  • Occasionally the log will report that resources being loaded through ConstructorHelpers::FObjectFinder cannot be found; right before it crashes.
    • <Notice>: [UE4] CDO Constructor (MyActorClass): Failed to find ParticleSystem’…

We appreciate any suggestions on how to move forward, or to know if anyone else has had issues of instability with iOS 18.4.

Hi Sebastian,

Are you using a binary release of 4.25.1 or building from source? If building from source, which SDK/Xcode version are you targeting?

Best regards.

Hi Sébastien,

Looking at the 4.27 LTS, it does indeed appear this solution is in line with how the system has evolved equivalently with USE_OS_SMALL_BLOCK_GRAB_MEMORY_FROM_OS being disabled. Removal USE_OS_SMALL_BLOCK_ALLOC altogether would incur a performance penalty. You can consider back porting MallocBinned from 4.27+ should you need to reenable it.

Best regards.

Hi Stéphane,

We are building the engine from source with iOS 13.0 as minimum target using Xcode 16.1.

With some help, we have had success in tracking down a solution to the crashes.

The memory allocation for iOS has been updated in UE4.26, so this might only be applicable in <= UE4.25.x

In the constructor FMallocBinned::FMallocBinned in MallocBinned.cpp, there is an initialization for the nano malloc pool which is different in versions newer than UE4.25.x.

Our solution is to disable it by explicitly setting the pool block pointers to 0 on iOS >= 18.4, so that it wont be used on those platforms.

You could either disable USE_OS_SMALL_BLOCK_ALLOC altogether for all platforms or use our solution:

`#if USE_OS_SMALL_BLOCK_ALLOC

// Prevents segmentation fault in iOS 18.4 for UE4.25.x
if([Content removed] ))
{
Private::SmallBlockStartPtr = 0;
Private::SmallBlockEndPtr = 0;
}
// </OUR FIX>
else
{
//Do very early (very small) malloc so we can find where the initial nano malloc pool is
void
ptr = ::malloc(16);

//Round back down to 00’s address
Private::SmallBlockStartPtr = (uint64_t)ptr & ~(0x1fffffff);

//Add pool size to start pointer. Magic number comes from found instruments pool size of 512MB
Private::SmallBlockEndPtr = Private::SmallBlockStartPtr + Private::SMALL_BLOCK_MAX_TOTAL_POOL_SIZE;

::free(ptr);
}

#if USE_OS_SMALL_BLOCK_GRAB_MEMORY_FROM_OS`

Even tough we do not know the root cause of the problem, or what performance impact this change might have, we are happy with this solution for now.

Hopefully this helps anyone with the same issues.

Thank you for you suggestion! If we see a significant performance hit, we will look into the back porting option.