Skip to content

Commit c7c9a8e

Browse files
authored
Propagate fuzz_targets for RemoteRegularBuild. (#4166)
This is required for OSS-Fuzz after the uworker refactor. This fixes the following exception: ``` Error occurred while working on task. Traceback (most recent call last): File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/python/bot/startup/run_bot.py", line 146, in task_loop commands.process_command(task) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/commands.py", line 249, in process_command task.high_end, task.is_command_override) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/commands.py", line 159, in wrapper return func(task_name, task_argument, job_name, *args, **kwargs) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/commands.py", line 433, in process_command_impl preprocess) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/commands.py", line 218, in run_command result = task.execute(task_argument, job_name, uworker_env) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/task_types.py", line 105, in execute self.execute_locally(task_argument, job_type, uworker_env) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/task_types.py", line 63, in execute_locally uworker_output = utasks.uworker_main_no_io(self.module, uworker_input) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/utasks/__init__.py", line 211, in uworker_main_no_io uworker_output = utask_module.utask_main(uworker_input) File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py", line 1919, in utask_main return session.run() File "/mnt/scratch0/bots/oss-fuzz-linux-zone1-host-bsw9-13/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py", line 1731, in run self.fuzz_task_output.fuzz_targets.extend(build_setup_result.fuzz_targets) TypeError: Value must be iterable ```
1 parent 9360dbc commit c7c9a8e

File tree

4 files changed

+115
-111
lines changed

4 files changed

+115
-111
lines changed

src/clusterfuzz/_internal/bot/untrusted_runner/build_setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# pylint: disable=no-member
2121

2222

23-
def _build_response(result):
23+
def _build_response(build, result):
2424
if not result:
2525
return untrusted_runner_pb2.SetupBuildResponse(result=False)
2626

@@ -32,12 +32,13 @@ def _build_response(result):
3232
build_dir=environment.get_value('BUILD_DIR'),
3333
build_url=environment.get_value('BUILD_URL'),
3434
fuzz_target=environment.get_value('FUZZ_TARGET'),
35-
fuzz_target_count=environment.get_value('FUZZ_TARGET_COUNT'))
35+
fuzz_target_count=environment.get_value('FUZZ_TARGET_COUNT'),
36+
fuzz_targets=build.fuzz_targets or [])
3637

3738

3839
def setup_regular_build(request):
3940
"""Set up a regular build."""
4041
build = build_manager.RegularBuild(request.base_build_dir, request.revision,
4142
request.build_url, request.target_weights,
4243
request.build_prefix)
43-
return _build_response(build.setup())
44+
return _build_response(build, build.setup())

src/clusterfuzz/_internal/bot/untrusted_runner/build_setup_host.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def _handle_response(build, response):
4545
build_manager.set_environment_vars([fuzzer_directory])
4646

4747
environment.set_value('APP_REVISION', build.revision)
48+
build.fuzz_targets = list(response.fuzz_targets)
49+
4850
return True
4951

5052

src/clusterfuzz/_internal/protos/untrusted_runner.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ message SetupBuildResponse {
4646
optional string build_url = 6;
4747
optional string fuzz_target = 7;
4848
optional int32 fuzz_target_count = 8;
49+
repeated string fuzz_targets = 9;
4950
}
5051

5152
message SetupRegularBuildRequest {

0 commit comments

Comments
 (0)