bugsnag / bugsnag-android

BugSnag crash monitoring and reporting tool for Android apps
https://www.bugsnag.com/platforms/android/
Other
1.19k stars 205 forks source link

Ensure NDK environment is properly initialized before using it #2064

Closed lemnik closed 3 months ago

lemnik commented 3 months ago

Goal

Avoid racing ourselves during multi-threaded startups.

Changes

request_env_write_lock now returns the bsg_environment* that should captured locally and addressed. If the method returns NULL the lock is not acquired (released before returning) so null-checks on the returned bsg_environment* can exit immediately (after basic cleanup) without being concerned with releasing the lock.

Testing

Relied on existing tests

bugsnagbot commented 3 months ago

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1852.99 1674.68
arm64_v8a 631.04 450.82
armeabi_v7a 565.51 385.29
x86 708.85 528.62
x86_64 676.09 495.86

Generated by :no_entry_sign: Danger