Skip to content

Stack overflow in rustc #86556

Closed
Closed
@vcfxb

Description

@vcfxb

I'm running into a stack overflow in issue in rustc and I think it's related to macro, but I'm not sure. I copied the pertinent files from my project and reproduced the issue in this repository.

I expect this to compile without issue when I run cargo build (or at least give me a type error if there is one).
Instead, rustc overflows stack on stable, beta, and nightly.

Stable:

$ RUST_BACKTRACE=1 cargo +stable build
   Compiling rustc-stack-overflow v0.1.0 (/home/antonia/Desktop/Projects/rustc-stack-overflow)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `rustc-stack-overflow`

Caused by:
  process didn't exit successfully: `rustc --crate-name rustc_stack_overflow --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=20441d2a475a112e -C extra-filename=-20441d2a475a112e --out-dir /home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps -C incremental=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/incremental -L dependency=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps --extern graphql_client=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps/libgraphql_client-63af0a9b9458de3b.rlib` (signal: 6, SIGABRT: process abort signal)

Beta:

$ RUST_BACKTRACE=1 cargo +beta build
   Compiling rustc-stack-overflow v0.1.0 (/home/antonia/Desktop/Projects/rustc-stack-overflow)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `rustc-stack-overflow`

Caused by:
  process didn't exit successfully: `rustc --crate-name rustc_stack_overflow --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8cf59a22ee7dc950 -C extra-filename=-8cf59a22ee7dc950 --out-dir /home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps -C incremental=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/incremental -L dependency=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps --extern graphql_client=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps/libgraphql_client-ab1a22904b6ecf9a.rlib` (signal: 6, SIGABRT: process abort signal)

Nightly:

$ RUST_BACKTRACE=1 cargo +nightly build
   Compiling rustc-stack-overflow v0.1.0 (/home/antonia/Desktop/Projects/rustc-stack-overflow)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `rustc-stack-overflow`

Caused by:
  process didn't exit successfully: `rustc --crate-name rustc_stack_overflow --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2d8f35c6342eed3a -C extra-filename=-2d8f35c6342eed3a --out-dir /home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps -C incremental=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/incremental -L dependency=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps --extern graphql_client=/home/antonia/Desktop/Projects/rustc-stack-overflow/target/debug/deps/libgraphql_client-cf5984b918c1a8e3.rlib` (signal: 6, SIGABRT: process abort signal)

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.53.0 (53cb7b09b 2021-06-17)
binary: rustc
commit-hash: 53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b
commit-date: 2021-06-17
host: x86_64-unknown-linux-gnu
release: 1.53.0
LLVM version: 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions