From 3f8243687ac3c145148b15c610ef5ae07e4658a1 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 9 May 2023 19:27:33 +0000 Subject: [PATCH 1/3] fuzz.sh: update comments for IPC4. No functional change. Update comments for brand new IPC4 support. No functional change. Signed-off-by: Marc Herbert --- scripts/fuzz.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/fuzz.sh b/scripts/fuzz.sh index 69fdc90f3ae0..d5fefa98abb5 100755 --- a/scripts/fuzz.sh +++ b/scripts/fuzz.sh @@ -38,11 +38,12 @@ EOFHELP void ipc_cmd(struct ipc_cmd_hdr *_hdr) { -+ __ASSERT(false, "test the fuzzer test"); ++ __ASSERT(false, "test the IPC3 fuzzer test"); + struct sof_ipc_cmd_hdr *hdr = ipc_from_hdr(_hdr); EOF_TEST_PATCH +# When fuzzing IPC4, make the same change in src/ipc/ipc4/handler.c#ipc_cmd() main() { From e1bc1849397ebe89815de6e4b501c76ba466ed23 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 9 May 2023 19:31:14 +0000 Subject: [PATCH 2/3] .github/fuzzer: fix comment indentation, applies to only one fuzzer Fix the comment indentation to show it applies only to the older fuzzer. Signed-off-by: Marc Herbert --- .github/workflows/ipc_fuzzer.yml | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ipc_fuzzer.yml b/.github/workflows/ipc_fuzzer.yml index b19cade4180e..3cc8aab2c52d 100644 --- a/.github/workflows/ipc_fuzzer.yml +++ b/.github/workflows/ipc_fuzzer.yml @@ -8,24 +8,25 @@ name: IPC fuzzing # yamllint disable-line rule:truthy on: [pull_request, workflow_dispatch] +jobs: -# For the actual fuzzer see tools/oss-fuzz/README. -# also see -# https://google.github.io/oss-fuzz/getting-started/continuous-integration/ -# -# Build and run fuzzer for 5s just to check that it runs properly. If it -# consistently fails in under 5s you probably did something wrong -# If you came here to quickly copy/paste the invocation of some build -# script in order to reproduce a failure reported by github then you -# will be disappointed by the Github Action below: it's magical. For a -# thorough reproduction you must follow the links above. For a quick, -# dirty and incomplete reproduction hack you can try the following two -# lines. Don't do this at home. -# -# OUT=unused_dir cmake -B oss-fuzz-build/ -S tools/oss-fuzz/ -# make -j -C oss-fuzz-build sof_ep fuzz_ipc.o -jobs: + # For the actual fuzzer see tools/oss-fuzz/README. + # also see + # https://google.github.io/oss-fuzz/getting-started/continuous-integration/ + # + # Build and run fuzzer for 5s just to check that it runs properly. If it + # consistently fails in under 5s you probably did something wrong + + # If you came here to quickly copy/paste the invocation of some build + # script in order to reproduce a failure reported by github then you + # will be disappointed by the Github Action below: it's magical. For a + # thorough reproduction you must follow the links above. For a quick, + # dirty and incomplete reproduction hack you can try the following two + # lines. Don't do this at home. + # + # OUT=unused_dir cmake -B oss-fuzz-build/ -S tools/oss-fuzz/ + # make -j -C oss-fuzz-build sof_ep fuzz_ipc.o ipc-fuzzer-build: runs-on: ubuntu-latest steps: From 96859ddae7b94e4809794213c246881dd4994750 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 9 May 2023 19:32:24 +0000 Subject: [PATCH 3/3] .github/fuzzer: add IPC matrix and IPC4 to new fuzzer Hot on the heels of PR #7531. Signed-off-by: Marc Herbert --- .github/workflows/ipc_fuzzer.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ipc_fuzzer.yml b/.github/workflows/ipc_fuzzer.yml index 3cc8aab2c52d..4861d9d4535c 100644 --- a/.github/workflows/ipc_fuzzer.yml +++ b/.github/workflows/ipc_fuzzer.yml @@ -42,16 +42,15 @@ jobs: language: c fuzz-seconds: 5 - - # TODO, to add IPC4 support fix compilation of: - # - # ./scripts/fuzz.sh -t 1 -- -DCONFIG_IPC_MAJOR_4=y - # - # ... or of some other _IPC4_ -DOVERLAY_CONFIG= - # - # Then use a simple IPC3/IPC4 matrix like the one in zephyr.yml - simple-IPC3-fuzz_sh: + # Newer fuzzer + simple-IPC-fuzz_sh: runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + # Keep these names short due to questionable Github UI choices + IPC: [IPC3, IPC4] + steps: - name: add i386 arch run: | @@ -79,4 +78,8 @@ jobs: cd workspace clang --verbose set -x - sof/scripts/fuzz.sh -o _.log -t 300 + case '${{ matrix.IPC }}' in + IPC3) cmake_arg='-DCONFIG_IPC_MAJOR_3=y' ;; + IPC4) cmake_arg='-DCONFIG_IPC_MAJOR_4=y' ;; + esac + sof/scripts/fuzz.sh -o _.log -t 300 -- "$cmake_arg"