Skip to content

rustc hangs #34535

Closed
Closed
@aochagavia

Description

@aochagavia

OS: Windows 10 x64
rustc: rustc 1.9.0 (e4e8b6668 2016-05-18) and rustc 1.11.0-nightly (ab0b87458 2016-06-13).

First of all I am sorry I was unable to come up with a minimal example. I tried a couple of times but it just didn't trigger the issue. I am working on a simple game, but instead of compiling in <10 seconds (as usual), it hangs indefinetly (I gave up after about 5 minutes).

Running with time-passes

When compiling with nightly, the output of cargo rustc -- -Ztime-passes is:

time: 0.032; rss: 27MB  parsing
time: 0.000; rss: 27MB  configuration 1
time: 0.000; rss: 27MB  recursion limit
time: 0.000; rss: 27MB  crate injection
time: 0.000; rss: 27MB  plugin loading
time: 0.000; rss: 27MB  plugin registration
time: 0.214; rss: 54MB  expansion
time: 0.000; rss: 54MB  gated configuration checking
time: 0.000; rss: 54MB  maybe building test harness
time: 0.000; rss: 54MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 54MB  complete gated feature checking
time: 0.000; rss: 54MB  assigning node ids
time: 0.000; rss: 54MB  collecting defs
time: 0.849; rss: 131MB external crate/lib resolution
time: 0.000; rss: 131MB early lint checks
time: 0.000; rss: 131MB AST validation
^C

As you can see, the compiler is stuck after AST validation (note how I needed ^C to kill Cargo).

When compiling with stable, the output is:

time: 0.003; rss: 41MB  parsing
time: 0.000; rss: 42MB  configuration 1
time: 0.000; rss: 42MB  recursion limit
time: 0.000; rss: 42MB  gated macro checking
time: 0.000; rss: 42MB  crate injection
time: 0.020; rss: 43MB  macro loading
time: 0.000; rss: 43MB  plugin loading
time: 0.000; rss: 43MB  plugin registration
time: 0.005; rss: 44MB  expansion
time: 0.000; rss: 44MB  complete gated feature checking 1
time: 0.001; rss: 44MB  configuration 2
time: 0.000; rss: 44MB  gated configuration checking
time: 0.000; rss: 44MB  maybe building test harness
time: 0.001; rss: 44MB  prelude injection
time: 0.000; rss: 44MB  checking that all macro invocations are gone
time: 0.000; rss: 44MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 44MB  complete gated feature checking 2
time: 0.000; rss: 44MB  const fn bodies and arguments
time: 0.000; rss: 44MB  assigning node ids
time: 0.000; rss: 44MB  lowering ast -> hir
time: 0.000; rss: 44MB  indexing hir
time: 0.000; rss: 44MB  attribute checking
time: 0.000; rss: 44MB  early lint checks
time: 0.144; rss: 50MB  external crate/lib resolution
time: 0.000; rss: 50MB  language item collection
^C

Additional information (tested on stable):

If I remove the controllers::keyboard module, the compiler runs without problems.

If I replace this line by pub fn press(key: u8) {, the output with -Ztime-passes changes:

time: 0.003; rss: 41MB  parsing
time: 0.000; rss: 42MB  configuration 1
time: 0.000; rss: 42MB  recursion limit
time: 0.000; rss: 42MB  gated macro checking
time: 0.000; rss: 42MB  crate injection
time: 0.020; rss: 43MB  macro loading
time: 0.000; rss: 43MB  plugin loading
time: 0.000; rss: 43MB  plugin registration
time: 0.004; rss: 44MB  expansion
time: 0.000; rss: 44MB  complete gated feature checking 1
time: 0.001; rss: 44MB  configuration 2
time: 0.000; rss: 44MB  gated configuration checking
time: 0.000; rss: 44MB  maybe building test harness
time: 0.001; rss: 44MB  prelude injection
time: 0.000; rss: 44MB  checking that all macro invocations are gone
time: 0.000; rss: 44MB  checking for inline asm in case the target doesn't support it
time: 0.000; rss: 44MB  complete gated feature checking 2
time: 0.000; rss: 44MB  const fn bodies and arguments
time: 0.000; rss: 44MB  assigning node ids
time: 0.000; rss: 44MB  lowering ast -> hir
time: 0.000; rss: 44MB  indexing hir
time: 0.000; rss: 44MB  attribute checking
time: 0.000; rss: 44MB  early lint checks
time: 0.144; rss: 50MB  external crate/lib resolution
time: 0.000; rss: 50MB  language item collection
time: 0.020; rss: 66MB  resolution
time: 0.000; rss: 66MB  lifetime resolution
time: 0.000; rss: 66MB  looking for entry point
time: 0.000; rss: 66MB  looking for plugin registrar
time: 0.000; rss: 66MB  region resolution
time: 0.000; rss: 66MB  loop checking
time: 0.000; rss: 66MB  static item recursion checking
time: 0.000; rss: 66MB  load_dep_graph
time: 0.003; rss: 66MB  type collecting
time: 0.000; rss: 66MB  variance inference
time: 0.094; rss: 101MB coherence checking
time: 0.001; rss: 101MB wf checking
time: 0.002; rss: 101MB item-types checking
^C

For whatever reason, rustc is able to go a little bit further in this case.

Related issues

Maybe this is a duplicate of #33776

Metadata

Metadata

Assignees

No one assigned

    Labels

    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-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions