def process_crashes(self, cycle):
        """Process and store crashes."""
        benchmark_type = benchmark_config.get_config(
            self.benchmark).get('type')
        is_bug_benchmark = benchmark_type == 'bug'
        if not is_bug_benchmark:
            return []

        if not os.listdir(self.crashes_dir):
            logs.info('No crashes found for cycle %d.', cycle)
            return []

        logs.info('Saving crash files crashes for cycle %d.', cycle)
        self.save_crash_files(cycle)

        logs.info('Processing crashes for cycle %d.', cycle)
        app_binary = coverage_utils.get_coverage_binary(self.benchmark)
        crash_metadata = run_crashes.do_crashes_run(app_binary,
                                                    self.crashes_dir)
        crashes = []
        for crash_key in crash_metadata:
            crash = crash_metadata[crash_key]
            crashes.append(
                models.Crash(crash_key=crash_key,
                             crash_testcase=crash.crash_testcase,
                             crash_type=crash.crash_type,
                             crash_address=crash.crash_address,
                             crash_state=crash.crash_state,
                             crash_stacktrace=crash.crash_stacktrace))
        return crashes
    def test_integration_do_coverage_run_crash(self):
        """Test that do_coverage_run returns crashing inputs."""
        llvm_tools_path = os.path.abspath(
            os.path.join(TEST_DATA_PATH, '..', 'llvm_tools'))
        os.environ["PATH"] = llvm_tools_path + os.pathsep + os.environ["PATH"]

        crashes_dir = os.path.join(TEST_DATA_PATH, 'crash-corpus')
        crashes = run_crashes.do_crashes_run(self.APP_BINARY_PATH, crashes_dir)

        expected_crash_key = 'Abrt:fuzz_target.c\n'
        assert len(crashes) == 1
        assert expected_crash_key in crashes
        actual_crash = crashes[expected_crash_key]
        assert actual_crash.crash_testcase == 'crash'
        assert actual_crash.crash_type == 'Abrt'
        assert actual_crash.crash_address
        assert actual_crash.crash_state == 'fuzz_target.c\n'
        assert ('ERROR: AddressSanitizer: ABRT on unknown address'
                in actual_crash.crash_stacktrace)