Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Reached the type-length limit" error while compiling zebrad with nightly rust #923

Closed
teor2345 opened this issue Aug 19, 2020 · 5 comments · Fixed by #930
Closed

"Reached the type-length limit" error while compiling zebrad with nightly rust #923

teor2345 opened this issue Aug 19, 2020 · 5 comments · Fixed by #930
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@teor2345
Copy link
Collaborator

teor2345 commented Aug 19, 2020

When I build zebrad with rust nightly 2020-08-18, I see the following error:

Compiling zebrad v3.0.0-alpha.0 (/home/dev/zebra/zebrad)
error: reached the type-length limit while instantiating std::thread::LocalKey::<std::cel...Result<(), color_eyre: :Report>>>
|
= note: consider adding a #![type_length_limit="1466135"] attribute to your crate

I see similar errors for other types, it seems like the maximum size is around 2MB.

The first bad Zebra commit is 6aeefce, which adds extra tracing and metrics.

The first bad rustc commit is rust-lang/rust@0a49057 which changes how types are normalised. It seems to interact badly with a known issue with exponential blowouts in nested types.

As far as rustc goes, I get this error on:

  • nightly-2020-08-18
  • nightly-2020-08-17
  • nightly-2020-08-16
  • nightly-2020-08-15
  • nightly-2020-08-14

But not on:

  • nightly-2020-08-13
  • stable

Some related rustc tickets are:

It seems to be caused by futures, tracing has also had similar issues:

@teor2345 teor2345 added C-bug Category: This is a bug E-med A-rust Area: Updates to Rust code labels Aug 19, 2020
@teor2345
Copy link
Collaborator Author

We didn't catch this bug in our CI, because we don't run a nightly compile job.

I opened #924 to see if that's worthwhile.

@teor2345 teor2345 added the E-help-wanted Call for participation: Help is requested to fix this issue. label Aug 19, 2020
@teor2345
Copy link
Collaborator Author

I'm going to need help to:

  • write a rustc bug report
  • find a minimal test case

@dconnolly or @yaahc, can you help me report a bug in rustc?

@teor2345
Copy link
Collaborator Author

teor2345 commented Aug 19, 2020

I've created a rust zulip thread to get help.

@teor2345
Copy link
Collaborator Author

I bisected Zebra, the first bad commit is 6aeefce, which adds extra tracing and metrics.

@teor2345
Copy link
Collaborator Author

Looks like the instrument proc macro is responsible for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-bug Category: This is a bug E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant