Ejemplo n.º 1
0
    def _symbolize_app_frame(self, instruction_addr, obj, sdk_info=None, trust=None):
        symcache = self.symcaches.get(obj.debug_id)
        if symcache is None:
            # In case we know what error happened on symcache conversion
            # we can report it to the user now.
            if obj.debug_id in self.symcaches_conversion_errors:
                raise SymbolicationFailed(
                    message=self.symcaches_conversion_errors[obj.debug_id],
                    type=EventError.NATIVE_BAD_DSYM,
                    obj=obj
                )

            if is_optional_package(obj.code_file, sdk_info=sdk_info):
                type = EventError.NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM
            else:
                type = EventError.NATIVE_MISSING_DSYM

            raise SymbolicationFailed(type=type, obj=obj)

        try:
            rv = symcache.lookup(rebase_addr(instruction_addr, obj))
        except SymbolicError as e:
            raise SymbolicationFailed(
                type=EventError.NATIVE_BAD_DSYM, message=six.text_type(e), obj=obj
            )

        if not rv:
            # For some frameworks we are willing to ignore missing symbol
            # errors. Also, ignore scanned stack frames when symbols are
            # available to complete breakpad's stack scanning heuristics.
            if trust == 'scan' or is_optional_package(obj.code_file, sdk_info=sdk_info):
                return []
            raise SymbolicationFailed(
                type=EventError.NATIVE_MISSING_SYMBOL, obj=obj)
        return [self._process_frame(s, addr_off=obj.addr) for s in reversed(rv)]
Ejemplo n.º 2
0
def handle_symbolicator_status(status, image, sdk_info,
                               handle_symbolication_failed):
    if status in ('found', 'unused'):
        return
    elif status in (
            'missing_debug_file',  # TODO(markus): Legacy key. Remove after next deploy
            'missing'):
        package = image.get('code_file')
        if not package or is_known_third_party(package, sdk_info=sdk_info):
            return

        if is_optional_package(package, sdk_info=sdk_info):
            error = SymbolicationFailed(
                type=EventError.NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM)
        else:
            error = SymbolicationFailed(type=EventError.NATIVE_MISSING_DSYM)
    elif status in (
            'malformed_debug_file',  # TODO(markus): Legacy key. Remove after next deploy
            'malformed'):
        error = SymbolicationFailed(type=EventError.NATIVE_BAD_DSYM)
    elif status == 'too_large':
        error = SymbolicationFailed(type=EventError.FETCH_TOO_LARGE)
    elif status == 'fetching_failed':
        error = SymbolicationFailed(type=EventError.FETCH_GENERIC_ERROR)
    elif status == 'other':
        error = SymbolicationFailed(type=EventError.UNKNOWN_ERROR)
    else:
        logger.error("Unknown status: %s", status)
        return

    error.image_arch = image.get('arch')
    error.image_path = image.get('code_file')
    error.image_name = image_name(image.get('code_file'))
    error.image_uuid = image.get('debug_id')
    handle_symbolication_failed(error)
Ejemplo n.º 3
0
def _handle_image_status(status, image, sdk_info, data):
    if status in ("found", "unused"):
        return
    elif status == "missing":
        package = image.get("code_file")
        # TODO(mitsuhiko): This check seems wrong?  This call seems to
        # mirror the one in the ios symbol server support.  If we change
        # one we need to change the other.
        if not package or is_known_third_party(package, sdk_info=sdk_info):
            return

        if is_optional_package(package, sdk_info=sdk_info):
            error = SymbolicationFailed(
                type=EventError.NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM)
        else:
            error = SymbolicationFailed(type=EventError.NATIVE_MISSING_DSYM)
    elif status == "malformed":
        error = SymbolicationFailed(type=EventError.NATIVE_BAD_DSYM)
    elif status == "too_large":
        error = SymbolicationFailed(type=EventError.FETCH_TOO_LARGE)
    elif status == "fetching_failed":
        error = SymbolicationFailed(type=EventError.FETCH_GENERIC_ERROR)
    elif status == "other":
        error = SymbolicationFailed(type=EventError.UNKNOWN_ERROR)
    else:
        logger.error("Unknown status: %s", status)
        return

    error.image_arch = image.get("arch")
    error.image_path = image.get("code_file")
    error.image_name = image_name(image.get("code_file"))
    error.image_uuid = image.get("debug_id")

    write_error(error, data)
Ejemplo n.º 4
0
def _handle_image_status(status, image, sdk_info, handle_symbolication_failed):
    if status in ('found', 'unused'):
        return
    elif status == 'missing':
        package = image.get('code_file')
        # TODO(mitsuhiko): This check seems wrong?  This call seems to
        # mirror the one in the ios symbol server support.  If we change
        # one we need to change the other.
        if not package or is_known_third_party(package, sdk_info=sdk_info):
            return

        if is_optional_package(package, sdk_info=sdk_info):
            error = SymbolicationFailed(
                type=EventError.NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM)
        else:
            error = SymbolicationFailed(type=EventError.NATIVE_MISSING_DSYM)
    elif status == 'malformed':
        error = SymbolicationFailed(type=EventError.NATIVE_BAD_DSYM)
    elif status == 'too_large':
        error = SymbolicationFailed(type=EventError.FETCH_TOO_LARGE)
    elif status == 'fetching_failed':
        error = SymbolicationFailed(type=EventError.FETCH_GENERIC_ERROR)
    elif status == 'other':
        error = SymbolicationFailed(type=EventError.UNKNOWN_ERROR)
    else:
        logger.error("Unknown status: %s", status)
        return

    error.image_arch = image.get('arch')
    error.image_path = image.get('code_file')
    error.image_name = image_name(image.get('code_file'))
    error.image_uuid = image.get('debug_id')
    handle_symbolication_failed(error)
Ejemplo n.º 5
0
    def _symbolize_app_frame(self, instruction_addr, obj, sdk_info=None, trust=None):
        symcache = None
        if self.symcaches is not None:
            symcache = self.symcaches.get(obj.debug_id)

        if symcache is None:
            # In case we know what error happened on symcache conversion
            # we can report it to the user now.
            if self.symcaches_conversion_errors is not None and \
               obj.debug_id in self.symcaches_conversion_errors:
                raise SymbolicationFailed(
                    message=self.symcaches_conversion_errors[obj.debug_id],
                    type=EventError.NATIVE_BAD_DSYM,
                    obj=obj
                )

            if is_optional_package(obj.code_file, sdk_info=sdk_info):
                type = EventError.NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM
            else:
                type = EventError.NATIVE_MISSING_DSYM

            raise SymbolicationFailed(type=type, obj=obj)

        try:
            rv = symcache.lookup(rebase_addr(instruction_addr, obj))
        except SymbolicError as e:
            raise SymbolicationFailed(
                type=EventError.NATIVE_BAD_DSYM, message=six.text_type(e), obj=obj
            )

        if not rv:
            # For some frameworks we are willing to ignore missing symbol
            # errors. Also, ignore scanned stack frames when symbols are
            # available to complete breakpad's stack scanning heuristics.
            if trust == 'scan' or is_optional_package(obj.code_file, sdk_info=sdk_info):
                return []
            raise SymbolicationFailed(
                type=EventError.NATIVE_MISSING_SYMBOL, obj=obj)
        return [self._process_frame(s, addr_off=obj.addr) for s in reversed(rv)]
Ejemplo n.º 6
0
def handle_symbolicator_status(status, image, sdk_info, handle_symbolication_failed):
    if status in ('found', 'unused'):
        return
    elif status in (
        'missing_debug_file',  # TODO(markus): Legacy key. Remove after next deploy
        'missing'
    ):
        package = image.get('code_file')
        if not package or is_known_third_party(package, sdk_info=sdk_info):
            return

        if is_optional_package(package, sdk_info=sdk_info):
            error = SymbolicationFailed(
                type=EventError.NATIVE_MISSING_OPTIONALLY_BUNDLED_DSYM)
        else:
            error = SymbolicationFailed(type=EventError.NATIVE_MISSING_DSYM)
    elif status in (
        'malformed_debug_file',  # TODO(markus): Legacy key. Remove after next deploy
        'malformed'
    ):
        error = SymbolicationFailed(type=EventError.NATIVE_BAD_DSYM)
    elif status == 'too_large':
        error = SymbolicationFailed(type=EventError.FETCH_TOO_LARGE)
    elif status == 'fetching_failed':
        error = SymbolicationFailed(type=EventError.FETCH_GENERIC_ERROR)
    elif status == 'other':
        error = SymbolicationFailed(type=EventError.UNKNOWN_ERROR)
    else:
        logger.error("Unknown status: %s", status)
        return

    error.image_arch = image.get('arch')
    error.image_path = image.get('code_file')
    error.image_name = image_name(image.get('code_file'))
    error.image_uuid = image.get('debug_id')
    handle_symbolication_failed(error)