Fuzzing Crash: VortexError in file_corruption

Aberta
#12,173 6 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

  • #12471 de @myrrc — fechado sem integrar

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
53/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
backend

Direção de pesquisa

Start by reading vortex-layout/src/scan/split_by.rs, especially subdivide_large_spans around line 243 and SplitBy::splits around line 100; then trace its call from scan_builder.rs around line 411. Reproduce the out-of-memory abort with the fuzz/src/file/corruption.rs harness and inspect how corrupted files produce excessive spans. Done means the harness no longer triggers the 2 GiB allocation while valid scans still work.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug fuzzer

Fuzzing Crash Report

Analysis

Crash Location: realloc

Error Message:

libFuzzer: deadly signal
Stack Trace
    #0 0xbb7c22c99a94 in __sanitizer_print_stack_trace asan_stack.cpp
    #1 0xbb7c2d2fd178 in fuzzer::PrintStackTrace() /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libfuzzer-sys-0.4.13/libfuzzer/FuzzerUtil.cpp:210:38
    #2 0xbb7c2d321e70 in fuzzer::Fuzzer::HandleMalloc(unsigned long) /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libfuzzer-sys-0.4.13/libfuzzer/FuzzerLoop.cpp:131:18
    #3 0xbb7c2d321e70 in fuzzer::Fuzzer::HandleMalloc(unsigned long) /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libfuzzer-sys-0.4.13/libfuzzer/FuzzerLoop.cpp:125:6
    #4 0xbb7c2d321ee0 in fuzzer::MallocHook(void const volatile*, unsigned long) /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libfuzzer-sys-0.4.13/libfuzzer/FuzzerLoop.cpp:100:18
    #5 0xbb7c22c9f51c in __sanitizer::RunMallocHooks(void*, unsigned long) sanitizer_common.cpp
    #6 0xbb7c22c07d58 in __asan::Allocator::AllocateImpl(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool, bool) asan_allocator.cpp
    #7 0xbb7c22c02eac in __asan::Allocator::Reallocate(void*, unsigned long, __sanitizer::BufferedStackTrace*) asan_allocator.cpp
    #8 0xbb7c22c02e38 in __asan::asan_realloc(void*, unsigned long, __sanitizer::BufferedStackTrace*) asan_allocator.cpp
    #9 0xbb7c22c922d8 in realloc asan_malloc_linux.cpp
    #10 0xbb7c2684f1e0 in realloc_nonnull /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:260:14
    #11 0xbb7c2684f1e0 in grow_impl_runtime /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:384:31
    #12 0xbb7c2684f1e0 in grow_impl /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:487:9
    #13 0xbb7c2684f1e0 in grow /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:600:23
    #14 0xbb7c2684f1e0 in <alloc::raw_vec::RawVecInner>::finish_grow /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:580:28
    #15 0xbb7c2684ef08 in grow_amortized<alloc::alloc::Global> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:550:33
    #16 0xbb7c2684ef08 in grow_one<alloc::alloc::Global> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:514:41
    #17 0xbb7c2684ef08 in <alloc::raw_vec::RawVec<u64>>::grow_one /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:198:29
    #18 0xbb7c23c29498 in push_mut<u64, alloc::alloc::Global> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:1003:22
    #19 0xbb7c23c29498 in push<u64, alloc::alloc::Global> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:966:22
    #20 0xbb7c23c29498 in subdivide_large_spans /home/runner/work/vortex/vortex/vortex-layout/src/scan/split_by.rs:243:21
    #21 0xbb7c23c29498 in <vortex_layout::scan::split_by::SplitBy>::splits /home/runner/work/vortex/vortex/vortex-layout/src/scan/split_by.rs:100:17
    #22 0xbb7c22f938e8 in prepare<vortex_array::array::erased::ArrayRef> /home/runner/work/vortex/vortex/vortex-layout/src/scan/scan_builder.rs:411:26
    #23 0xbb7c22f938e8 in <vortex_layout::scan::scan_builder::LazyScanStream<vortex_array::array::erased::ArrayRef> as futures_core::stream::Stream>::poll_next::{closure#0} /home/runner/work/vortex/vortex/vortex-layout/src/scan/scan_builder.rs:497:65
    #24 0xbb7c22f04be4 in call_once<core::result::Result<core::pin::Pin<alloc::boxed::Box<(dyn futures_core::stream::Stream<Item=core::result::Result<vortex_array::array::erased::ArrayRef, vortex_error::VortexError>> + core::marker::Send), alloc::alloc::Global>>, vortex_error::VortexError>, vortex_layout::scan::scan_builder::{impl#4}::poll_next::{closure_env#0}<vortex_array::array::erased::ArrayRef>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9
    #25 0xbb7c22f04be4 in std::panicking::catch_unwind::do_call::<core::panic::unwind_safe::AssertUnwindSafe<<vortex_layout::scan::scan_builder::LazyScanStream<vortex_array::array::erased::ArrayRef> as futures_core::stream::Stream>::poll_next::{closure#0}>, core::result::Result<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream<Item = core::result::Result<vortex_array::array::erased::ArrayRef, vortex_error::VortexError>> + core::marker::Send>>, vortex_error::VortexError>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:573:43
    #26 0xbb7c2322b7ac in __rust_try vortex_fuzz.327295a9bec1910f-cgu.0
    #27 0xbb7c22f9f63c in catch_unwind<core::result::Result<core::pin::Pin<alloc::boxed::Box<(dyn futures_core::stream::Stream<Item=core::result::Result<vortex_array::array::erased::ArrayRef, vortex_error::VortexError>> + core::marker::Send), alloc::alloc::Global>>, vortex_error::VortexError>, core::panic::unwind_safe::AssertUnwindSafe<vortex_layout::scan::scan_builder::{impl#4}::poll_next::{closure_env#0}<vortex_array::array::erased::ArrayRef>>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:541:19
    #28 0xbb7c22f9f63c in catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<vortex_layout::scan::scan_builder::{impl#4}::poll_next::{closure_env#0}<vortex_array::array::erased::ArrayRef>>, core::result::Result<core::pin::Pin<alloc::boxed::Box<(dyn futures_core::stream::Stream<Item=core::result::Result<vortex_array::array::erased::ArrayRef, vortex_error::VortexError>> + core::marker::Send), alloc::alloc::Global>>, vortex_error::VortexError>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:359:14
    #29 0xbb7c22f9f63c in {closure#0}<vortex_layout::scan::scan_builder::{impl#4}::poll_next::{closure_env#0}<vortex_array::array::erased::ArrayRef>, core::result::Result<core::pin::Pin<alloc::boxed::Box<(dyn futures_core::stream::Stream<Item=core::result::Result<vortex_array::array::erased::ArrayRef, vortex_error::VortexError>> + core::marker::Send), alloc::alloc::Global>>, vortex_error::VortexError>> /home/runner/work/vortex/vortex/vortex-io/src/runtime/handle.rs:168:30
    #30 0xbb7c22f9f63c in <<vortex_io::runtime::handle::Handle>::spawn_cpu<<vortex_layout::scan::scan_builder::LazyScanStream<vortex_array::array::erased::ArrayRef> as futures_core::stream::Stream>::poll_next::{closure#0}, core::result::Result<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream<Item = core::result::Result<vortex_array::array::erased::ArrayRef, vortex_error::VortexError>> + core::marker::Send>>, vortex_error::VortexError>>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
    #31 0xbb7c261501fc in call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2466:9
    #32 0xbb7c261501fc in {async_block#0} /home/runner/work/vortex/vortex/vortex-io/src/runtime/smol.rs:49:70
    #33 0xbb7c261501fc in <async_executor::AsyncCallOnDrop<<vortex_io::runtime::smol::SmolExecutor as vortex_io::runtime::Executor>::spawn_cpu::{closure#0}, <async_executor::Executor>::spawn_inner<(), <vortex_io::runtime::smol::SmolExecutor as vortex_io::runtime::Executor>::spawn_cpu::{closure#0}>::{closure#0}> as core::future::future::Future>::poll /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-executor-1.14.0/src/lib.rs:1195:31
    #34 0xbb7c2609b170 in {closure#1}<async_executor::AsyncCallOnDrop<vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}, async_executor::{impl#5}::spawn_inner::{closure_env#0}<(), vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}>>, (), async_executor::{impl#5}::schedule::{closure_env#0}, ()> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-task-4.7.1/src/raw.rs:550:21
    #35 0xbb7c2609b170 in call_once<async_task::raw::{impl#3}::run::{closure_env#1}<async_executor::AsyncCallOnDrop<vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}, async_executor::{impl#5}::spawn_inner::{closure_env#0}<(), vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}>>, (), async_executor::{impl#5}::schedule::{closure_env#0}, ()>, ()> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
    #36 0xbb7c2609b170 in call_once<core::task::poll::Poll<()>, async_task::raw::{impl#3}::run::{closure_env#1}<async_executor::AsyncCallOnDrop<vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}, async_executor::{impl#5}::spawn_inner::{closure_env#0}<(), vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}>>, (), async_executor::{impl#5}::schedule::{closure_env#0}, ()>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9
    #37 0xbb7c2609b170 in std::panicking::catch_unwind::do_call::<core::panic::unwind_safe::AssertUnwindSafe<<async_task::raw::RawTask<async_executor::AsyncCallOnDrop<<vortex_io::runtime::smol::SmolExecutor as vortex_io::runtime::Executor>::spawn_cpu::{closure#0}, <async_executor::Executor>::spawn_inner<(), <vortex_io::runtime::smol::SmolExecutor as vortex_io::runtime::Executor>::spawn_cpu::{closure#0}>::{closure#0}>, (), <async_executor::Executor>::schedule::{closure#0}, ()>>::run::{closure#1}>, core::task::poll::Poll<()>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:573:43
    #38 0xbb7c26156cc4 in __rust_try vortex_io.69f013d23f606250-cgu.0
    #39 0xbb7c260f3b60 in catch_unwind<core::task::poll::Poll<()>, core::panic::unwind_safe::AssertUnwindSafe<async_task::raw::{impl#3}::run::{closure_env#1}<async_executor::AsyncCallOnDrop<vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}, async_executor::{impl#5}::spawn_inner::{closure_env#0}<(), vortex_io::runtime::smol::{impl#3}::spawn_cpu::{async_block_env#0}>>, (), async_executor::{impl#5}::schedule::{closure_env#0}, ()>>> /home/runner/.rustup/toolchains/nightly-2026-11-13-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:541:19
   ... (31 more frames truncated)
Root Cause Analysis

This is an out-of-memory abort, not a panic. libFuzzer stopped the run when a single realloc asked for 2 GiB (malloc(2147483648) in the log). The VortexError variant in the crash fields is a guess from the extractor; no Rust error is returned. The allocation happens in Vec::push inside subdivide_large_spans at vortex-layout/src/scan/split_by.rs:243. The call comes from SplitBy::splits (split_by.rs:100), which LazyScanStream's prepare step calls in scan_builder.rs:411.

The file_corruption harness (fuzz/src/file/corruption.rs) changes bytes in a valid Vortex file and then runs a full default scan through read_corrupted. The default split strategy is SplitBy::LayoutSubSplitting with max_rows equal to IDEAL_SPLIT_SIZE (100,000). subdivide_large_spans divides every boundary gap wider than max_rows into pieces of at most max_rows rows, and it adds each interior point to a Vec. The number of points is therefore about the declared row count divided by 100,000, and nothing limits it. The corruption most likely changed a row count in the footer or layout metadata, which gave the root layout's row_range or a chunk boundary a very large value. A row count of about 2.7e13 is enough to produce roughly 268 million boundaries, or 2 GiB of u64 values, before any data is read. Nothing checks the declared row count against the data that is actually in the file, so the splitting code trusts metadata from an untrusted source.

