Skip to content

Commit

Permalink
Revert "Make fuzz crashes uworker safe (#4000)"
Browse files Browse the repository at this point in the history
This reverts commit 4a17b2f.
  • Loading branch information
vitorguidi committed Jul 3, 2024
1 parent ee40f9a commit 1fa920c
Show file tree
Hide file tree
Showing 9 changed files with 497 additions and 547 deletions.
23 changes: 14 additions & 9 deletions src/clusterfuzz/_internal/bot/tasks/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,8 @@ def get_fuzzer_directory(fuzzer_name):
return fuzzer_directory


def archive_testcase_and_dependencies_in_gcs(resource_list, testcase_path: str,
upload_url: str):
"""Archive testcase and its dependencies, and store in blobstore. Returns
whether it is archived, the absolute_filename, and the zip_filename."""
def archive_testcase_and_dependencies_in_gcs(resource_list, testcase_path):
"""Archive testcase and its dependencies, and store in blobstore."""
if not os.path.exists(testcase_path):
logs.error('Unable to find testcase %s.' % testcase_path)
return None, None, None
Expand Down Expand Up @@ -814,8 +812,13 @@ def archive_testcase_and_dependencies_in_gcs(resource_list, testcase_path: str,
try:
file_handle = open(testcase_path, 'rb')
except OSError:
<<<<<<< HEAD
logs.error('Unable to open testcase %s.' % testcase_path)
return None, None, None
=======
logs.log_error('Unable to open testcase %s.' % testcase_path)
return None, None, None, None
>>>>>>> parent of 4a17b2f8 (Make fuzz crashes uworker safe (#4000))
else:
# If there are resources, create an archive.

Expand Down Expand Up @@ -856,20 +859,22 @@ def archive_testcase_and_dependencies_in_gcs(resource_list, testcase_path: str,
try:
file_handle = open(zip_path, 'rb')
except OSError:
<<<<<<< HEAD
logs.error('Unable to open testcase archive %s.' % zip_path)
return None, None, None
=======
logs.log_error('Unable to open testcase archive %s.' % zip_path)
return None, None, None, None
>>>>>>> parent of 4a17b2f8 (Make fuzz crashes uworker safe (#4000))

archived = True
absolute_filename = testcase_path[base_len:]

if not storage.upload_signed_url(file_handle, upload_url):
logs.log_error('Failed to upload testcase.')
return None, None, None

fuzzed_key = blobs.write_blob(file_handle)
file_handle.close()

# Don't need the archive after writing testcase to blobstore.
if zip_path:
shell.remove_file(zip_path)

return archived, absolute_filename, zip_filename
return fuzzed_key, archived, absolute_filename, zip_filename
2 changes: 0 additions & 2 deletions src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ def uworker_main(input_download_url) -> None:

logs.info('Starting utask_main: %s.' % utask_module)
uworker_output = utask_module.utask_main(uworker_input)
uworker_output.bot_name = environment.get_value('BOT_NAME', '')
uworker_output.platform_id = environment.get_platform_id()
uworker_io.serialize_and_upload_uworker_output(uworker_output,
uworker_output_upload_url)
logs.info('Finished uworker_main.')
Expand Down
Loading

0 comments on commit 1fa920c

Please sign in to comment.