Examples fails with stack overflow
Describe the bug
command-bot falls with STATUS_STACK_OVERFLOW
To Reproduce Steps to reproduce the behavior:
- Clone this repository
cd ./matrix-rust-sdk- Run example
cargo run -p example-command-bot -- "https://matrix.org" %USERNAME% %PASSWORD% - Verify session with another device
- Send or receive message
!party - See a bunch of text in your terminal
Expected behavior
- The bot will reply "🎉🎊🥳 let's PARTY!! 🥳🎊🎉" from my profile
- Maybe simple trace messsage
Desktop
- OS: Windows 10
- cargo 1.63.0 (fd9c4297c 2022-07-01)
- rustc 1.63.0 (4b91a6ea7 2022-08-08)
Additional context
If comment out tracing_subscriber::fmt::init();, naturally, there will be no messages, the bot responds to !party, but after a while it breaks with an error STATUS_STACK_OVERFLOW
The cross-signing-bootstrap example also crashes with an error STATUS_STACK_OVERFLOW, but I have not yet been able to reproduce the conditions.
I will check other examples later.
It looks like there are recursive calls to asynchronous functions somewhere without Pin (and possibly without recursion exit control)
Hi @simensgreen , thanks for the report.
could you a) run this with RUST_BACKTRACE=1 and b) post the traceback you are seeing (ideally as a code-block) here?
For me even the basic "Print incoming Messages to Console"-Example fails with STATUS_STACK_OVERFLOW instantly.
Here is my log: https://gist.github.com/Aaron2550/de648b3572d813d1c17e2ea412f088bc
Unfortunatly i am super new to Rust and i have no Idea why i cant seem to get a backtrace. No matter if i set the environment variable using Windows, using IntelliJ or using env::set_var("RUST_BACKTRACE", "1");, i get no additional output
My dependencies are:
matrix-sdk = "0.6.0"
tokio = { version = "1", features = ["full"] }
mini-redis = "0.4"
anyhow = "1.0.65"
tracing-subscriber = "0.3.15"
and my rust Version info is:
stable-x86_64-pc-windows-msvc (default)
rustc 1.64.0 (a55dd71d5 2022-09-19)
cargo 1.64.0 (387270bc7 2022-09-16)
Yeah, I actually think the backtrace is only ever printed when a panic happens, and a stack overflow aborts directly w/o going through panic.
I'm afraid you might have to go through a debugger or do print-based debugging yourself, as we don't have anybody on the team who is using Windows.
i have x64dbg installed, is there anything i can provide you guys with to maybe get this fixed?
Well yeah, this seems most likely to be infinite recursion so it would be helpful to know where that happens 😅
i compiled the same program in a linux vm and it works fine in linux. i didnt really get any useful info from debugging on windows
We recently landed two PRs to reduce the size of async fn state machines. Can somebody with access to a Windows machine check if the stack overflows still happen on main?
I'll assume that this has been fixed by https://github.com/matrix-org/matrix-rust-sdk/pull/1873. Please feel free to reopen if that's not the case.