Browse Source

fix(minidumps): Restore error messages for missing dsyms (#13417)

Markus Unterwaditzer 5 years ago
parent
commit
a6b4d5421a

+ 2 - 2
src/sentry/lang/native/minidump.py

@@ -126,8 +126,6 @@ def merge_symbolicator_minidump_system_info(data, system_info):
 
 
 def merge_symbolicator_minidump_response(data, response):
-    sdk_info = get_sdk_from_event(data)
-
     data['platform'] = 'native'
     if response.get('crashed') is not None:
         data['level'] = 'fatal' if response['crashed'] else 'info'
@@ -137,6 +135,8 @@ def merge_symbolicator_minidump_response(data, response):
     if response.get('system_info'):
         merge_symbolicator_minidump_system_info(data, response['system_info'])
 
+    sdk_info = get_sdk_from_event(data)
+
     images = []
     set_path(data, 'debug_meta', 'images', value=images)
 

+ 477 - 0
tests/symbolicator/snapshots/SymbolicatorMinidumpIntegrationTest/test_missing_dsym.pysnap

@@ -0,0 +1,477 @@
+---
+created: '2019-05-28T09:16:05.541318Z'
+creator: sentry
+source: tests/symbolicator/test_minidump_full.py
+---
+contexts:
+  device:
+    arch: x86
+    type: device
+  os:
+    build: ''
+    name: Windows
+    type: os
+    version: 10.0.14393
+debug_meta:
+  images:
+  - code_file: C:\projects\breakpad-tools\windows\Release\crash.exe
+    code_id: 5ab380779000
+    debug_file: C:\projects\breakpad-tools\windows\Release\crash.pdb
+    debug_id: 3249d99d-0c40-4931-8610-f4e4fb0b6936-1
+    image_addr: '0x2a0000'
+    image_size: 36864
+    type: pe
+  - code_file: C:\Windows\System32\dbghelp.dll
+    code_id: 57898e12145000
+    debug_file: dbghelp.pdb
+    debug_id: 9c2a902b-6fdf-40ad-8308-588a41d572a0-1
+    image_addr: '0x70850000'
+    image_size: 1331200
+    type: pe
+  - code_file: C:\Windows\System32\msvcp140.dll
+    code_id: 589abc846c000
+    debug_file: msvcp140.i386.pdb
+    debug_id: bf5257f7-8c26-43dd-9bb7-901625e1136a-1
+    image_addr: '0x709a0000'
+    image_size: 442368
+    type: pe
+  - code_file: C:\Windows\System32\apphelp.dll
+    code_id: 57898eeb92000
+    debug_file: apphelp.pdb
+    debug_id: 8daf7773-372f-460a-af38-944e193f7e33-1
+    image_addr: '0x70a10000'
+    image_size: 598016
+    type: pe
+  - code_file: C:\Windows\System32\dbgcore.dll
+    code_id: 57898dab25000
+    debug_file: dbgcore.pdb
+    debug_id: aec7ef2f-df4b-4642-a471-4c3e5fe8760a-1
+    image_addr: '0x70b70000'
+    image_size: 151552
+    type: pe
+  - code_file: C:\Windows\System32\VCRUNTIME140.dll
+    code_id: 589abc7714000
+    debug_file: vcruntime140.i386.pdb
+    debug_id: 0ed80a50-ecda-472b-86a4-eb6c833f8e1b-1
+    image_addr: '0x70c60000'
+    image_size: 81920
+    type: pe
+  - code_file: C:\Windows\System32\CRYPTBASE.dll
+    code_id: 57899141a000
+    debug_file: cryptbase.pdb
+    debug_id: 147c51fb-7ca1-408f-85b5-285f2ad6f9c5-1
+    image_addr: '0x73ba0000'
+    image_size: 40960
+    type: pe
+  - code_file: C:\Windows\System32\sspicli.dll
+    code_id: 59bf30e31f000
+    debug_file: wsspicli.pdb
+    debug_id: 51e432b1-0450-4b19-8ed1-6d4335f9f543-1
+    image_addr: '0x73bb0000'
+    image_size: 126976
+    type: pe
+  - code_file: C:\Windows\System32\advapi32.dll
+    code_id: 5a49bb7677000
+    debug_file: advapi32.pdb
+    debug_id: 0c799483-b549-417d-8433-4331852031fe-1
+    image_addr: '0x73c70000'
+    image_size: 487424
+    type: pe
+  - code_file: C:\Windows\System32\msvcrt.dll
+    code_id: 57899155be000
+    debug_file: msvcrt.pdb
+    debug_id: 6f6409b3-d520-43c7-9b2f-62e00bfe761c-1
+    image_addr: '0x73cf0000'
+    image_size: 778240
+    type: pe
+  - code_file: C:\Windows\System32\sechost.dll
+    code_id: 598942c741000
+    debug_file: sechost.pdb
+    debug_id: 6f6a05dd-0a80-478b-a419-9b88703bf75b-1
+    image_addr: '0x74450000'
+    image_size: 266240
+    type: pe
+  - code_file: C:\Windows\System32\kernel32.dll
+    code_id: 590285e9e0000
+    debug_file: wkernel32.pdb
+    debug_id: d3474559-96f7-47d6-bf43-c176b2171e68-1
+    image_addr: '0x75050000'
+    image_size: 917504
+    type: pe
+  - code_file: C:\Windows\System32\bcryptPrimitives.dll
+    code_id: 59b0df8f5a000
+    debug_file: bcryptprimitives.pdb
+    debug_id: 287b19c3-9209-4a2b-bb8f-bcc37f411b11-1
+    image_addr: '0x75130000'
+    image_size: 368640
+    type: pe
+  - code_file: C:\Windows\System32\rpcrt4.dll
+    code_id: 5a49bb75c1000
+    debug_file: wrpcrt4.pdb
+    debug_id: ae131c67-27a7-4fa1-9916-b5a4aef41190-1
+    image_addr: '0x75810000'
+    image_size: 790528
+    type: pe
+  - code_file: C:\Windows\System32\ucrtbase.dll
+    code_id: 59bf2b5ae0000
+    debug_file: ucrtbase.pdb
+    debug_id: 6bedcbce-0a3a-40e9-8040-81c2c8c6cc2f-1
+    image_addr: '0x758f0000'
+    image_size: 917504
+    type: pe
+  - code_file: C:\Windows\System32\KERNELBASE.dll
+    code_id: 59bf2bcf1a1000
+    debug_file: wkernelbase.pdb
+    debug_id: 8462294a-c645-402d-ac82-a4e95f61ddf9-1
+    image_addr: '0x76db0000'
+    image_size: 1708032
+    type: pe
+  - code_file: C:\Windows\System32\ntdll.dll
+    code_id: 59b0d8f3183000
+    debug_file: wntdll.pdb
+    debug_id: 971f98e5-ce60-41ff-b2d7-235bbeb34578-1
+    image_addr: '0x77170000'
+    image_size: 1585152
+    type: pe
+errors:
+- name: timestamp
+  type: past_timestamp
+  value: 1521713273
+- image_path: C:\projects\breakpad-tools\windows\Release\crash.exe
+  image_uuid: 3249d99d-0c40-4931-8610-f4e4fb0b6936-1
+  message: None
+  type: native_missing_dsym
+exception:
+  values:
+  - mechanism:
+      handled: false
+      synthetic: true
+      type: minidump
+    raw_stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f44'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f79'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x750662c4'
+        package: C:\Windows\System32\kernel32.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x2a2d97'
+        package: C:\projects\breakpad-tools\windows\Release\crash.exe
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x2a3435'
+        package: C:\projects\breakpad-tools\windows\Release\crash.exe
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x7584e9c0'
+        package: C:\Windows\System32\rpcrt4.dll
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x75810000'
+        package: C:\Windows\System32\rpcrt4.dll
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x70b7ae40'
+        package: C:\Windows\System32\dbgcore.dll
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x70850000'
+        package: C:\Windows\System32\dbghelp.dll
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x7584e9c0'
+        package: C:\Windows\System32\rpcrt4.dll
+        trust: scan
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x2a28d0'
+        package: C:\projects\breakpad-tools\windows\Release\crash.exe
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x2a2a3d'
+        package: C:\projects\breakpad-tools\windows\Release\crash.exe
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x10ff670'
+        ebx: '0xfe5000'
+        ecx: '0x10ff670'
+        edi: '0x13bfd78'
+        edx: '0x7'
+        eflags: '0x10246'
+        eip: '0x2a2a3d'
+        esi: '0x759c6314'
+        esp: '0x10ff644'
+    stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f44'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f79'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x750662c4'
+        package: C:\Windows\System32\kernel32.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x2a28d0'
+        package: C:\projects\breakpad-tools\windows\Release\crash.exe
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x2a2a3d'
+        package: C:\projects\breakpad-tools\windows\Release\crash.exe
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x10ff670'
+        ebx: '0xfe5000'
+        ecx: '0x10ff670'
+        edi: '0x13bfd78'
+        edx: '0x7'
+        eflags: '0x10246'
+        eip: '0x2a2a3d'
+        esi: '0x759c6314'
+        esp: '0x10ff644'
+    thread_id: 1636
+    type: EXCEPTION_ACCESS_VIOLATION_WRITE
+    value: 'Fatal Error: EXCEPTION_ACCESS_VIOLATION_WRITE'
+stacktrace: null
+threads:
+  values:
+  - crashed: true
+    id: 1636
+  - crashed: false
+    id: 3580
+    raw_stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f44'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f79'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x750662c4'
+        package: C:\Windows\System32\kernel32.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771e016c'
+        package: C:\Windows\System32\ntdll.dll
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x159faa4'
+        ebx: '0x13b0990'
+        ecx: '0x0'
+        edi: '0x13b4af0'
+        edx: '0x0'
+        eflags: '0x216'
+        eip: '0x771e016c'
+        esi: '0x13b4930'
+        esp: '0x159f900'
+    stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f44'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f79'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x750662c4'
+        package: C:\Windows\System32\kernel32.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771e016c'
+        package: C:\Windows\System32\ntdll.dll
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x159faa4'
+        ebx: '0x13b0990'
+        ecx: '0x0'
+        edi: '0x13b4af0'
+        edx: '0x0'
+        eflags: '0x216'
+        eip: '0x771e016c'
+        esi: '0x13b4930'
+        esp: '0x159f900'
+  - crashed: false
+    id: 2600
+    raw_stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f44'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f79'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x750662c4'
+        package: C:\Windows\System32\kernel32.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771e016c'
+        package: C:\Windows\System32\ntdll.dll
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x169fb98'
+        ebx: '0x13b0990'
+        ecx: '0x0'
+        edi: '0x13b7c28'
+        edx: '0x0'
+        eflags: '0x202'
+        eip: '0x771e016c'
+        esi: '0x13b7a68'
+        esp: '0x169f9f4'
+    stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f44'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771d0f79'
+        package: C:\Windows\System32\ntdll.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x750662c4'
+        package: C:\Windows\System32\kernel32.dll
+        trust: fp
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771e016c'
+        package: C:\Windows\System32\ntdll.dll
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x169fb98'
+        ebx: '0x13b0990'
+        ecx: '0x0'
+        edi: '0x13b7c28'
+        edx: '0x0'
+        eflags: '0x202'
+        eip: '0x771e016c'
+        esi: '0x13b7a68'
+        esp: '0x169f9f4'
+  - crashed: false
+    id: 2920
+    raw_stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771df3dc'
+        package: C:\Windows\System32\ntdll.dll
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x179f2b8'
+        ebx: '0x17b1aa0'
+        ecx: '0x0'
+        edi: '0x17b1a90'
+        edx: '0x0'
+        eflags: '0x206'
+        eip: '0x771df3dc'
+        esi: '0x2cc'
+        esp: '0x179f2ac'
+    stacktrace:
+      frames:
+      - data:
+          symbolicator_status: missing
+        in_app: false
+        instruction_addr: '0x771df3dc'
+        package: C:\Windows\System32\ntdll.dll
+        trust: context
+      registers:
+        eax: '0x0'
+        ebp: '0x179f2b8'
+        ebx: '0x17b1aa0'
+        ecx: '0x0'
+        edi: '0x17b1a90'
+        edx: '0x0'
+        eflags: '0x206'
+        eip: '0x771df3dc'
+        esi: '0x2cc'
+        esp: '0x179f2ac'

+ 12 - 0
tests/symbolicator/test_minidump_full.py

@@ -76,6 +76,18 @@ class MinidumpIntegrationTestBase(object):
         assert minidump.file.type == 'event.minidump'
         assert minidump.file.checksum == '74bb01c850e8d65d3ffbc5bad5cabc4668fce247'
 
+    def test_missing_dsym(self):
+        with self.feature('organizations:event-attachments'):
+            with open(os.path.join(os.path.dirname(__file__), 'fixtures', 'windows.dmp'), 'rb') as f:
+                resp = self._postMinidumpWithHeader(f, {
+                    'sentry[logger]': 'test-logger',
+                })
+                assert resp.status_code == 200
+
+        event = Event.objects.get()
+        insta_snapshot_stacktrace_data(self, event.data)
+        assert not EventAttachment.objects.filter(event_id=event.event_id)
+
 
 class SymbolicatorMinidumpIntegrationTest(MinidumpIntegrationTestBase, TransactionTestCase):
     # For these tests to run, write `symbolicator.enabled: true` into your