Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/run-fuzzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
- name: Run fuzzing target
id: fuzz
run: |
CORPUS_DIR="fuzz/corpus/${FUZZ_NAME}"
FEATURES_FLAG=""
if [ -n "${{ inputs.extra_features }}" ]; then
FEATURES_FLAG="--features ${{ inputs.extra_features }}"
Expand All @@ -127,7 +128,7 @@ jobs:
${{ inputs.extra_env }} RUST_BACKTRACE=1 \
cargo +$NIGHTLY_TOOLCHAIN fuzz run --release --debug-assertions \
$FEATURES_FLAG \
${{ inputs.fuzz_target }} -- \
${{ inputs.fuzz_target }} "$CORPUS_DIR" -- \
$FORK_FLAG -max_total_time=${{ inputs.max_time }} -rss_limit_mb=0 \
2>&1 | tee fuzz_output.log
continue-on-error: true
Expand Down
15 changes: 8 additions & 7 deletions fuzz/fuzz_targets/compress_gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
#![no_main]
#![expect(clippy::unwrap_used)]

use std::sync::LazyLock;

use libfuzzer_sys::Corpus;
use libfuzzer_sys::fuzz_target;
use tokio::runtime::Builder;
use tokio::runtime::Runtime;
use vortex_error::vortex_panic;
use vortex_fuzz::FuzzCompressGpu;
use vortex_fuzz::run_compress_gpu;

fuzz_target!(|fuzz: FuzzCompressGpu| -> Corpus {
// Use tokio runtime to run async GPU fuzzer
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap();
static RUNTIME: LazyLock<Runtime> =
LazyLock::new(|| Builder::new_current_thread().enable_all().build().unwrap());

match rt.block_on(run_compress_gpu(fuzz)) {
fuzz_target!(|fuzz: FuzzCompressGpu| -> Corpus {
match RUNTIME.block_on(run_compress_gpu(fuzz)) {
Ok(true) => Corpus::Keep,
Ok(false) => Corpus::Reject,
Err(e) => {
Expand Down
Loading