Handle update.
(testcase, revision, stacktraces, error, protocol_version)
| 50 | |
| 51 | |
| 52 | def handle_update(testcase, revision, stacktraces, error, protocol_version): |
| 53 | """Handle update.""" |
| 54 | |
| 55 | def is_still_crashing(st_index, stacktrace): |
| 56 | """Check if the the given stackstrace indicates |
| 57 | the testcase is still crashing""" |
| 58 | state = stack_analyzer.get_crash_data( |
| 59 | stacktrace, |
| 60 | fuzz_target=fuzz_target_name, |
| 61 | symbolize_flag=False, |
| 62 | already_symbolized=True, |
| 63 | detect_ooms_and_hangs=True) |
| 64 | |
| 65 | crash_comparer = CrashComparer(state.crash_state, testcase.crash_state) |
| 66 | if not crash_comparer.is_similar(): |
| 67 | return False |
| 68 | |
| 69 | logs.info(f'State for trial {st_index} of {testcase_id} ' |
| 70 | f'remains similar' |
| 71 | f'(old_state={testcase.crash_state}, ' |
| 72 | f'new_state={state.crash_state}).') |
| 73 | |
| 74 | is_security = crash_analyzer.is_security_issue( |
| 75 | state.crash_stacktrace, state.crash_type, state.crash_address) |
| 76 | if is_security != testcase.security_flag: |
| 77 | return False |
| 78 | |
| 79 | logs.info(f'Security flag for trial {st_index} of {testcase_id} ' |
| 80 | f'still matches' |
| 81 | f'({testcase.security_flag}).') |
| 82 | return True |
| 83 | |
| 84 | testcase_id = testcase.key.id() |
| 85 | logs.info('Got external update for testcase.', testcase_id=testcase_id) |
| 86 | if error: |
| 87 | _mark_errored(testcase, revision, error) |
| 88 | return |
| 89 | |
| 90 | last_tested_revision = ( |
| 91 | testcase.get_metadata('last_tested_revision') or testcase.crash_revision) |
| 92 | |
| 93 | if revision < last_tested_revision: |
| 94 | logs.warning(f'Revision {revision} less than previously tested ' |
| 95 | f'revision {last_tested_revision}.') |
| 96 | return |
| 97 | |
| 98 | if protocol_version not in [OLD_PROTOCOL, NEW_PROTOCOL]: |
| 99 | logs.error(f'Invalid protocol_version provided: ' |
| 100 | f'{protocol_version} ' |
| 101 | f'is not one of {{{OLD_PROTOCOL, NEW_PROTOCOL}}} ' |
| 102 | f'(testcase_id={testcase_id}).') |
| 103 | return |
| 104 | |
| 105 | if not stacktraces: |
| 106 | logs.error(f'Empty JSON stacktrace list provided ' |
| 107 | f'(testcase_id={testcase_id}).') |
| 108 | return |
| 109 |
no test coverage detected