Packaged app on Macintosh closes in FMemory::MallocExternal call

  • Engine version: 4.25 Plus (custom built)
  • Hardvare: iMac late 2020

What we have experienced so far:

  • The Editor version and PIE are running fine on PC and Mac
  • Packaged PC version and “direct” start from VisualStudio with precooked data works fine
  • Packaged app and “direct” start from XCode with precooked data works fine on iphone/ipad

The problem is that the packaged app on Mac close itself right after start. (Debug, DebugGame, Development, Test builds are all the same). Result:

  • Most of the “runs” gave crash report (but lately there are not even a crash report shows up)
  • Crashes reports showed an FMemory::MallocExternal call in the callstack every time
  • In most cases the the crash report said “Out of Memory”
  • In several cases the crash report said BAD ACCESS (mostly nullptr, but sometimes a clearly invalid address)
  • In a few cases the crash report said “__cxa_guard_acquire detected recursive initialization”
  • In most cases based on the reports the app stops before the “main function” (root of the callstack is _dyld_start)

Running the project from XCode with precooked data also close exactly like the built app. Based on the FMemory::MallocExternal we experimented a bit at this point:

  • The first malloc is invoked from a (random) google library, namely libprotobuf.dylib (function: InitGeneralPool, feels like some static initializer stuff at dyld load time)
  • If we try to step at this point the run stops like “normal” as soon as we reach FMemory_GCreateMalloc_ThreadUnsafe
  • Experimenting (and tampering) around here showed that the app stops as soon as it tries to do anything except handling local variables (gut feeling: the dyld that we are in not yet loaded/initialized?)
  • At this point we also tried to eliminate this random lib from the project (we had a similar problem on oculus quest, where some similar rogue allocation happened to soon, resulting a check fail later)
  • build.cs search showed that this libprotobuf.dylib is used by GoogleVR (naturally disabled) and the WebRTC plugin. We modified the build.cs files to prevent them adding this dyld to the dependency list, but for some unknown reason the “InitGeneralPool” call still occures in our builds.

Note:
In some build we run into a signin error with dyld CEF3 - it is unclear if that is a later problem if the stars are alligned fine and the dyld order is lucky for us or it is an error that occures sooner because the signing settings are invalid/inconsistent.

Thank you in anticipation!