Description
App crashes with a native SIGSEGV (null pointer dereference) on Android in release mode. The crash originates from globalEnv_CallVoidMethod in libdartjni.so, which calls CallVoidMethodV with a null _jobject*.
We suspect this is related to Session Replay capturing screen state, as the Dart VM frames show a repeated iterative pattern consistent with widget tree traversal.
Environment
- Flutter: 3.38.9 (stable)
- Dart: 3.10.8
- datadog_flutter_plugin: 3.0.1
- datadog_session_replay: 1.0.0-preview.9
- datadog_tracking_http_client: 3.0.1
- datadog_dio: 2.0.0
- datadog_inappwebview_tracking: 2.0.0
- jni (transitive): 0.14.2
- Android NDK: 28.2.13676358
- R8/ProGuard: Disabled (
minifyEnabled is false)
- Device arch: arm64-v8a
Setup
Session Replay is enabled and wraps the entire app widget tree via SessionReplayCapture:
DatadogConfiguration(
// ...
nativeCrashReportEnabled: true,
rumConfiguration: DatadogRumConfiguration(applicationId: applicationId),
site: DatadogSite.us5,
)..enableSessionReplay(
DatadogSessionReplayConfiguration(
textAndInputPrivacyLevel: TextAndInputPrivacyLevel.maskSensitiveInputs,
touchPrivacyLevel: TouchPrivacyLevel.show,
replaySampleRate: replaySampleRate,
),
);
Debug mode already skips Datadog initialization entirely (to avoid the hot-restart JNI crash from #932).
Tombstone (symbolicated)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
#00 pc 0x3150bc art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(
art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)
[libart.so]
#01 pc 0x620a84 art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)
[libart.so]
#02 pc 0x10650 globalEnv_CallVoidMethod
[libdartjni.so]
#03 pc 0x7d1b34 dlc.vmcode
#04 pc 0xae07ec dlc.vmcode
#05 pc 0xaeb420 dlc.vmcode
#06 pc 0xaeb354 dlc.vmcode
#07 pc 0xaeb1b0 dlc.vmcode
#08 pc 0xaeac98 dlc.vmcode
#09 pc 0xae96f0 dlc.vmcode
#10 pc 0xad8d24 dlc.vmcode
#11 pc 0xae9644 dlc.vmcode
#12 pc 0xad8984 dlc.vmcode
#13 pc 0x11f7584 dlc.vmcode
#14 pc 0x801260 dlc.vmcode
#15 pc 0x8010e4 dlc.vmcode
#16 pc 0x7fe2e8 dlc.vmcode
#17 pc 0x7ff904 dlc.vmcode
#18 pc 0x11f7980 dlc.vmcode
#19 pc 0xaf765c dlc.vmcode
#20 pc 0x11f7584 dlc.vmcode
#21 pc 0x801260 dlc.vmcode
#22 pc 0x8010e4 dlc.vmcode
#23 pc 0x7fe2e8 dlc.vmcode
#24 pc 0x7ff904 dlc.vmcode
#25 pc 0x11f7aac dlc.vmcode
#26 pc 0x818104 dlc.vmcode
#27 pc 0x11f7584 dlc.vmcode
#28 pc 0x11f8474 dlc.vmcode
#29 pc 0x7e1690 dlc.vmcode
#30 pc 0x7e1584 dlc.vmcode
#31 pc 0x7e1548 dlc.vmcode
#32 pc 0x7d426c dlc.vmcode
#33 pc 0xe6d7fc libflutter.so
#34 pc 0xdb3df8 libflutter.so
#35 pc 0xcfd3d0 libflutter.so
#36 pc 0xe716b4 libflutter.so
#37 pc 0xe9dcc4 libflutter.so
#38–#49 libflutter.so / libutils.so
Analysis
Related
Description
App crashes with a native SIGSEGV (null pointer dereference) on Android in release mode. The crash originates from
globalEnv_CallVoidMethodinlibdartjni.so, which callsCallVoidMethodVwith a null_jobject*.We suspect this is related to Session Replay capturing screen state, as the Dart VM frames show a repeated iterative pattern consistent with widget tree traversal.
Environment
minifyEnabledis false)Setup
Session Replay is enabled and wraps the entire app widget tree via
SessionReplayCapture:Debug mode already skips Datadog initialization entirely (to avoid the hot-restart JNI crash from #932).
Tombstone (symbolicated)
Analysis
_jobject*parameter — the Java object being called on is nulldlc.vmcodeframe pattern (frames 📝 Minor language / spelling fixes to CONTRIBUTING #14–Initial support for manual RUM #17 ≈ 💥 Change Datadog() to Datadog.instance #21–Adding logging and error handling #24) suggests an iterative traversal, possibly Session Replay walking the widget treeRelated