Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Warn on SDK/CLI creation of libfuzzer_coverage task (#1944)
Browse files Browse the repository at this point in the history
The old `libfuzzer_coverage` task dumps binary sancov tables. Its output is not usable on its own. This task has been superseded by the generic `coverage` task (which produces actual modoffset and source line coverage).

Add a CLI warning if it is used, in preparation for removing it.
  • Loading branch information
ranweiler authored May 14, 2022
1 parent b3e7f9b commit 806409b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
responses,
webhooks,
)
from onefuzztypes.enums import TaskType
from pydantic import BaseModel
from six.moves import input # workaround for static analysis

Expand Down Expand Up @@ -802,7 +803,7 @@ def create_with_config(self, config: models.TaskConfig) -> models.Task:
def create(
self,
job_id: UUID_EXPANSION,
task_type: enums.TaskType,
task_type: TaskType,
target_exe: str,
containers: List[Tuple[enums.ContainerType, primitives.Container]],
*,
Expand Down Expand Up @@ -852,6 +853,13 @@ def create(

self.logger.debug("creating task: %s", task_type)

if task_type == TaskType.libfuzzer_coverage:
self.logger.warning(
"DEPRECATED: the `libfuzzer_coverage` task type is deprecated. "
"It will be removed in an upcoming release. "
"Please migrate to the `coverage` task type."
)

job_id_expanded = self._disambiguate_uuid(
"job_id",
job_id,
Expand Down

0 comments on commit 806409b

Please sign in to comment.