msintuneappsdk / ms-intune-app-sdk-ios

Intune App SDK for iOS enables data protection and mobile app management features in iOS mobile apps with Microsoft Intune
84 stars 25 forks source link

App crashes on malloc request after app restart triggered by Intune SDK #426

Open niminim44 opened 2 weeks ago

niminim44 commented 2 weeks ago

Describe the bug: C++ call to malloc crashes the app after a restart has been triggered by Intune SDK.

To Reproduce Steps to reproduce the behavior:

  1. Launch the app and trigger a successful loginAndEnroll request.
  2. wait for APP to be calculated and for Intune to trigger an app restart.
  3. App will crash on my low level SDK when it calls malloc.

Expected behavior: Expecting app not to crash, malloc requests should work, and Intune should apply APP correctly.

tested on different devices and different OS versions. crash is consistent.

Intune App SDK for iOS (please complete the following information):

jitheshncxe commented 2 weeks ago

@niminim44 , had you collected/reviewed crash logs and see if that can provide additional clues? if so, do you see any of the MAM SDK APis on the stack? REF: https://developer.apple.com/library/archive/technotes/tn2151/_index.html

niminim44 commented 1 week ago

Hi @jitheshncxe

The crash logs have no MAM SDK APIs, but I have a feeling this is related to one of Intune hooks on app launch.

I am using Chromium in my code, and it has some checks related to the validity of memory zones in the app: https://chromium.googlesource.com/external/github.com/google/proto-quic/+/refs/heads/merge-to-59.0.3056.0/src/base/allocator/malloc_zone_functions_mac.cc#26

This macro function is evaluated to be false since all the function pointers are NULL. As a result the app crashes.

jitheshncxe commented 1 week ago

@niminim44, could you please share the full crash logs for me to take a look?

niminim44 commented 1 week ago

image (1)

jitheshncxe commented 1 week ago

Thanks @niminim44...Given the crash logs don't give us a clue, is it possible for you to share a minimal project which we could use to reproduce the error locally?

niminim44 commented 1 week ago

From privacy concerns I would prefer not to share it on this thread. Can you please send me (niminim44@gmail.com) or share here an email that I can share it with? (or any other private communication method) THX!

jitheshncxe commented 1 week ago

HI @niminim44 , I will send an email my from official id. Please share full crash logs (not the only crashing thread stack) and a repro application and will try to see what the issue may be...

jitheshncxe commented 1 day ago

@niminim44 , just checking if you had received an email from my official id and could share the repro and full crash logs so that we can look further into this issue...Thanks!