Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some logs to investigate minimization issues and disable multi th… #4648

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading