Browse Source

feat(grouping): Add bugly to category telemetry (#27314)

This categorizes frames from the Bugly crash reporter [2] as telemetry.

[1] https://getsentry.atlassian.net/browse/INGEST-114

[2] https://github.com/BuglyDevTeam
Joris Bayer 3 years ago
parent
commit
d3949cdd32

+ 1 - 0
src/sentry/grouping/enhancer/enhancement-configs/mobile@2021-04-02.txt

@@ -240,6 +240,7 @@ module:cn.gundam.sdk.* category=telemetry
 # entirely sure if any of that is linked into the app, it's probably something
 # preinstalled on Lenovo devices.
 module:com.lenovo.payplus.analytics.* category=telemetry
+package:"**/libBugly.so" category=telemetry
 
 family:native function:dlopen category=load
 family:native package:/system/lib/libnativeloader.so function:android::OpenNativeLibrary category=load

+ 52 - 0
tests/sentry/grouping/categorization_inputs/bugly.json

@@ -0,0 +1,52 @@
+{
+  "event_id": "65999293099e49d9adb5f4dff4b9b0b7",
+  "exception": {
+    "values": [
+      {
+        "mechanism": {
+          "handled": false,
+          "meta": {
+            "signal": {
+              "name": "SIGSEGV",
+              "number": 11
+            }
+          },
+          "synthetic": true,
+          "type": "signalhandler"
+        },
+        "stacktrace": {
+          "frames": [
+            {
+              "function": "stripped_application_code"
+            },
+            {
+              "package": "/apex/com.android.runtime/lib64/bionic/libc.so"
+            },
+            {
+              "package": "/apex/com.android.runtime/lib64/bionic/libc.so"
+            },
+            {
+              "function": "stripped_application_code"
+            },
+            {
+              "function": "stripped_application_code"
+            },
+            {
+              "package": "/system/bin/app_process64"
+            },
+            {
+              "package": "/lib/arm64/libBugly.so"
+            },
+            {
+              "function": "kill",
+              "package": "/apex/com.android.runtime/lib64/bionic/libc.so"
+            }
+          ]
+        },
+        "type": "SIGSEGV",
+        "value": "Segfault"
+      }
+    ]
+  },
+  "platform": "native"
+}

+ 64 - 0
tests/sentry/grouping/grouping_inputs/bugly.json

@@ -0,0 +1,64 @@
+{
+    "platform": "native",
+    "exception": {
+        "values": [
+            {
+                "type": "SIGSEGV",
+                "value": "Segfault",
+                "stacktrace": {
+                    "frames": [
+                        {
+                            "in_app": false
+                        },
+                        {
+                            "package": "/apex/com.android.runtime/lib64/bionic/libc.so",
+                            "in_app": false
+                        },
+                        {
+                            "package": "/apex/com.android.runtime/lib64/bionic/libc.so",
+                            "in_app": false
+                        },
+                        {
+                            "function": "stripped_application_code"
+                        },
+                        {
+                            "function": "__kernel_rt_sigreturn",
+                            "package": "[vdso]",
+                            "in_app": false,
+                            "data": {
+                                "orig_in_app": -1,
+                                "min_grouping_level": 2,
+                                "symbolicator_status": "unknown_image"
+                            },
+                            "symbol_addr": "0x7a715f363c"
+                        },
+                        {
+                            "package": "/system/bin/app_process64",
+                            "in_app": false
+                        },
+                        {
+                            "package": "/lib/arm64/libBugly.so",
+                            "in_app": false
+                        },
+                        {
+                            "function": "kill",
+                            "package": "/apex/com.android.runtime/lib64/bionic/libc.so",
+                            "in_app": false
+                        }
+                    ]
+                },
+                "mechanism": {
+                    "type": "signalhandler",
+                    "synthetic": true,
+                    "handled": false,
+                    "meta": {
+                        "signal": {
+                            "number": 11,
+                            "name": "SIGSEGV"
+                        }
+                    }
+                }
+            }
+        ]
+    }
+}

+ 11 - 0
tests/sentry/grouping/similarity/snapshots/test_features/test_similarity_extract_grouping_input/bugly.pysnap

@@ -0,0 +1,11 @@
+---
+created: '2021-07-12T14:14:22.207181Z'
+creator: sentry
+source: tests/sentry/grouping/similarity/test_features.py
+---
+similarity:2020-07-23:stacktrace:frames-pairs: [[["function","__kernel_rt_sigreturn"]],[["function","kill"]]]
+similarity:2020-07-23:stacktrace:frames-pairs: [[["function","stripped_application_code"]],[["function","__kernel_rt_sigreturn"]]]
+similarity:2020-07-23:value:character-5-shingle: "Segfa"
+similarity:2020-07-23:value:character-5-shingle: "egfau"
+similarity:2020-07-23:value:character-5-shingle: "fault"
+similarity:2020-07-23:value:character-5-shingle: "gfaul"

+ 16 - 0
tests/sentry/grouping/snapshots/test_categorization/test_categorization/bugly.pysnap

@@ -0,0 +1,16 @@
+---
+created: '2021-07-12T14:13:56.982061Z'
+creator: sentry
+source: tests/sentry/grouping/test_categorization.py
+---
+
+
+SIGSEGV:Segfault (thread_id:_, crashed:_)
+                                              stripped_application_code
+  /apex/com.android.runtime/lib64/bionic/lib  ??? category=internals
+  /apex/com.android.runtime/lib64/bionic/lib  ??? category=internals
+                                              stripped_application_code
+                                              stripped_application_code
+                   /system/bin/app_process64  ??? category=internals
+                      /lib/arm64/libBugly.so  ??? category=telemetry
+  /apex/com.android.runtime/lib64/bionic/lib  kill category=system

+ 54 - 0
tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/legacy@2019_03_12/bugly.pysnap

@@ -0,0 +1,54 @@
+---
+created: '2021-07-12T13:33:39.580522Z'
+creator: sentry
+source: tests/sentry/grouping/test_variants.py
+---
+app:
+  hash: null
+  component:
+    app (exception of system takes precedence)
+      exception (ignored because hash matches system variant)
+        stacktrace
+          frame (frame considered in-app because no frame is in-app)
+          frame (frame considered in-app because no frame is in-app)
+          frame (ignored due to recursion)
+          frame (frame considered in-app because no frame is in-app)
+            function (function name is not used if module or filename are available)
+              "stripped_application_code"
+          frame (frame considered in-app because no frame is in-app)
+            function (function name is not used if module or filename are available)
+              "__kernel_rt_sigreturn"
+          frame (frame considered in-app because no frame is in-app)
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame (frame considered in-app because no frame is in-app)
+            function (function name is not used if module or filename are available)
+              "kill"
+        type*
+          "SIGSEGV"
+        value*
+          "Segfault"
+--------------------------------------------------------------------------
+system:
+  hash: "8ecc10ce70f427a50370968e7271fa51"
+  component:
+    system*
+      exception*
+        stacktrace
+          frame
+          frame
+          frame (ignored due to recursion)
+          frame
+            function (function name is not used if module or filename are available)
+              "stripped_application_code"
+          frame
+            function (function name is not used if module or filename are available)
+              "__kernel_rt_sigreturn"
+          frame
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame
+            function (function name is not used if module or filename are available)
+              "kill"
+        type*
+          "SIGSEGV"
+        value*
+          "Segfault"

+ 144 - 0
tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/mobile@2021_02_12/bugly.pysnap

@@ -0,0 +1,144 @@
+---
+created: '2021-07-12T13:55:48.048376Z'
+creator: sentry
+source: tests/sentry/grouping/test_variants.py
+---
+app-depth-1:
+  hash: "534735884d341071762ede7af01c53e8"
+  tree_label: "kill"
+  component:
+    app-depth-1*
+      exception*
+        stacktrace*
+          frame*
+            function*
+              "kill"
+            package (ignored because function takes precedence)
+              "libc.so"
+        type (ignored because exception is synthetic (detected via exception type))
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"
+--------------------------------------------------------------------------
+app-depth-2:
+  hash: "5fe18d8a5d2a24744675e650fc46afc6"
+  tree_label: "kill | __kernel_rt_sigreturn"
+  component:
+    app-depth-2*
+      exception*
+        stacktrace*
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+            package (ignored because function takes precedence)
+              "[vdso]"
+          frame*
+            function*
+              "kill"
+            package (ignored because function takes precedence)
+              "libc.so"
+        type (ignored because exception is synthetic (detected via exception type))
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"
+--------------------------------------------------------------------------
+app-depth-3:
+  hash: "d9c9b0f9ba46e32fddd7cd1512fad235"
+  tree_label: "kill | __kernel_rt_sigreturn | stripped_application_code"
+  component:
+    app-depth-3*
+      exception*
+        stacktrace*
+          frame*
+            function*
+              "stripped_application_code"
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+            package (ignored because function takes precedence)
+              "[vdso]"
+          frame*
+            function*
+              "kill"
+            package (ignored because function takes precedence)
+              "libc.so"
+        type (ignored because exception is synthetic (detected via exception type))
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"
+--------------------------------------------------------------------------
+app-depth-max:
+  hash: "d9c9b0f9ba46e32fddd7cd1512fad235"
+  tree_label: "kill | __kernel_rt_sigreturn | stripped_application_code"
+  component:
+    app-depth-max*
+      exception*
+        stacktrace*
+          frame
+          frame (ignored by stack trace rule (category:internals -group))
+            package* (used as fallback because function name is not available)
+              "libc.so"
+          frame (ignored due to recursion)
+            package* (used as fallback because function name is not available)
+              "libc.so"
+          frame*
+            function*
+              "stripped_application_code"
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+            package (ignored because function takes precedence)
+              "[vdso]"
+          frame (ignored by stack trace rule (category:internals -group))
+            package* (used as fallback because function name is not available)
+              "app_process64"
+          frame (ignored by stack trace rule (category:telemetry -group))
+            package* (used as fallback because function name is not available)
+              "libbugly.so"
+          frame*
+            function*
+              "kill"
+            package (ignored because function takes precedence)
+              "libc.so"
+        type (ignored because exception is synthetic (detected via exception type))
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"
+--------------------------------------------------------------------------
+system:
+  hash: "d9c9b0f9ba46e32fddd7cd1512fad235"
+  tree_label: "kill | __kernel_rt_sigreturn | stripped_application_code"
+  component:
+    system*
+      exception*
+        stacktrace*
+          frame
+          frame (ignored by stack trace rule (category:internals -group))
+            package* (used as fallback because function name is not available)
+              "libc.so"
+          frame (ignored due to recursion)
+            package* (used as fallback because function name is not available)
+              "libc.so"
+          frame*
+            function*
+              "stripped_application_code"
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+            package (ignored because function takes precedence)
+              "[vdso]"
+          frame (ignored by stack trace rule (category:internals -group))
+            package* (used as fallback because function name is not available)
+              "app_process64"
+          frame (ignored by stack trace rule (category:telemetry -group))
+            package* (used as fallback because function name is not available)
+              "libbugly.so"
+          frame*
+            function*
+              "kill"
+            package (ignored because function takes precedence)
+              "libc.so"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"

+ 50 - 0
tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/newstyle@2019_04_05/bugly.pysnap

@@ -0,0 +1,50 @@
+---
+created: '2021-07-12T13:33:41.815709Z'
+creator: sentry
+source: tests/sentry/grouping/test_variants.py
+---
+app:
+  hash: null
+  component:
+    app (exception of system takes precedence)
+      exception (ignored because this variant does not have a contributing stacktrace, but the system variant does)
+        stacktrace
+          frame (non app frame)
+          frame (non app frame)
+          frame (non app frame)
+          frame (non app frame)
+            function*
+              "stripped_application_code"
+          frame (non app frame)
+            function*
+              "__kernel_rt_sigreturn"
+          frame (non app frame)
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame (non app frame)
+            function*
+              "kill"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"
+--------------------------------------------------------------------------
+system:
+  hash: "d9c9b0f9ba46e32fddd7cd1512fad235"
+  component:
+    system*
+      exception*
+        stacktrace*
+          frame
+          frame
+          frame (ignored due to recursion)
+          frame*
+            function*
+              "stripped_application_code"
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+          frame
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame*
+            function*
+              "kill"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"

+ 54 - 0
tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/newstyle@2019_04_17/bugly.pysnap

@@ -0,0 +1,54 @@
+---
+created: '2021-07-12T13:33:42.162487Z'
+creator: sentry
+source: tests/sentry/grouping/test_variants.py
+---
+app:
+  hash: null
+  component:
+    app (exception of system takes precedence)
+      exception (ignored because this variant does not have a contributing stacktrace, but the system variant does)
+        stacktrace
+          frame (non app frame)
+          frame (non app frame)
+          frame (non app frame)
+          frame (non app frame)
+            function*
+              "stripped_application_code"
+          frame (non app frame)
+            function*
+              "__kernel_rt_sigreturn"
+          frame (non app frame)
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame (non app frame)
+            function*
+              "kill"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"
+        value*
+          "Segfault"
+--------------------------------------------------------------------------
+system:
+  hash: "d9c9b0f9ba46e32fddd7cd1512fad235"
+  component:
+    system*
+      exception*
+        stacktrace*
+          frame
+          frame
+          frame (ignored due to recursion)
+          frame*
+            function*
+              "stripped_application_code"
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+          frame
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame*
+            function*
+              "kill"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"

+ 54 - 0
tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/newstyle@2019_05_08/bugly.pysnap

@@ -0,0 +1,54 @@
+---
+created: '2021-07-12T13:33:40.148674Z'
+creator: sentry
+source: tests/sentry/grouping/test_variants.py
+---
+app:
+  hash: null
+  component:
+    app (exception of system takes precedence)
+      exception (ignored because this variant does not have a contributing stacktrace, but the system variant does)
+        stacktrace
+          frame (non app frame)
+          frame (non app frame)
+          frame (non app frame)
+          frame (non app frame)
+            function*
+              "stripped_application_code"
+          frame (non app frame)
+            function*
+              "__kernel_rt_sigreturn"
+          frame (non app frame)
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame (non app frame)
+            function*
+              "kill"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"
+        value*
+          "Segfault"
+--------------------------------------------------------------------------
+system:
+  hash: "d9c9b0f9ba46e32fddd7cd1512fad235"
+  component:
+    system*
+      exception*
+        stacktrace*
+          frame
+          frame
+          frame (ignored due to recursion)
+          frame*
+            function*
+              "stripped_application_code"
+          frame*
+            function*
+              "__kernel_rt_sigreturn"
+          frame
+          frame (marked out of app by stack trace rule (family:native package:/lib/** -app))
+          frame*
+            function*
+              "kill"
+        type (ignored because exception is synthetic)
+          "SIGSEGV"
+        value (ignored because stacktrace takes precedence)
+          "Segfault"

Some files were not shown because too many files changed in this diff