microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
45 stars 18 forks source link

[ANR] while executing service com.microsoft.intune.mam.client.service.MAMBackgroundJobService #231

Open singh-srikant opened 7 months ago

singh-srikant commented 7 months ago

Summary

ANR is observed at app's startup process due to main thread waiting for too long while executing the service com.microsoft.intune.mam.client.service.MAMBackgroundJobService The crash has 1.85K events affecting 556 users over the last 7 days. Most of the occurrences are on Android 14 and Samsung devices.

"main" tid=1 Waiting
Main thread
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:211)
  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
  at java.util.concurrent.FutureTask.get (FutureTask.java:190)
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl.waitForTestIpc
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl.initialize
  at com.microsoft.intune.mam.client.ipcclient.MAMClientSingletonImpl.ensureInitialized
  at com.microsoft.intune.mam.client.app.ApplicationBehaviorImpl.attachBaseContext
  at java.lang.reflect.Method.invoke (Native method)
  at com.microsoft.intune.mam.InterProxy$InterInvocationHandler.invoke
  at java.lang.reflect.Proxy.invoke (Proxy.java:1006)
  at com.microsoft.intune.mam.client.app.ApplicationBehavior.attachBaseContext (SourceFile)
  at com.microsoft.intune.mam.client.app.MAMApplication$Impl.attachBaseContext (SourceFile:49)
  at com.microsoft.intune.mam.client.app.MAMApplication.attachBaseContext (unavailable)
  at com.adobe.reader.ARApp.attachBaseContext (SourceFile:1)
  at android.app.Application.attach (Application.java:368)
  at android.app.Instrumentation.newApplication (Instrumentation.java:1290)
  at android.app.LoadedApk.makeApplicationInner (LoadedApk.java:1487)
  at android.app.LoadedApk.makeApplicationInner (LoadedApk.java:1424)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7451)
This frame indicates that the app process was starting when the ANR was detected. The frames above this line can give an indication as to what was causing the slow process start. [Learn more](https://developer.android.com/topic/performance/anrs/diagnose-and-fix-anrs#example-slow)

  at android.app.ActivityThread.-$$Nest$mhandleBindApplication (unavailable)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2382)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:224)
  at android.os.Looper.loop (Looper.java:318)
  at android.app.ActivityThread.main (ActivityThread.java:8762)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:561)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)

Details

Logs

  Thread 19
"Intune MAM enrollment retry" tid=19 Timed Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at android.os.ConditionVariable.block (ConditionVariable.java:128)
  at com.microsoft.intune.mam.policy.MAMWETaskQueue.getDueTasks
  at com.microsoft.intune.mam.policy.MAMWERetryScheduler$TaskRunner.run
  at java.lang.Thread.run (Thread.java:1012)

  Thread 17
"Intune MAM file logger" tid=17 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:341)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block (AbstractQueuedSynchronizer.java:506)
  at java.util.concurrent.ForkJoinPool.unmanagedBlock (ForkJoinPool.java:3466)
  at java.util.concurrent.ForkJoinPool.managedBlock (ForkJoinPool.java:3437)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:1623)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:435)
  at com.microsoft.intune.mam.log.ThreadedFileHandler$PublishRunner.run

  Thread 21
