expose minimized_stack_depth functionality in the CLI/API (#715)

This commit is contained in:
bmc-msft 2021-03-23 10:09:34 -04:00 committed by GitHub
parent 92d8299412
commit 516b1e000e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 52 additions and 0 deletions

View File

@ -1702,6 +1702,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "Generator Options",
"type": "array"
},
"minimized_stack_depth": {
"title": "Minimized Stack Depth",
"type": "integer"
},
"preserve_existing_outputs": {
"title": "Preserve Existing Outputs",
"type": "boolean"
@ -2192,6 +2196,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "Generator Options",
"type": "array"
},
"minimized_stack_depth": {
"title": "Minimized Stack Depth",
"type": "integer"
},
"preserve_existing_outputs": {
"title": "Preserve Existing Outputs",
"type": "boolean"
@ -2627,6 +2635,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "Generator Options",
"type": "array"
},
"minimized_stack_depth": {
"title": "Minimized Stack Depth",
"type": "integer"
},
"preserve_existing_outputs": {
"title": "Preserve Existing Outputs",
"type": "boolean"
@ -3036,6 +3048,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "Generator Options",
"type": "array"
},
"minimized_stack_depth": {
"title": "Minimized Stack Depth",
"type": "integer"
},
"preserve_existing_outputs": {
"title": "Preserve Existing Outputs",
"type": "boolean"
@ -3472,6 +3488,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "Generator Options",
"type": "array"
},
"minimized_stack_depth": {
"title": "Minimized Stack Depth",
"type": "integer"
},
"preserve_existing_outputs": {
"title": "Preserve Existing Outputs",
"type": "boolean"
@ -4782,6 +4802,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
"title": "Generator Options",
"type": "array"
},
"minimized_stack_depth": {
"title": "Minimized Stack Depth",
"type": "integer"
},
"preserve_existing_outputs": {
"title": "Preserve Existing Outputs",
"type": "boolean"

View File

@ -311,6 +311,17 @@ libfuzzer_linux = JobTemplate(
),
],
),
UserField(
name="minimized_stack_depth",
help="Number of frames to include in the minimized stack",
type=UserFieldType.Int,
locations=[
UserFieldLocation(
op=UserFieldOperation.replace,
path="/tasks/1/task/minimized_stack_depth",
),
],
),
UserField(
name="tags",
help=TAGS_HELP,

View File

@ -351,6 +351,9 @@ def build_task_config(
if TaskFeature.report_list in definition.features:
config.report_list = task_config.task.report_list
if TaskFeature.minimized_stack_depth in definition.features:
config.minimized_stack_depth = task_config.task.minimized_stack_depth
if TaskFeature.expect_crash_on_failure in definition.features:
config.expect_crash_on_failure = (
task_config.task.expect_crash_on_failure

View File

@ -106,6 +106,7 @@ TASK_DEFINITIONS = {
TaskFeature.target_timeout,
TaskFeature.check_retry_count,
TaskFeature.check_fuzzer_help,
TaskFeature.minimized_stack_depth,
],
vm=VmDefinition(compare=Compare.AtLeast, value=1),
containers=[
@ -378,6 +379,7 @@ TASK_DEFINITIONS = {
TaskFeature.check_asan_log,
TaskFeature.check_debugger,
TaskFeature.check_retry_count,
TaskFeature.minimized_stack_depth,
],
vm=VmDefinition(compare=Compare.AtLeast, value=1),
containers=[
@ -424,6 +426,7 @@ TASK_DEFINITIONS = {
TaskFeature.check_debugger,
TaskFeature.check_retry_count,
TaskFeature.report_list,
TaskFeature.minimized_stack_depth,
],
vm=VmDefinition(compare=Compare.AtLeast, value=1),
containers=[
@ -487,6 +490,7 @@ TASK_DEFINITIONS = {
TaskFeature.check_fuzzer_help,
TaskFeature.check_retry_count,
TaskFeature.report_list,
TaskFeature.minimized_stack_depth,
],
vm=VmDefinition(compare=Compare.AtLeast, value=1),
containers=[

View File

@ -848,6 +848,7 @@ class Tasks(Endpoint):
preserve_existing_outputs: bool = False,
colocate: bool = False,
report_list: Optional[List[str]] = None,
minimized_stack_depth: Optional[int] = None,
) -> models.Task:
"""
Create a task
@ -912,6 +913,7 @@ class Tasks(Endpoint):
wait_for_files=task_wait_for_files,
report_list=report_list,
preserve_existing_outputs=preserve_existing_outputs,
minimized_stack_depth=minimized_stack_depth,
),
)

View File

@ -59,6 +59,7 @@ class Libfuzzer(Command):
colocate_secondary_tasks: bool = True,
check_fuzzer_help: bool = True,
expect_crash_on_failure: bool = True,
minimized_stack_depth: Optional[int] = None,
) -> None:
regression_containers = [
@ -89,6 +90,7 @@ class Libfuzzer(Command):
check_fuzzer_help=check_fuzzer_help,
debug=debug,
colocate=colocate_all_tasks or colocate_secondary_tasks,
minimized_stack_depth=minimized_stack_depth,
)
fuzzer_containers = [
@ -175,6 +177,7 @@ class Libfuzzer(Command):
check_fuzzer_help=check_fuzzer_help,
debug=debug,
colocate=colocate_all_tasks or colocate_secondary_tasks,
minimized_stack_depth=minimized_stack_depth,
)
def basic(
@ -208,6 +211,7 @@ class Libfuzzer(Command):
colocate_secondary_tasks: bool = True,
check_fuzzer_help: bool = True,
expect_crash_on_failure: bool = True,
minimized_stack_depth: Optional[int] = None,
) -> Optional[Job]:
"""
Basic libfuzzer job
@ -288,6 +292,7 @@ class Libfuzzer(Command):
colocate_secondary_tasks=colocate_secondary_tasks,
check_fuzzer_help=check_fuzzer_help,
expect_crash_on_failure=expect_crash_on_failure,
minimized_stack_depth=minimized_stack_depth,
)
self.logger.info("done creating tasks")

View File

@ -79,6 +79,7 @@ class TaskFeature(Enum):
check_fuzzer_help = "check_fuzzer_help"
expect_crash_on_failure = "expect_crash_on_failure"
report_list = "report_list"
minimized_stack_depth = "minimized_stack_depth"
# Permissions for an Azure Blob Storage Container.

View File

@ -171,6 +171,7 @@ class TaskDetails(BaseModel):
ensemble_sync_delay: Optional[int]
preserve_existing_outputs: Optional[bool]
report_list: Optional[List[str]]
minimized_stack_depth: Optional[int]
@validator("check_retry_count", allow_reuse=True)
def validate_check_retry_count(cls, value: int) -> int:
@ -399,6 +400,7 @@ class TaskUnitConfig(BaseModel):
stats_format: Optional[StatsFormat]
ensemble_sync_delay: Optional[int]
report_list: Optional[List[str]]
minimized_stack_depth: Optional[int]
# from here forwards are Container definitions. These need to be inline
# with TaskDefinitions and ContainerTypes