Giter Club home page Giter Club logo

Comments (11)

najamelan avatar najamelan commented on August 23, 2024 1

@sdroege overflow has been found: snapview/tungstenite-rs#241

from async-tungstenite.

sdroege avatar sdroege commented on August 23, 2024 1

Thanks for the notification, I'll get a new async-tungstenite 0.16 release with updated dependencies done in a bit.

from async-tungstenite.

sdroege avatar sdroege commented on August 23, 2024

Between 0.14 and 0.15 the only real change was the update to tungstenite 0.15, so that's where I would look for the underlying problem here.

I don't have a Windows machine set up here so can't really look into this, but if you can provide a backtrace of the stackoverlow that might give some thints.

from async-tungstenite.

jbr avatar jbr commented on August 23, 2024

I'll see if I can make a sync tungstenite repro and file over there if so

from async-tungstenite.

sdroege avatar sdroege commented on August 23, 2024

Thanks, please link it here then. The problem might of course still be here and be caused by wrong usage of tungstenite :)

from async-tungstenite.

najamelan avatar najamelan commented on August 23, 2024

Can confirm there is a stack overflow on linux as well. Glad to see I'm not the only one. I also think it's in tungstenite-rs.

from async-tungstenite.

sdroege avatar sdroege commented on August 23, 2024

The testcase at the top does not fail with a stack overflow on Linux for me. Do you have another testcase, @najamelan?

from async-tungstenite.

najamelan avatar najamelan commented on August 23, 2024

There is a test for ws_stream_tungstentite that fails with a stack overflow. I suspect the new input buffer they put in tungstenite but unfortunately ws_stream_tungstenite doesn't compile with 0.14. So I can't just bisect it. I will try to create a reproducable example without async-tungstenite and ws_stream to see if it can really be detected on tungstenite alone, because that would simplify things a lot.

In any case if you want to give it a shot you can checkout ws_stream_tungstenite, change deps to be 0.15 and run ci/test.bash. The test ping_pong_async_std fails with a SO.

The last few functions in the stack trace are:

#1  0x000055555562e75a in tungstenite::handshake::machine::HandshakeMachine<async_tungstenite::compat::AllowStd<async_std::net::tcp::stream::TcpStream>>::single_round<async_tungstenite::compat::AllowStd<async_std::net::tcp::stream::TcpStream>, http::response::Response<()>> (self=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tungstenite-0.15.0/src/handshake/machine.rs:39
#2  0x000055555563fa0e in tungstenite::handshake::MidHandshake<tungstenite::handshake::client::ClientHandshake<async_tungstenite::compat::AllowStd<async_std::net::tcp::stream::TcpStream>>>::handshake<tungstenite::handshake::client::ClientHandshake<async_tungstenite::compat::AllowStd<async_std::net::tcp::stream::TcpStream>>> (self=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tungstenite-0.15.0/src/handshake/mod.rs:42
#3  0x000055555564754b in async_tungstenite::client_async_with_config::{generator#0}::{closure#0}<http::request::Request<()>, async_std::net::tcp::stream::TcpStream> (allow_std=...)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/async-tungstenite-0.15.0/src/lib.rs:131
#4  0x00005555556390e0 in async_tungstenite::handshake::{impl#1}::poll<tungstenite::handshake::client::ClientHandshake<async_tungstenite::compat::AllowStd<async_std::net::tcp::stream::TcpStream>>, async_tungstenite::client_async_with_config::{generator#0}::{closure#0}, async_std::net::tcp::stream::TcpStream> (self=..., ctx=0x7ffff7b2fb98)
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/async-tungstenite-0.15.0/src/handshake.rs:138
#5  0x000055555563a746 in async_tungstenite::handshake::handshake::{generator#0}<tungstenite::handshake::client::ClientHandshake<async_tungstenite::compat::AllowStd<async_std::net::tcp::stream::TcpStream>>, async_tungstenite::client_async_with_config::{generator#0}::{closure#0}, async_std::net::tcp::stream::TcpStream> ()
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/async-tungstenite-0.15.0/src/handshake.rs:77
#6  0x00005555556576ed in core::future::from_generator::{impl#1}::poll<async_tungstenite::handshake::handshake::{generator#0}> (self=..., cx=0x7ffff7b2fb98) at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/future/mod.rs:80
#7  0x0000555555639ad5 in async_tungstenite::handshake::client_handshake::{generator#0}<async_tungstenite::client_async_with_config::{generator#0}::{closure#0}, async_std::net::tcp::stream::TcpStream> ()
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/async-tungstenite-0.15.0/src/handshake.rs:99
#8  0x00005555556573cd in core::future::from_generator::{impl#1}::poll<async_tungstenite::handshake::client_handshake::{generator#0}> (self=..., cx=0x7ffff7b2fb98) at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/future/mod.rs:80
#9  0x0000555555646f4b in async_tungstenite::client_async_with_config::{generator#0}<http::request::Request<()>, async_std::net::tcp::stream::TcpStream> ()
    at /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/async-tungstenite-0.15.0/src/lib.rs:133
#10 0x00005555556575dd in core::future::from_generator::{impl#1}::poll<async_tungstenite::client_async_with_config::{generator#0}> (self=..., cx=0x7ffff7b2fb98) at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/future/mod.rs:80

Unfortunately it's not straight forward to know which function uses to much stack space...

from async-tungstenite.

sdroege avatar sdroege commented on August 23, 2024

That's quite a small stack trace. The buffer used by HandshakeState::Reading is about 4kB large and on the stack, everything else seems small enough. That's probably multiple times on the stack here as it's also part of the StartedHandshake from async-tungstenite and MidHandshake from tungstenite.

from async-tungstenite.

sdroege avatar sdroege commented on August 23, 2024

Ah good, thanks for notifying. So that was basically the one I pointed out above.

from async-tungstenite.

najamelan avatar najamelan commented on August 23, 2024

Ah good, thanks for notifying. So that was basically the one I pointed out above.

Yes, well spotted. tungstenite 0.16 has been released with the fix.

from async-tungstenite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.