Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugsnag does not report All types of metadata for native crashes #1625

Closed
pavlos-lyft opened this issue Mar 15, 2022 · 2 comments
Closed

Bugsnag does not report All types of metadata for native crashes #1625

pavlos-lyft opened this issue Mar 15, 2022 · 2 comments
Labels
feature request Request for a new feature released This feature/bug fix has been released

Comments

@pavlos-lyft
Copy link

pavlos-lyft commented Mar 15, 2022

Describe the bug

Bugsnag does not report List and Map types of metadata for native crashes. The issue does not appear for JVM crashes.
For example, if I specify the following set of metadata in Java/Kotlin:

Bugsnag.addMetadata(TEST_TAB, "int", 42)
Bugsnag.addMetadata(TEST_TAB, "string", "value")
Bugsnag.addMetadata(TEST_TAB, "list", listOf("1", "2"))
Bugsnag.addMetadata(TEST_TAB, "map", mapOf("key1" to 1, "key2" to 2))
  • For native crashes, only two of them will be reported: int and string, while list and map will be ignored.
  • For JVM crashes - all 4 will be reported.

If I try to intercept the metadata before sending in Configuration#addOnSend method, the List and Map metadata are also missing for native crashes.

Steps to reproduce

I've created a sample Android project to demonstrate the issue. It is completely based Bugsnag example project but with slight modifications in ExampleApplication.kt file.

  1. (set API key in manifest)
  2. Check test metadata in ExampleApplication.kt file. There are 4 items: int, string, list and map.
  3. Launch the app
  4. Click TRIGGER A FATAL CRASH and launch the app again.
  5. Check TEST TAB tab on a dashboard or see logs with TEST_LOG tag in logcat. All 4 metadata items were sent.
  6. Now, click TRIGGER A NATIVE CRASH and launch the app again.
  7. Check dashboard or logs again. Only two metadata items are sent but List and Map ones are skipped.

Environment

  • Android version: 12
  • Bugsnag version: tried on 5.17.0, 5.20.0
  • Emulator or physical device: physical device

Example Repo

https://github.com/pavlos-lyft/bugsnag-android-issue-demo

@mattdyoung
Copy link

Hi @pavlos-lyft

Currently for native NDK crashes the only types of metadata which are supported are boolean, number, and string values. Although more complex metadata types such as List and Map can be added to JVM crashes, this metadata won't appear on NDK crashes.

We do have plans on our roadmap to support more complex metadata types on NDK crashes as well, but there is significant work to support this reliably across all cases and ensure that metadata added or modified in either layer is included in all crashes. We don't have a planned timeline for this yet but we'll be sure to provide an update here when this becomes available.

The most common use case for adding List metadata to crashes is to provide sets of feature flags or experiments active when the crash occurred. This is now supported by bugsnag-android using the addFeatureFlags API, and although feature flags / experiments can only be added in JVM code they will be included on all errors including native NDK crashes.

@mattdyoung mattdyoung added feature request Request for a new feature backlog We hope to fix this feature/bug in the future labels Mar 15, 2022
@luke-belton
Copy link
Member

Hi @pavlos-lyft - just letting you know that we've released v5.24.0 of bugsnag-android, which includes some enhancements to now allow reporting of complex metadata (including Lists and Maps) on NDK crashes 🎉

@luke-belton luke-belton added released This feature/bug fix has been released and removed backlog We hope to fix this feature/bug in the future labels Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

3 participants