The library is at fault. The harness is right to expect a corrupted file to produce an error, not to exhaust memory. There are two possible fixes. The first is to check row counts in the layout or footer when the file is opened: a flat or chunked layout cannot declare far more rows than its segments could encode, and chunk row counts must add up to the parent's row count. The second is to stop computing all splits up front. A scan could produce the sub-split ranges lazily from (lo, hi, sub_size) on demand, or subdivide_large_spans could cap the number of splits and return a VortexError when the total is unreasonably large. The lazy version also removes the memory cost for very large files that are legitimate.

Summary
Reproduce
cargo +nightly fuzz run -D --sanitizer=none file_corruption ./fuzz/artifacts/file_corruption/oom-330906d67b3e2ec921e1c9cef64265f3a51de80d -- -rss_limit_mb=0
Reproduction Steps
  1. Download the crash artifact: https://github.com/vortex-data/vortex/actions/runs/45875423320/artifacts/15144318879

  2. Assuming you download the zipfile to ~/Downloads, and your working directory is the repository root:

# Create the artifacts directory if you haven't already.
mkdir -p ./fuzz/artifacts

# Move the zipfile.
mv ~/Downloads/file_corruption-crash-artifacts.zip ./fuzz/artifacts/

# Unzip the zipfile.
unzip ./fuzz/artifacts/file_corruption-crash-artifacts.zip -d ./fuzz/artifacts/

# You can remove the zipfile now if you want to.
rm ./fuzz/artifacts/file_corruption-crash-artifacts.zip
  1. Reproduce the crash:
cargo +nightly fuzz run -D --sanitizer=none file_corruption ./fuzz/artifacts/file_corruption/oom-330906d67b3e2ec921e1c9cef64265f3a51de80d -- -rss_limit_mb=0

If you want a backtrace:

RUST_BACKTRACE=1 cargo +nightly fuzz run -D --sanitizer=none file_corruption ./fuzz/artifacts/file_corruption/oom-330906d67b3e2ec921e1c9cef64265f3a51de80d -- -rss_limit_mb=0
RUST_BACKTRACE=full cargo +nightly fuzz run -D --sanitizer=none file_corruption ./fuzz/artifacts/file_corruption/oom-330906d67b3e2ec921e1c9cef64265f3a51de80d -- -rss_limit_mb=0
Single command to get a backtrace
mkdir -p ./fuzz/artifacts
mv ~/Downloads/file_corruption-crash-artifacts.zip ./fuzz/artifacts/
unzip ./fuzz/artifacts/file_corruption-crash-artifacts.zip -d ./fuzz/artifacts/
rm ./fuzz/artifacts/file_corruption-crash-artifacts.zip
RUST_BACKTRACE=1 cargo +nightly fuzz run -D --sanitizer=none file_corruption ./fuzz/artifacts/file_corruption/oom-330906d67b3e2ec921e1c9cef64265f3a51de80d -- -rss_limit_mb=0

Auto-created by fuzzing workflow

Linguagem predominante
Rust
Estrelas
3.2k
Forks
239
Merge médio
1d 4h
PRs com merge (30d)
684

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de vortex-data/vortex

Todas as issues de vortex-data/vortex

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.