-
Notifications
You must be signed in to change notification settings - Fork 6
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
Stack overflow? #21
Comments
Hey @CR7273868 Thanks for the issue and minimal repro! If you implement Just a guess here -- but can you confirm that the The code should have |
So I either call reset? Since, async-dropper relies on Default. I will do a std::mem::take(&mut T); to reset it. And I’ll try diagnosing further with the reset impl. |
Ah I wasn't clear here -- actually If you override |
I must also say, this only happens when the program exits. If the code keeps running, it behaves as expected. I forgot to mention this. Try to replica using tokio signal ctrl_c. I will do your mentioned steps tonight, when I get home. |
OH! this is really interesting/important information -- yeah will try and reproduce this -- I assume you have a |
Yes, I have tokio::main macro with an async fn main(); Yes, I prepare a DashMap (https://docs.rs/dashmap/latest/dashmap/) within there uuid::Uuid as key & Arc inside another struct that’s called SelfBot (does not implement async-dropper). When signal ctrlc hits, I perform a clean up. I cancel the self_bot tokio task handle, then clear the dashmap that have the entries that implement: Default, async_dropper:AsyncDrop. when those values get dropped, that’s when it starts to panic with a tokio runtime worker, stack overflow. |
Hey @CR7273868 I'm having a hard time getting your example to compile -- the I've tried to replicate here: Please let me know if I'm missing something -- it doesn't compile, so now I'm wondering how you even got to that state! |
I found this minimal example to be able to cause a stack overflow. It only happens when the destructor is called of async drop within my project it just stack overflows and aborts the program.
Do note these supervisors are stored into a DashMap that's properly cleared out. So, async-drop is called right after the program enters it's exiting stage.
I just clear the map, after awaiting a tokio::signal::ctrl_c().await signal. I clear the map, the async-drop gets called & then async-dropper panics with:
I use the derive variant.
Rust ENV:
The text was updated successfully, but these errors were encountered: