Skip to contentSkip to conversation

gitlab-ci.yml: Only run one test-case per fuzzer

PATCH In review Alexander Bulekov 4 participants 8 messages Oct 2, 2020 – Oct 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitlab-ci.yml: Only run one test-case per fuzzer

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +1 -1
index a51c89554f..075c15d45c 100644
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
       done
     # Unrelated to fuzzer: run some tests with -fsanitize=address
     - cd build-oss-fuzz && make check-qtest-i386 check-unit
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +0 -0
index a51c89554f..075c15d45c 100644

.gitlab-ci.yml build-oss-fuzz: · line 309

Quoted 8 lines
.gitlab-ci.yml +1 -1
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
       done
     # Unrelated to fuzzer: run some tests with -fsanitize=address
     - cd build-oss-fuzz && make check-qtest-i386 check-unit
Acked-by on v1 1/1
#2 lore raw
In reply to Alexander Bulekov
Quoted 17 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +0 -0
index a51c89554f..075c15d45c 100644

.gitlab-ci.yml build-oss-fuzz: · line 306

Quoted 5 lines
.gitlab-ci.yml +1 -1
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;

... but we're apparently already using a fixed seed for running the test, so it should be pretty much deterministic, shouldn't it? So the chance that the fuzzer hits a crash here for a pre-existing problem should be close to zero? ... so I'm not quite sure whether we really need this? Anyway, I certainly also won't object this patch, so in case anybody wants to merge it:

#3 lore raw
Quoted 13 lines · Thomas Huth
Quoted 12 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

.gitlab-ci.yml build-oss-fuzz: · line 306

Quoted 10 lines
.gitlab-ci.yml +1 -1
index a51c89554f..075c15d45c 100644
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;

... but we're apparently already using a fixed seed for running the test, so it should be pretty much deterministic, shouldn't it? So the chance that the fuzzer hits a crash here for a pre-existing problem should be close to zero? ... so I'm not quite sure whether we really need this?

You are right, "non-negligible chance that the fuzzer can trigger a crash" shouldn't be a problem. What matters is we don't waste CI resources, 1 run is enough to test the fuzzer is working.

Quoted 5 lines

Anyway, I certainly also won't object this patch, so in case anybody wants to merge it:

#4 lore raw
Quoted 31 lines · Philippe Mathieu-Daudé
Quoted 13 lines · Thomas Huth
Quoted 12 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

.gitlab-ci.yml build-oss-fuzz: · line 306

Quoted 10 lines
.gitlab-ci.yml +1 -1
index a51c89554f..075c15d45c 100644
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;

... but we're apparently already using a fixed seed for running the test, so it should be pretty much deterministic, shouldn't it? So the chance that the fuzzer hits a crash here for a pre-existing problem should be close to zero? ... so I'm not quite sure whether we really need this?

Quoted 3 lines

You are right, "non-negligible chance that the fuzzer can trigger a crash" shouldn't be a problem. What matters is we don't waste CI resources, 1 run is enough to test the fuzzer is working.

Ok, considering that gitlab is currently thinking about limiting the free CI minutes, that's a valid reason, indeed.

Thomas

#5 lore raw
In reply to Thomas Huth
Quoted 22 lines · Thomas Huth
Quoted 21 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +0 -1
index a51c89554f..075c15d45c 100644
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
Quoted 8 lines

.gitlab-ci.yml build-oss-fuzz: · line 306

Quoted 1 line
.gitlab-ci.yml +1 -0
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;

... but we're apparently already using a fixed seed for running the test, so it should be pretty much deterministic, shouldn't it? So the chance that the fuzzer hits a crash here for a pre-existing problem should be close to zero? ... so I'm not quite sure whether we really need this? Anyway, I certainly also won't object this patch, so in case anybody wants to merge it:

In addition to using an RNG+seed, libfuzzer also uses coverage information to guide mutations. My guess is that as QEMU changes, this coverage can change as well, so I wouldn't assume that using the same seed will result in the same inputs generated, in the longer term.

Its true that the main benefit will probably be a few minutes shaved off the 400 minute limit...
Thanks
-Alex

Quoted 3 lines
Reviewed-by on v1 1/1
#6 lore raw
In reply to Alexander Bulekov
Quoted 8 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

Quoted 19 lines
---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +1 -1
index a51c89554f..075c15d45c 100644
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
       done
     # Unrelated to fuzzer: run some tests with -fsanitize=address
     - cd build-oss-fuzz && make check-qtest-i386 check-unit
Signature · 1 line
2.28.0
#7 lore raw
In reply to Alexander Bulekov
Quoted 17 lines · Alexander Bulekov

With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.yml +0 -0
index a51c89554f..075c15d45c 100644

.gitlab-ci.yml build-oss-fuzz: · line 309

Quoted 8 lines
.gitlab-ci.yml +1 -1
@@ -303,7 +303,7 @@ build-oss-fuzz:
                       | grep -v slirp); do
         grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
         echo Testing ${fuzzer} ... ;
-        "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
+        "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
       done
     # Unrelated to fuzzer: run some tests with -fsanitize=address
     - cd build-oss-fuzz && make check-qtest-i386 check-unit

Thanks, queued to:

https://gitlab.com/huth/qemu/-/commits/qtest-next/

Thomas