cea-sec / sanzu

Graphical remote desktop solution
GNU General Public License v3.0
175 stars 27 forks source link

[Windows] -d doesn't work "Cannot dup output" #277

Open JeremieSpiesser opened 4 months ago

JeremieSpiesser commented 4 months ago

Hello :wave: , I am once again using sanzu server on a windows laptop with the -d option to keep the server alive after a connection but I get an error when reconnecting a second time.

[2024-03-04T16:14:49.540590300Z ERROR sanzu::server_windows] Change resolution: unsupported os
[2024-03-04T16:14:49.700296000Z ERROR sanzu::server] Error in sound encoder init: No suitable sound context
[2024-03-04T16:14:49.717665200Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:49.718144000Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:49.734213600Z ERROR sanzu::server_windows] Change resolution: unsupported os
[2024-03-04T16:14:50.032263300Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.032711200Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.128019400Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.128404600Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.204568000Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.204997800Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.281374200Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.281650700Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.376718100Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.376954300Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.451961800Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.452160700Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.550828900Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.551238800Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:50.889222500Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:50.889613000Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:51.105727600Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:51.105913300Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:51.181060300Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:51.181253600Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:51.401365800Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:51.401675100Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:51.492427800Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:51.492819700Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:51.595424900Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:51.595701300Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.097569700Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.097952800Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.159197600Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.159454000Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.260745500Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.261194400Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.324050300Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.324342200Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.384056000Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.384350900Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.443292900Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.443576500Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.546179500Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.546578200Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.608237300Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.608529500Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.689883900Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.690242900Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.792610000Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2024-03-04T16:14:52.792939500Z ERROR sanzu::server_windows]  - due to wait timeout
[2024-03-04T16:14:52.858042700Z ERROR sanzu::server] Server error
[2024-03-04T16:14:52.858284800Z ERROR sanzu::server]  - due to Cannot recv client msgs
[2024-03-04T16:14:52.859709500Z ERROR sanzu::server]  - due to Received error msg
[2024-03-04T16:14:52.861367600Z ERROR sanzu::server]  - due to Error in recv pkt
[2024-03-04T16:14:52.862302600Z ERROR sanzu::server]  - due to Cannot read pkt
[2024-03-04T16:14:52.863165600Z ERROR sanzu::server]  - due to failed to fill whole buffer
thread '<unnamed>' panicked at 'Cannot register class', sanzu/src/server_windows.rs:787:13
stack backtrace:
[2024-03-04T16:14:55.513834700Z ERROR sanzu::server_windows] Cannot dup output 80070057
[2024-03-04T16:14:55.514448400Z ERROR sanzu::server] Server error
[2024-03-04T16:14:55.515694400Z ERROR sanzu::server]  - due to Cannot init d3d11
[2024-03-04T16:14:55.519037000Z ERROR sanzu::server]  - due to Cannot create d3d11 device
   0:     0x7ff640a094e0 - std::backtrace_rs::backtrace::dbghelp::trace::h76d21d4b9ec8b891
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\..\..\backtrace\src\backtrace/dbghelp.rs:98:5
   1:     0x7ff640a094e0 - std::backtrace_rs::backtrace::trace_unsynchronized::h54369dea4708e383
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\..\..\backtrace\src\backtrace/mod.rs:66:5
   2:     0x7ff640a094e0 - std::sys_common::backtrace::_print_fmt::h8ac096f49d815b7f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common/backtrace.rs:65:5
   3:     0x7ff640a094e0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdc944f32004b311a
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common/backtrace.rs:44:22
   4:     0x7ff640a6a23b - core::fmt::write::ha729c9936c4a8414
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\core\src\fmt/mod.rs:1232:17
   5:     0x7ff6409fe945 - std::io::Write::write_fmt::h2511a2513b74ad56
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\io/mod.rs:1684:15
   6:     0x7ff640a09234 - std::sys_common::backtrace::_print::h901b9be7e445e94e
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common/backtrace.rs:47:5
   7:     0x7ff640a09234 - std::sys_common::backtrace::print::hc23f6ed5e856c796
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys_common/backtrace.rs:34:9
   8:     0x7ff640a0c50f - std::panicking::default_hook::{{closure}}::hd0fb66704d0b9f0d
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src/panicking.rs:271:22
   9:     0x7ff640a0c1e3 - std::panicking::default_hook::h0263f58822955394
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src/panicking.rs:290:9
  10:     0x7ff640a0ce59 - std::panicking::rust_panic_with_hook::h29bfb30d9d96520d
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src/panicking.rs:692:13
  11:     0x7ff6404ae389 - std::panicking::begin_panic::{{closure}}::hd2db19648272c034
  12:     0x7ff6404a5d19 - std::sys_common::backtrace::__rust_end_short_backtrace::h7356014124bceecb
  13:     0x7ff64044919d - std::panicking::begin_panic::h579a4d0a11f4d683
  14:     0x7ff6404aafe0 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf384a33be86d2272
  15:     0x7ff6404aeee5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h39b80331e50eef37
  16:     0x7ff640a1e2b7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9b27f325ec3b8130
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\alloc\src/boxed.rs:1987:9
  17:     0x7ff640a1e2b7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hedf96d7c85a04a8b
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\alloc\src/boxed.rs:1987:9
  18:     0x7ff640a1e2b7 - std::sys::windows::thread::Thread::new::thread_start::h706c609e140d04ab
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library\std\src\sys\windows/thread.rs:56:17
  19:     0x7ffa986b7344 - <unknown>
  20:     0x7ffa988226b1 - <unknown>

I'm running the server with the command sanzu_server.exe -f sanzu.toml -l 0.0.0.0 -e h264_qsv -d -a.

The Server error due to Cannot recv client msgs happens when I quit the sanzu client, and the Cannot dup output happens when I reconnect back. Once again, happy to provide more logs if needed.

serpilliere commented 4 months ago

I managed to reproduce the issue. Maybe we have something that is not reinitialized properly here.

A quick&dirty tricks may be not to use the '-d' option in favor using re running the server. We are preparing a new version of Sanzu (which improve a lot of point here) which may be the issue.

We will release it soon.

JeremieSpiesser commented 4 months ago

okay, I managed to re run the server automatically with a .bat file, pasting it here if anyone find it useful

@echo off
:start
start /w "sanzu server loop" /d "C:\Users\path\to\folder\where\sanzu_server.exe\is" sanzu_server.exe -f sanzu.toml -e h264_qsv -l 0.0.0.0
goto start

That will do the trick, thanks for the idea.

serpilliere commented 4 months ago

If you don't mind, I will keep the issue open as it is a bug in the server.