Comments (11)
@sdroege overflow has been found: snapview/tungstenite-rs#241
from async-tungstenite.
Thanks for the notification, I'll get a new async-tungstenite 0.16 release with updated dependencies done in a bit.
from async-tungstenite.
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.
I'll see if I can make a sync tungstenite repro and file over there if so
from async-tungstenite.
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.
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.
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.
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.
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.
Ah good, thanks for notifying. So that was basically the one I pointed out above.
from async-tungstenite.
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)
- Inspecting the steam buffer HOT 3
- "thread 'async-std/runtime' panicked" when running "echo-server" example HOT 1
- Support fragmented messages HOT 3
- How to close connection gracefully after WebSocketStream.split()? HOT 2
- [Question]: How to optimise the memory usage for websocket client HOT 5
- could not find `async_std` in `async_tungstenite` HOT 6
- Support for the `smol` runtime HOT 1
- Add vendored feature for dependency crates so that statically linked OpenSSL can be used HOT 1
- ResetWithoutClosingHandshake when server sends more frequent messages. HOT 1
- Can't find `tungstenite::client::IntoClientRequest` HOT 5
- how to close websocket after it has been moved into select? HOT 12
- Task wakes too often in release mode when used with `async_std` HOT 11
- max connect just 50 onely HOT 2
- How to add TLS support to a websocket server for wss to work? HOT 2
- Disable certificate validation HOT 2
- How to disable logging for compact? HOT 5
- Avoid webpki-roots as a default dependency when tokio-rustls is used HOT 5
- Is it possible to flush all buffered messages before closing the stream? HOT 5
- Cloning `WebSocketStream`s HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-tungstenite.