EXC_BAD_ACCESS crash on iOS on map load

I’m getting a persistent crash on returning to my menu map on iOS, but only in shipping builds. The map was previously used that session. It looks like a bug but I don’t fully understand the issue.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000268
VM Region Info: 0x268 is not in any region.  Bytes before following region: 4295736728

This was very, very hard to debug. I ended up using the command-line to re-symbolicate the crashed thread stack from the crash log. This was the result:

> UGameInstance::CreateGameModeForURL(FURL, UWorld*) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 384
> UGameInstance::CreateGameModeForURL(FURL, UWorld*) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 272
> UWorld::SetGameMode(FURL const&) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 136
> UEngine::LoadMap(FWorldContext&, FURL, UPendingNetGame*, FString&) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 3540
> UEngine::Browse(FWorldContext&, FURL, FString&) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 2964
> UEngine::TickWorldTravel(FWorldContext&, float) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 604
> UGameEngine::Tick(float, bool) (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 572
> FEngineLoop::Tick() (in PoppyAndBuddy419-IOS-Shipping.dSYM) + 4736

I’m not able to see what exact line the bad reference is occurring on (I assume it’s a bad reference). Can anyone shed any light on this?

Have you found the solution?

I haven’t had time to look again but I have a few hints. Someone suggested overriding a base GameMode function to spit out some info to see if it gets there before it crashes. But all in all, nah, haven’t been able to fix it. I’m deploying Dev Shipping builds to the app store right now as a workaround.

You try to add this in your target.cs file IF you are using github version of unreal. We are using launcher version so we can’t. Supposedly this will fix the problem

// Force ANSI allocator for game client
if(Target.Platform == UnrealTargetPlatform.IOS)
{
   GlobalDefinitions.Add("FORCE_ANSI_ALLOCATOR=1");
}

I guess I’m going to start using the source version then! I’ll try this out and let you know how it goes.

That didn’t make a difference I’m afraid, it still crashes.

However now I have a source build set up I can enable more logging than shipping allows under the launcher build.

We have found out recently that it was actually “AndroidSensorsAPI” plugin that caused the crash on iOS.
Cheers!