"Intune MAM background-0" tid=21 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:211)
  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
  at java.util.concurrent.FutureTask.get (FutureTask.java:190)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.invoke
  at com.microsoft.intune.mam.client.ipc.AppPolicyEndpointProxy.hasManagedApps
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl.testIPC
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl.lambda$testIpcAsync$3
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl.$r8$lambda$BXlyUSt126kE_uTl4rtc1b78uL4 (unavailable)
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl$$ExternalSyntheticLambda8.call (unavailable:2)
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 22
"Intune MAM IPC-0" tid=22 Native
  #00  pc 0x00000000000e8c9c  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+12)
  #01  pc 0x000000000009f5b4  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+160)
  #02  pc 0x0000000000084d58  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #03  pc 0x00000000000400d8  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #04  pc 0x00000000000663ec  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+284)
  #05  pc 0x000000000006780c  /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse+120)
  #06  pc 0x0000000000067504  /system/lib64/libbinder.so (android::IPCThreadState::transact+224)
  #07  pc 0x000000000007f800  /system/lib64/libbinder.so (android::BpBinder::transact+236)
  #08  pc 0x00000000001bdf90  /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact+156)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (BinderProxy.java:639)
  at android.content.ContentProviderProxy.call (ContentProviderNative.java:784)
  at android.content.ContentResolver.call (ContentResolver.java:2469)
  at android.content.ContentResolver.call (ContentResolver.java:2449)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.callAgentContentProvider
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.makeContentProviderCall
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.doAgentIpc
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.lambda$invoke$0
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.$r8$lambda$4ul3oLE8a3KiHXWtLIaVNHTwAeU (unavailable)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler$$ExternalSyntheticLambda0.call (unavailable:10)
  at com.microsoft.intune.mam.client.identity.IdentityCallable.call
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 23
"Intune MAM background-1" tid=23 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:211)
  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
  at java.util.concurrent.FutureTask.get (FutureTask.java:190)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.invoke
  at com.microsoft.intune.mam.client.ipc.AppPolicyEndpointProxy.prefetchCurrentFileEncryptionKey
  at com.microsoft.intune.mam.client.ipcclient.MAMClientImpl.prefetchCurrentFileEncryptionKey
  at com.microsoft.intune.mam.client.fileencryption.FileEncryptionKeyCacheImpl.lambda$startKeyFetchAsync$0
  at com.microsoft.intune.mam.client.fileencryption.FileEncryptionKeyCacheImpl.$r8$lambda$b9B5XSzcG0Ia6aeMGPt_fz_3riM (unavailable)
  at com.microsoft.intune.mam.client.fileencryption.FileEncryptionKeyCacheImpl$$ExternalSyntheticLambda0.run (unavailable:2)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 24
"Intune MAM IPC-1" tid=24 Native
  #00  pc 0x00000000000e8c9c  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+12)
  #01  pc 0x000000000009f5b4  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+160)
  #02  pc 0x0000000000084d58  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #03  pc 0x00000000000400d8  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #04  pc 0x00000000000663ec  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+284)
  #05  pc 0x000000000006780c  /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse+120)
  #06  pc 0x0000000000067504  /system/lib64/libbinder.so (android::IPCThreadState::transact+224)
  #07  pc 0x000000000007f800  /system/lib64/libbinder.so (android::BpBinder::transact+236)
  #08  pc 0x00000000001bdf90  /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact+156)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (BinderProxy.java:639)
  at android.content.ContentProviderProxy.call (ContentProviderNative.java:784)
  at android.content.ContentResolver.call (ContentResolver.java:2469)
  at android.content.ContentResolver.call (ContentResolver.java:2449)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.callAgentContentProvider
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.makeContentProviderCall
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.doAgentIpc
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.lambda$invoke$0
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.$r8$lambda$4ul3oLE8a3KiHXWtLIaVNHTwAeU (unavailable)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler$$ExternalSyntheticLambda0.call (unavailable:10)
  at com.microsoft.intune.mam.client.identity.IdentityCallable.call
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 26
"Intune MAM background-3" tid=26 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:211)
  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
  at java.util.concurrent.FutureTask.get (FutureTask.java:190)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.invoke
  at com.microsoft.intune.mam.client.ipc.AppPolicyEndpointProxy.isSharedDevice
  at com.microsoft.intune.mam.client.ipc.SdmInfoRepository.initialize$lambda$0
  at com.microsoft.intune.mam.client.ipc.SdmInfoRepository.$r8$lambda$UodT2RUC5JHdqcf4zoc5gVuABEU (unavailable)
  at com.microsoft.intune.mam.client.ipc.SdmInfoRepository$$ExternalSyntheticLambda1.call (unavailable:2)
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 27
"Intune MAM IPC-2" tid=27 Native
  #00  pc 0x00000000000e8c9c  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+12)
  #01  pc 0x000000000009f5b4  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+160)
  #02  pc 0x0000000000084d58  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #03  pc 0x00000000000400d8  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #04  pc 0x00000000000663ec  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+284)
  #05  pc 0x000000000006780c  /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse+120)
  #06  pc 0x0000000000067504  /system/lib64/libbinder.so (android::IPCThreadState::transact+224)
  #07  pc 0x000000000007f800  /system/lib64/libbinder.so (android::BpBinder::transact+236)
  #08  pc 0x00000000001bdf90  /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact+156)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (BinderProxy.java:639)
  at android.content.ContentProviderProxy.call (ContentProviderNative.java:784)
  at android.content.ContentResolver.call (ContentResolver.java:2469)
  at android.content.ContentResolver.call (ContentResolver.java:2449)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.callAgentContentProvider
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.makeContentProviderCall
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.doAgentIpc
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.lambda$invoke$0
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.$r8$lambda$4ul3oLE8a3KiHXWtLIaVNHTwAeU (unavailable)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler$$ExternalSyntheticLambda0.call (unavailable:10)
  at com.microsoft.intune.mam.client.identity.IdentityCallable.call
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 29
"Intune MAM background-4" tid=29 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:211)
  at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
  at java.util.concurrent.FutureTask.get (FutureTask.java:190)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.invoke
  at com.microsoft.intune.mam.client.ipc.AppPolicyEndpointProxy.getSdmInfo
  at com.microsoft.intune.mam.client.ipc.SdmInfoRepository.resetSdmInfoFuture$lambda$1
  at com.microsoft.intune.mam.client.ipc.SdmInfoRepository.$r8$lambda$hZZA1J0bOdlxrCX642adxdB1NG0 (unavailable)
  at com.microsoft.intune.mam.client.ipc.SdmInfoRepository$$ExternalSyntheticLambda2.call (unavailable:2)
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

  Thread 31
