Skip to content

rustc built by MIR overflows its stack for crates with very deep ASTs. #35408

Closed
@eddyb

Description

@eddyb

These examples have been found on crater:

These reproduce with stage2 but not stage1, unless stage0 is passed -Z orbit, which means a compiler built by MIR trans will use more stack space than old trans did.

For procinfo, there are just over 1000 frames, usually in the NodeIdAssigner, my guess is that its AST has a depth 500-700 in places (it's using nom, which might cause such extreme nesting).

cc @rust-lang/compiler

Metadata

Metadata

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-bugCategory: This is a bug.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions