コード例 #1
0
ファイル: rules.py プロジェクト: uglide/socorro
    def action(self, raw_crash, processed_crash, notes):
        if raw_crash.get('additional_minidumps') == 'browser':
            new_sig = 'IPCError-browser | {}'
        else:
            new_sig = 'IPCError-content | {}'
        new_sig = new_sig.format(
            drop_unicode(raw_crash['ipc_channel_error'])[:100])

        notes.append('Signature replaced with an IPC Channel Error, '
                     'was: "{}"'.format(processed_crash['signature']))
        processed_crash['signature'] = new_sig

        return True
コード例 #2
0
ファイル: rules.py プロジェクト: uglide/socorro
    def action(self, raw_crash, processed_crash, notes):
        processed_crash['original_signature'] = processed_crash['signature']
        abort_message = raw_crash['AbortMessage']

        if '###!!! ABORT: file ' in abort_message:
            # This is an abort message that contains no interesting
            # information. We just want to put the "Abort" marker in the
            # signature.
            processed_crash['signature'] = 'Abort | {}'.format(
                processed_crash['signature'])
            return True

        if '###!!! ABORT:' in abort_message:
            # Recent crash reports added some irrelevant information at the
            # beginning of the abort message. We want to remove that and keep
            # just the actual abort message.
            abort_message = abort_message.split('###!!! ABORT:', 1)[1]

        if ': file ' in abort_message:
            # Abort messages contain a file name and a line number. Since
            # those are very likely to change between builds, we want to
            # remove those parts from the signature.
            abort_message = abort_message.split(': file ', 1)[0]

        if 'unable to find a usable font' in abort_message:
            # "unable to find a usable font" messages include a parenthesized localized message. We
            # want to remove that. Bug #1385966
            open_paren = abort_message.find('(')
            if open_paren != -1:
                end_paren = abort_message.rfind(')')
                if end_paren != -1:
                    abort_message = abort_message[:open_paren] + abort_message[
                        end_paren + 1:]

        abort_message = drop_unicode(abort_message).strip()

        if len(abort_message) > 80:
            abort_message = abort_message[:77] + '...'

        processed_crash['signature'] = 'Abort | {} | {}'.format(
            abort_message, processed_crash['signature'])

        return True
コード例 #3
0
ファイル: rules.py プロジェクト: stephendonner/socorro
    def action(self, raw_crash, processed_crash, notes):
        processed_crash['original_signature'] = processed_crash['signature']
        abort_message = raw_crash['AbortMessage']

        if '###!!! ABORT: file ' in abort_message:
            # This is an abort message that contains no interesting
            # information. We just want to put the "Abort" marker in the
            # signature.
            processed_crash['signature'] = 'Abort | {}'.format(processed_crash['signature'])
            return True

        if '###!!! ABORT:' in abort_message:
            # Recent crash reports added some irrelevant information at the
            # beginning of the abort message. We want to remove that and keep
            # just the actual abort message.
            abort_message = abort_message.split('###!!! ABORT:', 1)[1]

        if ': file ' in abort_message:
            # Abort messages contain a file name and a line number. Since
            # those are very likely to change between builds, we want to
            # remove those parts from the signature.
            abort_message = abort_message.split(': file ', 1)[0]

        if 'unable to find a usable font' in abort_message:
            # "unable to find a usable font" messages include a parenthesized localized message. We
            # want to remove that. Bug #1385966
            open_paren = abort_message.find('(')
            if open_paren != -1:
                end_paren = abort_message.rfind(')')
                if end_paren != -1:
                    abort_message = abort_message[:open_paren] + abort_message[end_paren + 1:]

        abort_message = drop_unicode(abort_message).strip()

        if len(abort_message) > 80:
            abort_message = abort_message[:77] + '...'

        processed_crash['signature'] = 'Abort | {} | {}'.format(
            abort_message,
            processed_crash['signature']
        )

        return True
コード例 #4
0
def test_drop_unicode(text, expected):
    assert drop_unicode(text) == expected
コード例 #5
0
ファイル: test_util.py プロジェクト: stephendonner/socorro
def test_drop_unicode(text, expected):
    assert drop_unicode(text) == expected