Skip to content

Commit

Permalink
Add some logs to investigate minimization issues and disable multi th…
Browse files Browse the repository at this point in the history
…read runs
  • Loading branch information
alhijazi committed Jan 29, 2025
1 parent 0180d11 commit a962ada
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/clusterfuzz/_internal/bot/minimizer/minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def _deadline_exceeded(self, cleanup_function=None, soft_check=False):
"""Check to see if we have exceeded the deadline for execution."""
if self.minimizer.deadline and time.time() > self.minimizer.deadline:
if soft_check:
logs.warning(f'Minimization deadline exceeded. soft_check={soft_check}')
return True

# If we are here, we have exceeded the deadline on a hard check. Clean up.
Expand All @@ -192,6 +193,7 @@ def _deadline_exceeded(self, cleanup_function=None, soft_check=False):
if self.minimizer.cleanup_function:
self.minimizer.cleanup_function()

logs.warning('Minimization deadline exceeded.')
# Raise an exception if this is not a soft deadline check.
raise errors.MinimizationDeadlineExceededError(self)

Expand Down Expand Up @@ -558,6 +560,7 @@ def minimize(self, data):
# minimized test case is stored with it so that we can recover the work
# that had been done up to that point.
testcase = error.testcase
logs.warning('Minimization Deadline Exceeded.')
except errors.TokenizationFailureError:
logs.info('Tokenized data did not match original data. Defaulting to line'
'minimization.')
Expand Down
7 changes: 6 additions & 1 deletion src/clusterfuzz/_internal/bot/tasks/utasks/minimize_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
' should have been detected in preprocess.')
return None

max_threads = utils.maximum_parallel_processes_allowed()
# TODO(alhijazi): re-install multithreaded runs
# max_threads = utils.maximum_parallel_processes_allowed()
# Temporarily run minimization single threaded.
max_threads = 1

# Prepare the test case runner.
crash_retries = environment.get_value('CRASH_RETRIES')
Expand Down Expand Up @@ -1748,8 +1751,10 @@ def do_html_minimization(test_function, get_temp_file, data, deadline, threads,
delete_temp_files=delete_temp_files,
progress_report_function=logs.info)
try:
logs.info('Launching html minimization.')
return current_minimizer.minimize(data)
except minimizer_errors.AntlrDecodeError:
logs.info('Launching line minimization.')
return do_line_minimization(test_function, get_temp_file, data, deadline,
threads, cleanup_interval, delete_temp_files)

Expand Down

0 comments on commit a962ada

Please sign in to comment.