handle libfuzzer fuzzing non-zero exits better (#381)

When running libfuzzer in 'fuzzing' mode, we expect the following on exit.

If the exit code is zero, crashing input isn't required.  This happens if the user specifies '-runs=N'

If the exit code is non-zero, then crashes are expected.  In practice, there are two causes to non-zero exits.
1. If the binary can't execute for some reason, like a missing prerequisite
2. If the binary _can_ execute, sometimes the sanitizers are put in such a bad place that they are unable to record the input that caused the crash.

This PR enables handling these two non-zero exit cases.

1. Optionally verify the libfuzzer target loads appropriately using `target_exe -help=1`.  This allows failing faster in the common issues, such a missing prerequisite library.
2. Optionally allow non-zero exits without crashes to be a warning, rather than a task failure.
This commit is contained in:
bmc-msft
2021-01-05 09:40:15 -05:00
committed by GitHub
parent 75d2ffd7f4
commit 37f06bb324
20 changed files with 240 additions and 21 deletions

View File

@ -75,6 +75,8 @@ class TaskFeature(Enum):
check_retry_count = "check_retry_count"
ensemble_sync_delay = "ensemble_sync_delay"
preserve_existing_outputs = "preserve_existing_outputs"
check_fuzzer_help = "check_fuzzer_help"
expect_crash_on_failure = "expect_crash_on_failure"
# Permissions for an Azure Blob Storage Container.

View File

@ -116,6 +116,8 @@ class TaskDetails(BaseModel):
check_asan_log: Optional[bool]
check_debugger: Optional[bool] = Field(default=True)
check_retry_count: Optional[int]
check_fuzzer_help: Optional[bool]
expect_crash_on_failure: Optional[bool]
rename_output: Optional[bool]
supervisor_exe: Optional[str]
supervisor_env: Optional[Dict[str, str]]
@ -310,6 +312,8 @@ class TaskUnitConfig(BaseModel):
check_asan_log: Optional[bool]
check_debugger: Optional[bool]
check_retry_count: Optional[int]
check_fuzzer_help: Optional[bool]
expect_crash_on_failure: Optional[bool]
rename_output: Optional[bool]
generator_exe: Optional[str]
generator_env: Optional[Dict[str, str]]