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

stack overflow on windows #40

Closed
samhug opened this issue Aug 9, 2022 · 1 comment · Fixed by #41
Closed

stack overflow on windows #40

samhug opened this issue Aug 9, 2022 · 1 comment · Fixed by #41

Comments

@samhug
Copy link
Contributor

samhug commented Aug 9, 2022

When attempting to run this on windows I immediately get thread 'main' has overflowed its stack

I was able to get around this by heap allocating the wg.consume_task() future. With the below change I was able to forward a TCP port through a Wireguard tunnel

diff --git a/src/lib.rs b/src/lib.rs
index 57a3fc4..a43d657 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -53,7 +53,7 @@ pub async fn start_tunnels(config: Config, bus: Bus) -> anyhow::Result<()> {
     {
         // Start consumption task for WireGuard
         let wg = wg.clone();
-        tokio::spawn(async move { wg.consume_task().await });
+        tokio::spawn(Box::pin(async move { wg.consume_task().await }));
     }
 
     {
@aramperes
Copy link
Owner

Interesting! Could you open a pull-request with your change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants