-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 usage when using task::unowned
in debug builds
#4202
Comments
We already have some code for spawned tasks to avoid this here: Lines 130 to 136 in 84c4a6d
However if you are using |
Thanks for the quick reply, I made a PR to do just this |
Closed by #4203. |
Version
Tokio 1.12
Platform
Linux kernel 5.11 (Ubuntu)
Description
I ran into a stack overflow in my application, and I think one of the contributing factors might be tokio's stack usage. Similarly to #2055, I think I see that creating a task throught the
unowned
function goes through several layers of functions, each consuming creating a copy of the task on the stack before finally allocating it. The function sequence is as follows:As in #2055, my code runs fine when i compile with
--release
, but gets a stack overflow in the code above otherwise. I am not very familiar with assembly, so I could be completely wrong in thinking that the callstack above leads to a lot of duplication of the stack-allocated task data, and I'm also not sure how feasible it would be to optimize this, so feel free to close if this is not something you can address. For now, I will just try to reserve more stack space.The text was updated successfully, but these errors were encountered: