File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ jobs:
116116 - name : Run fuzzing target
117117 id : fuzz
118118 run : |
119+ CORPUS_DIR="fuzz/corpus/${FUZZ_NAME}"
119120 FEATURES_FLAG=""
120121 if [ -n "${{ inputs.extra_features }}" ]; then
121122 FEATURES_FLAG="--features ${{ inputs.extra_features }}"
@@ -127,7 +128,7 @@ jobs:
127128 ${{ inputs.extra_env }} RUST_BACKTRACE=1 \
128129 cargo +$NIGHTLY_TOOLCHAIN fuzz run --release --debug-assertions \
129130 $FEATURES_FLAG \
130- ${{ inputs.fuzz_target }} -- \
131+ ${{ inputs.fuzz_target }} "$CORPUS_DIR" -- \
131132 $FORK_FLAG -max_total_time=${{ inputs.max_time }} -rss_limit_mb=0 \
132133 2>&1 | tee fuzz_output.log
133134 continue-on-error : true
Original file line number Diff line number Diff line change 44#![ no_main]
55#![ expect( clippy:: unwrap_used) ]
66
7+ use std:: sync:: LazyLock ;
8+
79use libfuzzer_sys:: Corpus ;
810use libfuzzer_sys:: fuzz_target;
11+ use tokio:: runtime:: Builder ;
12+ use tokio:: runtime:: Runtime ;
913use vortex_error:: vortex_panic;
1014use vortex_fuzz:: FuzzCompressGpu ;
1115use vortex_fuzz:: run_compress_gpu;
1216
13- fuzz_target ! ( |fuzz: FuzzCompressGpu | -> Corpus {
14- // Use tokio runtime to run async GPU fuzzer
15- let rt = tokio:: runtime:: Builder :: new_current_thread( )
16- . enable_all( )
17- . build( )
18- . unwrap( ) ;
17+ static RUNTIME : LazyLock < Runtime > =
18+ LazyLock :: new ( || Builder :: new_current_thread ( ) . enable_all ( ) . build ( ) . unwrap ( ) ) ;
1919
20- match rt. block_on( run_compress_gpu( fuzz) ) {
20+ fuzz_target ! ( |fuzz: FuzzCompressGpu | -> Corpus {
21+ match RUNTIME . block_on( run_compress_gpu( fuzz) ) {
2122 Ok ( true ) => Corpus :: Keep ,
2223 Ok ( false ) => Corpus :: Reject ,
2324 Err ( e) => {
You can’t perform that action at this time.
0 commit comments