Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ setproctitle>=1.1.7,<1.2.0
statsd>=3.1.0,<3.2.0
structlog==16.1.0
sqlparse>=0.1.16,<0.2.0
symbolic>=2.0.2,<3.0.0
symbolic>=2.0.3,<3.0.0
toronado>=0.0.11,<0.1.0
ua-parser>=0.6.1,<0.8.0
urllib3>=1.22,<1.23
Expand Down
25 changes: 17 additions & 8 deletions src/sentry/lang/native/symbolizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,23 @@ def is_image_from_app_bundle(self, obj, sdk_info=None):
fn = obj.name
if not fn:
return False
is_mac_platform = (
sdk_info is not None and sdk_info['sdk_name'].lower() == 'macos')
if not (
fn.startswith(APP_BUNDLE_PATHS) or (SIM_PATH in fn and SIM_APP_PATH in fn) or
(is_mac_platform and MAC_OS_PATH in fn)
):
return False
return True

if fn.startswith(APP_BUNDLE_PATHS):
return True

if SIM_PATH in fn and SIM_APP_PATH in fn:
return True

sdk_name = sdk_info['sdk_name'].lower() if sdk_info else ''
if sdk_name == 'macos' and MAC_OS_PATH in fn:
return True

# For now, consider all linux objects in_app
# TODO(ja): Fix in_app using file paths
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to fix this soon in a follow-up PR

if sdk_name == 'linux':
return True

return False

def _is_support_framework(self, obj):
"""True if the frame is from a framework that is known and app
Expand Down
16 changes: 6 additions & 10 deletions src/sentry/lang/native/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def get_sdk_from_os(data):
if 'name' not in data or 'version' not in data:
return
try:
system_version = tuple(int(x) for x in (data['version'] + '.0' * 3).split('.')[:3])
version = data['version'].split('-', 1)[0] + '.0' * 3
system_version = tuple(int(x) for x in version.split('.')[:3])
except ValueError:
return

Expand Down Expand Up @@ -174,16 +175,10 @@ def merge_minidump_event(data, minidump):
device = context.setdefault('device', {})
os['type'] = 'os' # Required by "get_sdk_from_event"
os['name'] = MINIDUMP_OS_TYPES.get(info.os_name, info.os_name)
os['version'] = info.os_version
os['build'] = info.os_build
device['arch'] = arch_from_breakpad(info.cpu_family)

# Breakpad reports the version and build number always in one string,
# but a version number is guaranteed even on certain linux distros.
match = VERSION_RE.search(info.os_version)
if match is not None:
version, build = match.groups()
os['version'] = version
os['build'] = build

# We can extract stack traces here already but since CFI is not
# available yet (without debug symbols), the stackwalker will
# resort to stack scanning which yields low-quality results. If
Expand All @@ -196,7 +191,8 @@ def merge_minidump_event(data, minidump):
'frames': [{
'instruction_addr': '0x%x' % frame.instruction,
'function': '<unknown>', # Required by interface
} for frame in thread.frames()],
'package': frame.module.name if frame.module else None,
} for frame in reversed(list(thread.frames()))],
},
} for thread in state.threads()]

Expand Down
8 changes: 6 additions & 2 deletions src/sentry/web/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import six
import traceback
import uuid

from time import time

Expand Down Expand Up @@ -591,9 +592,12 @@ def post(self, request, **kwargs):
if isinstance(response_or_event_id, HttpResponse):
return response_or_event_id

# Return the formatted UUID of the generated event. This is
# expected by the Electron http uploader on Linux and doesn't
# break the default Breakpad client library.
return HttpResponse(
json.dumps({'id': response_or_event_id}),
content_type='application/json'
six.text_type(uuid.UUID(response_or_event_id)),
content_type='text/plain'
)


Expand Down