"Intune MAM IPC-3" tid=31 Native
  #00  pc 0x00000000000e8c9c  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+12)
  #01  pc 0x000000000009f5b4  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+160)
  #02  pc 0x0000000000084d58  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #03  pc 0x00000000000400d8  /data/data/com.adobe.reader/mam_libs/arm64-v8a/libmsmdmarp.so
  #04  pc 0x00000000000663ec  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+284)
  #05  pc 0x000000000006780c  /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse+120)
  #06  pc 0x0000000000067504  /system/lib64/libbinder.so (android::IPCThreadState::transact+224)
  #07  pc 0x000000000007f800  /system/lib64/libbinder.so (android::BpBinder::transact+236)
  #08  pc 0x00000000001bdf90  /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact+156)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (BinderProxy.java:639)
  at android.content.ContentProviderProxy.call (ContentProviderNative.java:784)
  at android.content.ContentResolver.call (ContentResolver.java:2469)
  at android.content.ContentResolver.call (ContentResolver.java:2449)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.callAgentContentProvider
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.makeContentProviderCall
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.doAgentIpc
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.lambda$invoke$0
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler.$r8$lambda$4ul3oLE8a3KiHXWtLIaVNHTwAeU (unavailable)
  at com.microsoft.intune.mam.client.ipc.ContentProviderEndpointProxy$EndpointProxyInvocationHandler$$ExternalSyntheticLambda0.call (unavailable:10)
  at com.microsoft.intune.mam.client.identity.IdentityCallable.call
  at java.util.concurrent.FutureTask.run (FutureTask.java:264)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

AndroidX Dependencies

If your app includes any AndroidX libraries, please list them here, along with the version info:

androidxCore = "1.10.1" androidxLifecycle = "2.4.1" androidxWorkManager = "2.8.1" androidxNavigation = "2.5.2" androidxStartupRuntime = "1.1.0" androidxDatastore = "1.0.0"

Third-Party Library Dependencies

If your app includes any third-party libraries, please list them here, along with the version info:

ChismanRaheem commented 5 months ago

HI @singh-srikant kindly upgrade to the most recent SDK version. Additionally, for further assistance, submit the complete crash report along with the steps needed to replicate the problem.