Skip to content

Stack overflow in no_async_endpoint_handlers rule #11316

@qarmin

Description

@qarmin

File content(at the bottom should be attached raw, not formatted file - github removes some non-printable characters, so copying from here may not work):

{const{r}=r
e.delete(r)}

command

timeout -v 150 oxlint -D all -D nursery --import-plugin --jsdoc-plugin --jest-plugin --vitest-plugin --jsx-a11y-plugin --nextjs-plugin --react-perf-plugin TEST___FILE.js --fix --fix-suggestions --fix-dangerously

App was compiled with nightly rust compiler to be able to use address sanitizer
(You can ignore this part if there is no address sanitizer error)
On Ubuntu 24.04, the commands to compile were:

rustup default nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add llvm-tools-preview --toolchain nightly-x86_64-unknown-linux-gnu

export RUST_BACKTRACE=1 # or full depending on project
export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-18)
export ASAN_OPTIONS=symbolize=1
RUSTFLAGS="-Zsanitizer=address" cargo +nightly build --target x86_64-unknown-linux-gnu

cause this

AddressSanitizer:DEADLYSIGNAL
=================================================================
==134468==ERROR: AddressSanitizer: stack-overflow on address 0x7baf88bffee0 (pc 0x556701ae5436 bp 0x7baf88c001d0 sp 0x7baf88bffee0 T4)
    #0 0x556701ae5436 in oxc_linter::rules::oxc::no_async_endpoint_handlers::NoAsyncEndpointHandlers::check_endpoint_expr::h575f7ad150f07035 /home/runner/work/Automated-Fuzzer/Automated-Fuzzer/oxc-main/crates/oxc_linter/src/rules/oxc/no_async_endpoint_handlers.rs:205
    #1 0x556701ae5e0a in oxc_linter::rules::oxc::no_async_endpoint_handlers::NoAsyncEndpointHandlers::check_endpoint_expr::h575f7ad150f07035 /home/runner/work/Automated-Fuzzer/Automated-Fuzzer/oxc-main/crates/oxc_linter/src/rules/oxc/no_async_endpoint_handlers.rs:243:34
    
    ...

    #246 0x556701ae5e0a in oxc_linter::rules::oxc::no_async_endpoint_handlers::NoAsyncEndpointHandlers::check_endpoint_expr::h575f7ad150f07035 /home/runner/work/Automated-Fuzzer/Automated-Fuzzer/oxc-main/crates/oxc_linter/src/rules/oxc/no_async_endpoint_handlers.rs:243:34

SUMMARY: AddressSanitizer: stack-overflow /home/runner/work/Automated-Fuzzer/Automated-Fuzzer/oxc-main/crates/oxc_linter/src/rules/oxc/no_async_endpoint_handlers.rs:205 in oxc_linter::rules::oxc::no_async_endpoint_handlers::NoAsyncEndpointHandlers::check_endpoint_expr::h575f7ad150f07035
Thread T4 created by T0 here:
    #0 0x556701305e61 in pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:250:3
    #1 0x556702158483 in std::sys::pal::unix::thread::Thread::new::hcc5dd569cc1c1577 /rustc/283db70ace62a0ae704a624e43b68c2ee44b87a6/library/std/src/sys/pal/unix/thread.rs:76:19
    #2 0x55670207ccd6 in std::thread::Builder::spawn_unchecked_::h87b208e6c575530f /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:598:30
    #3 0x55670207ccd6 in std::thread::Builder::spawn_unchecked::h5b84f978e191f1ab /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:467:37
    #4 0x556702071a9d in std::thread::Builder::spawn::h5802c36ae0d06cd1 /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:399:23
    #5 0x556702071a9d in _$LT$rayon_core..registry..DefaultSpawn$u20$as$u20$rayon_core..registry..ThreadSpawn$GT$::spawn::h1384200d3662ad3d /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:98:11
    #6 0x556702073119 in rayon_core::registry::Registry::new::h9cd57f347500680e /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:304:57
    #7 0x5567020704c3 in rayon_core::registry::default_global_registry::ha4d3a26bd0ff6f13 /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:201:18
    #8 0x5567020704c3 in core::ops::function::FnOnce::call_once::h9566e6b0c86202bd /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
    #9 0x5567020704c3 in rayon_core::registry::set_global_registry::_$u7b$$u7b$closure$u7d$$u7d$::h6ada0a14ef70cbf6 /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:193:18
    #10 0x5567020704c3 in std::sync::poison::once::Once::call_once::_$u7b$$u7b$closure$u7d$$u7d$::h80580bc2968572d0 /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/poison/once.rs:155:41
    #11 0x55670215b9e3 in std::sys::sync::once::futex::Once::call::h0d2844eb55392fa8 /rustc/283db70ace62a0ae704a624e43b68c2ee44b87a6/library/std/src/sys/sync/once/futex.rs:176:21
    #12 0x556702071f18 in std::sync::poison::once::Once::call_once::h3146193cb2affa6d /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/poison/once.rs:155:20
    #13 0x556702071f18 in rayon_core::registry::set_global_registry::h94966b61f7f2e699 /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:192:22
    #14 0x556702071f18 in rayon_core::registry::global_registry::h4b7dd33059d2346c /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:166:5
    #15 0x556702073c44 in rayon_core::registry::Registry::current::h09002fcce6cfa13b /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs:319:17
    #16 0x55670139a000 in _$LT$oxlint..lint..LintRunner$u20$as$u20$oxlint..runner..Runner$GT$::run::hd56f2fe632351ae8 /home/runner/work/Automated-Fuzzer/Automated-Fuzzer/oxc-main/apps/oxlint/src/lint.rs:294:9
    #17 0x556701363c1a in oxlint::main::hf508fd18df6e433c /home/runner/work/Automated-Fuzzer/Automated-Fuzzer/oxc-main/apps/oxlint/src/main.rs:19:30
    #18 0x556701367ec2 in core::ops::function::FnOnce::call_once::he504fa5fc2d7118e /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
    #19 0x556701367ec2 in std::sys::backtrace::__rust_begin_short_backtrace::h0b31dcc6ab6b57fc /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:152:18
    #20 0x556701365e8b in std::rt::lang_start::h744fdc7fa66390b1 /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:205:5
    #21 0x7faf8bc2a1c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667)
    #22 0x7faf8bc2a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667)
    #23 0x556701294e14 in _start (/home/runner/.cargo/bin/oxlint+0x760e14) (BuildId: f438806d7094a274119130a1a7ddc558b835d91d)

==134468==ABORTING

##### Automatic Fuzzer note, output status "Some(1)", output signal "None"

compressed.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions