Skip to content

Initial report: stack overflow on windows with 0.15 #98

@jbr

Description

@jbr

Hi! I'm still trying to understand this, but the following code works with 0.14 and stack overflows on windows with 0.15:

[package]
name = "async-tungstenite-stream-overflow-windows"
version = "0.1.0"
edition = "2018"

[dependencies]
async-global-executor = "2.0.2"
async-net = "1.6.1"
async-tungstenite = "0.15.0"
futures-util = "0.3.17"
fn main() {
    async_global_executor::block_on(async {
        let socket = async_net::TcpStream::connect("localhost:8080").await.unwrap();
        let (mut client, _) = async_tungstenite::client_async("ws://localhost/some/route", socket).await.unwrap();
        use futures_util::{SinkExt, StreamExt};
        client.send(async_tungstenite::tungstenite::Message::text("hello")).await.unwrap();
        dbg!(&client.next().await);  // commenting this line out avoids the stack overflow
    });
}

This expects a websocket echo server of some sort running at :8080, but I believe as long as the server responds with a message, this will overflow the stack on 0.15. Expected output (and 0.14 output) is something like:

&client.next().await = Some(
    Ok(
        Text(
            "received your message: hello",
        ),
    ),
)

Instead, the output is

thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\tungstenite-stream-overflow-windows.exe` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

I don't know nearly anything about windows and have been trying to investigate this on a cloud instance, but someone with a local windows machine will likely have more success. I have no understanding of why this is fine on my local mac.

Let me know if there's any more information I can provide to help investigate this, and thanks for async tungstenite!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions