Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some logs to investigate minimization issues and disable multi th…
Browse files Browse the repository at this point in the history
…read runs
alhijazi committed Jan 29, 2025
1 parent 0180d11 commit a5e3fd0
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
@@ -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.
@@ -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)

@@ -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(f'Minimization Deadline Exceeded.')
except errors.TokenizationFailureError:
logs.info('Tokenized data did not match original data. Defaulting to line'
'minimization.')
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
@@ -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')
@@ -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)

0 comments on commit a5e3fd0

Please sign in to comment.