@@ -98,6 +98,60 @@ def _is_bug_filed(testcase):
9898 return False
9999
100100
101+ def _is_blocking_progress_android (testcase ):
102+ """Checks the crash frequency if it is reported on libfuzzer"""
103+ if testcase .job_type .startswith ('libfuzzer' ):
104+ # Get crash statistics data on this unreproducible crash for last X days.
105+ last_hour = crash_stats .get_last_successful_hour ()
106+ if not last_hour :
107+ # No crash stats available, skip.
108+ return False
109+
110+ _ , rows = crash_stats .get (
111+ end = last_hour ,
112+ block = 'day' ,
113+ days = data_types .FILE_CONSISTENT_UNREPRODUCIBLE_TESTCASE_DEADLINE ,
114+ group_by = 'reproducible_flag' ,
115+ where_clause = (
116+ 'crash_type = %s AND crash_state = %s AND security_flag = %s' %
117+ (json .dumps (testcase .crash_type ), json .dumps (testcase .crash_state ),
118+ json .dumps (testcase .security_flag ))),
119+ group_having_clause = '' ,
120+ sort_by = 'total_count' ,
121+ offset = 0 ,
122+ limit = 1 )
123+
124+ # Calculate total crash count and crash days count.
125+ crash_days_indices = set ()
126+ total_crash_count = 0
127+ for row in rows :
128+ if 'groups' not in row :
129+ continue
130+
131+ total_crash_count += row ['totalCount' ]
132+ for group in row ['groups' ]:
133+ for index in group ['indices' ]:
134+ crash_days_indices .add (index ['hour' ])
135+
136+ crash_days_count = len (crash_days_indices )
137+ # Considers an unreproducible testcase as important if the crash
138+ # occurred at least once everyday for the last 14 days and total
139+ # crash count exceeded 14.
140+ return (crash_days_count ==
141+ data_types .FILE_CONSISTENT_UNREPRODUCIBLE_TESTCASE_DEADLINE and
142+ total_crash_count >=
143+ data_types .FILE_UNREPRODUCIBLE_TESTCASE_MIN_STARTUP_CRASH_THRESHOLD )
144+
145+ return False
146+
147+
148+ def is_crash_important_android (testcase ):
149+ """"Indicate if the android crash is important to file."""
150+ if _is_blocking_progress_android (testcase ):
151+ return True
152+ return False
153+
154+
101155def _is_crash_important (testcase ):
102156 """Indicate if the crash is important to file."""
103157 if not testcase .one_time_crasher_flag :
@@ -429,10 +483,19 @@ def main():
429483 # Check if the crash is important, i.e. it is either a reproducible crash
430484 # or an unreproducible crash happening frequently.
431485 if not _is_crash_important (testcase ):
432- _set_testcase_stuck_state (testcase , False )
433- logs .info (
434- f'Skipping testcase { testcase_id } , since the crash is not important.' )
435- continue
486+ # Check if the crash is a startup crash, i.e. it is causing the fuzzer
487+ # to crash on startup and not allowing the fuzzer to run longer
488+ if testcase .platform == "android" and is_crash_important_android (
489+ testcase ):
490+ logs .info (
491+ f'Considering testcase { testcase_id } , since it is a startup crash'
492+ ' on android platform.' )
493+ else :
494+ _set_testcase_stuck_state (testcase , False )
495+ logs .info (
496+ f'Skipping testcase { testcase_id } , since the crash is not important.'
497+ )
498+ continue
436499
437500 # Require that all tasks like minimizaton, regression testing, etc have
438501 # finished.
0 commit comments