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

rustc compiler crashed when using async in loop #67893

Open
fbucek opened this issue Jan 5, 2020 · 5 comments
Open

rustc compiler crashed when using async in loop #67893

fbucek opened this issue Jan 5, 2020 · 5 comments

Comments

@fbucek
Copy link

@fbucek fbucek commented Jan 5, 2020

When learning async/await feature I was struggling with running multiple tasks simultaneously.

Loop while let Some.... causes compiler to crash

https://github.com/fbucek/rust-async/blob/f6cc831c817a6b9d2f1c79182c5415b877f0da1e/actix-async/src/lib.rs#L30

Github Action crash output:

https://github.com/fbucek/rust-async/commit/f6cc831c817a6b9d2f1c79182c5415b877f0da1e/checks?check_suite_id=384856246

I expected to see this happen: Error message if something goes wrong.

Instead, this happened: Compiler crashed

Meta

Crash happens on macOS rustc 1.40 / Linux rustc 1.40 / Linux rustc 1.39 ( github actions )

rustc --version --verbose:

macOS

rustc 1.40.0 (73528e339 2019-12-16)
binary: rustc
commit-hash: 73528e339aae0f17a15ffa49a8ac608f50c6cf14
commit-date: 2019-12-16
host: x86_64-apple-darwin
release: 1.40.0
LLVM version: 9.0

Linux

rustc 1.40.0 (73528e339 2019-12-16)
binary: rustc
commit-hash: 73528e339aae0f17a15ffa49a8ac608f50c6cf14
commit-date: 2019-12-16
host: x86_64-unknown-linux-gnu
release: 1.40.0
LLVM version: 9.0
@Centril

This comment has been minimized.

Copy link
Member

@Centril Centril commented Jan 5, 2020

If you could provide an example that ICEs in e.g. the playground that would be helpful towards fixing the issue. :)

@fbucek

This comment has been minimized.

Copy link
Author

@fbucek fbucek commented Jan 5, 2020

Provided example is pretty small, but it is dependent on tokio and actix-web.

I do not know how to create such an example in playground, I do know know how I can replace async tokio::sync::mpsc with standard library which does not have async alternative as far as i know.

I have tried to simplify code but then crash disappear. Just putting everything into one file main.rs and crash is gone, code wont compile and reasonable errors show up.

@tmandry

This comment has been minimized.

Copy link
Contributor

@tmandry tmandry commented Jan 7, 2020

Visiting from triage.. we decided that as the first step we should reduce this reproducer to a more self-contained one.

@gilescope

This comment has been minimized.

Copy link
Contributor

@gilescope gilescope commented Jan 7, 2020

Can repro. Will try and min.

@gilescope

This comment has been minimized.

Copy link
Contributor

@gilescope gilescope commented Jan 8, 2020

Reduced version so far is here: https://github.com/gilescope/rust-async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.