ITADN

Crash occurring when using Intune with Realm Java SDK

#1878Opensandeep-kumar-eptura 创建于 2025-11-25
T-BugFrequency:AlwaysRepro:AlwaysEncryption:On
### How frequently does the bug occur? Always ### Description Android: SIGSEGV with Realm 10.19.0 when Microsoft Intune MAM “Encrypt org data” policy is Required Upgrading Realm Java from 10.17.0 to 10.19.0 causes a native crash (SIGSEGV, SEGV_ACCERR) on Android when Microsoft Intune MAM policy “Encrypt org data” is set to Require. The same app, same policy, same Intune MAM SDK works fine on Realm 10.17.0. Appears related to changes in Realm Core’s mmap/protection behavior between 10.17.x and 10.19.0. ### Environment Realm Java: 10.19.0 Intune MAM SDK (Android): 12.0.2 (16KB page-size not compatible). Android: target/compile SDK 35–36, minSdk 29 Kotlin: 2.0.x RxJava3 ### Policies (Intune) Encrypt org data: Require Encrypt org data on enrolled devices: Require ### Configuration snippet Minimal Realm setup (project uses Realm encryption; same config works on 10.17.0): ``` val key: ByteArray = /* app-provided 64 bytes total, e.g. two concatenated 32-byte keys */ Realm.init(context) val config = RealmConfiguration.Builder() .encryptionKey(key) .name("app.realm") .schemaVersion(18L) .migration(Migrations()) .build() Realm.setDefaultConfiguration(config) ``` ### Stacktrace & log output ```shell Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xXXXXXXXXXXXX in tid NNNNN (RxCachedThreadS), pid PPPPP ``` ### Can you reproduce the bug? Always ### Reproduction Steps 1. Integrate Microsoft Intune MAM SDK (12.0.2) in an Android app. 2. Set Intune policy “Encrypt org data” to Require (and Require on enrolled devices). 3. Use Realm Java 10.19.0 with an encrypted Realm as shown above. 4. Launch the app and perform typical DB reads/writes (on background thread, Realm’s own HandlerThread). 5. App crashes with SIGSEGV. 6. With Realm Java 10.17.0 and the same policy + SDK, the app runs without crash. ### Expected Behavior No crash. Realm should work with MAM “Encrypt org data” policy enabled, as it does on 10.17.0. ### Version 10.19.0 ### What Atlas App Services are you using? -- select -- ### Are you using encryption? Yes ### Platform OS and version(s) Android ### Build environment - Android Studio version: Android Studio Otter | 2025.2.1 Patch 1 Build #AI-252.25557.131.2521.14432022, built on November 13, 2025 Runtime version: 21.0.8+-14196175-b1038.72 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 26.1 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 8192M Cores: 14 Metal Rendering is ON Registry: ide.instant.shutdown=false com.android.studio.ml.activeModel=com.android.studio.ml.AidaModel Non-Bundled Plugins: com.intellij.classic.ui (252.23892.201) com.github.copilot (1.5.61-243) - Android Build Tools version: 35.0.0 - Gradle version: 8.13 (Android Gradle Plugin 8.13.0) If useful: - Kotlin: 2.0.21 - compileSdk: 35 (app module) - NDK: 27.1.12297006
0 条评论