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

async/await: Sending Waker seems to invalidate it #57036

Closed
Janonard opened this Issue Dec 21, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@Janonard
Copy link

Janonard commented Dec 21, 2018

Hello everyone!

I recently started playing around with the new async/await features and wanted to implement a simple channel using the crossbeam channel and the new futures. The crossbeam channel itself isn't futures-aware, neither 0.1 futures nor the new ones, and therefore, I added another internal channel that sends wakers to the sender and when a new value is sent, the sender will wake all enqueued tasks.

My code is found in this repo: https://github.com/Janonard/rust-noopwake-bug

I expect the program to print 42 and then finish, which is often the case, but not always: Sometimes, I get an error saying thread 'tokio-runtime-worker-2' panicked at 'NoopWake cannot wake' (backtrace found here) and sometimes a simple thread 'tokio-runtime-worker-2' panicked at 'called 'Result::unwrap()' on an 'Err' value: ()' (backtrace found here). Also, after panicing, the program hangs.

Is this a bug within rust, tokio or crossbeam or have I simply made something wrong?

Meta

rustc --version --verbose:

rustc 1.33.0-nightly (09d6ab90e 2018-12-20)
binary: rustc
commit-hash: 09d6ab90e556bf692ff3f8790d97b3ca4fee94b0
commit-date: 2018-12-20
host: x86_64-unknown-linux-gnu
release: 1.33.0-nightly
LLVM version: 8.0
@cramertj

This comment has been minimized.

Copy link
Member

cramertj commented Dec 21, 2018

This is unrelated to rust-lang/rust-- can you open an issue on the futures repository?

@cramertj cramertj closed this Dec 21, 2018

@gralpli

This comment has been minimized.

Copy link
Contributor

gralpli commented Dec 30, 2018

@Janonard Today I stumbled upon what seems to be the same panic and I created a more minimal example (see here). Did you already open an issue on another repo? (I'm not sure if this belongs to tokio, futures or async/await.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment