iOS 16.4.1 crash - VM - (arg = 0x0) pmap_enter retried due to resource shortage

These logs are from a Flutter app that is supposed to run on MDM devices too. The full log file is found attached.

Can someone help me find what might be the cause of the issue and/or guide me through possible solutions, please?

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Application Specific Information:
abort() called


Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage


Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	       0x1d3c50558 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x1f48ce118 pthread_kill + 268
2   libsystem_c.dylib             	       0x19c45a178 abort + 180
3   libswiftCore.dylib            	       0x107e58028 swift::fatalError(unsigned int, char const*, ...) + 56
4   libswiftCore.dylib            	       0x107e501c8 checkVersion() + 60
5   dyld                          	       0x1b445b1cc invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const + 168
6   dyld                          	       0x1b448daf0 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 172
7   dyld                          	       0x1b44348a0 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 528
8   dyld                          	       0x1b4433c18 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296
9   dyld                          	       0x1b44331b0 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
10  dyld                          	       0x1b44868dc dyld3::MachOFile::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, bool&) block_pointer) const + 160
11  dyld                          	       0x1b443f0bc dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 432
12  dyld                          	       0x1b443b8d8 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 448
13  dyld                          	       0x1b44345c4 dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const + 44
14  dyld                          	       0x1b4437d4c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 220
15  dyld                          	       0x1b4437d28 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 184
16  dyld                          	       0x1b4437d28 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 184
17  dyld                          	       0x1b445b258 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_1::operator()() const + 112
18  dyld                          	       0x1b443d6a0 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 304
19  dyld                          	       0x1b4473244 dyld4::APIs::runAllInitializersForMain() + 340
20  dyld                          	       0x1b444703c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3404
21  dyld                          	       0x1b4444cdc start + 1948

Thread 1:
0   libsystem_pthread.dylib       	       0x1f48c7b74 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	       0x1f48c7b74 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib       	       0x1f48c7b74 start_wqthread + 0

Replies

VM - (arg = 0x0) pmap_enter retried due to resource shortage

This indicates that the device was under memory pressure, but it does not cause a crash.

4 libswiftCore.dylib 0x107e501c8 checkVersion() + 60 5 dyld 0x1b445b1cc invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const + 168

These lines seem closer to the cause of the crash. It seems the dynamic loader was calling initializers for Swift objects and something in there crashed.

Does the crash only occur when the app was installed via MDM?

I suggest reproducing the issue, taking a sysdiagnose, and submitting feedback to Apple with the Sysdiagnose attached and a timestamp of when the crash occurred. This will give a lot more information to debug the issue.

Hi, thanks for taking the time to answer my question/issue.

Does the crash only occur when the app was installed via MDM?

Yeah, it is mostly happening via MDM (I say mostly cause one of our end users claims they have tried downloading from the app store and it crashed too). I forgot to add more details in my original post: we recently added "flavors" (targets) to our app so that we could distribute a "managed" version as a custom app via MDM, while the other flavor is on the app store for general public. Right now, the codebase is the same for both flavors (we still haven't modified the managed app yet) and the "non-managed" version works fine for the users, but the "managed" one keeps crashing when the client tries to open it after downloading via MDM.

Oh, the app (the Flutter ios project per se) was originally built using Objective-C and it's quite an old one. Not sure if this matters, though, but we are going to try migrating it to Swift and see if this changes the end result.

I suggest reproducing the issue, taking a sysdiagnose, and submitting feedback to Apple with the Sysdiagnose attached and a timestamp of when the crash occurred. This will give a lot more information to debug the issue.

Cool. Thank you for the suggestion. We are going to take a sysdiagnose and see if we can find something else that can lead us to a solution to this problem.

Thanks again for the response!