Failed to run debug version after compiled, errors and some analyzation provided #2868

Closed
opened 2026-02-21 00:59:46 -05:00 by deekerman · 1 comment
Owner

Originally created by @CliffHan on GitHub (Jul 27, 2024).

Bug Description

As I used cargo run to compile and run the default debug version, I got this error:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 8m 24s
     Running `target\debug\rustdesk.exe`
[2024-07-27T06:25:07Z INFO  librustdesk::core_main] main start args:[]
[2024-07-27T06:25:08Z INFO  librustdesk::server] server not started (will try to start): 系统找不到指定的文件。 (os error 2)
[2024-07-27T06:25:10Z INFO  librustdesk::ipc] Started ipc server at path: \\.\pipe\RustDesk\query
[2024-07-27T06:25:10Z INFO  librustdesk::lan] lan discovery listener started
thread 'main' panicked at library\core\src\panicking.rs:219:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
error: process didn't exit successfully: `target\debug\rustdesk.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

I did some research, and found a similar case in this stackoverflow thread. It says that rust compiler added some unsafe precondtions assertion after 1.78: https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#asserting-unsafe-preconditions .

With RUST_BACKTRACE=1, looks like error happens in sciter:

thread 'main' panicked at library\core\src\panicking.rs:219:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\std\src\panicking.rs:652
   1: core::panicking::panic_nounwind_fmt::runtime
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\core\src\panicking.rs:110
   2: core::panicking::panic_nounwind_fmt
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\core\src\panicking.rs:120
   3: core::panicking::panic_nounwind
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\core\src\panicking.rs:219
   4: core::slice::raw::from_raw_parts::precondition_check
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9\library\core\src\ub_checks.rs:68
   5: core::slice::raw::from_raw_parts<sciter::capi::scvalue::VALUE>
             at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9\library\core\src\ub_checks.rs:75
   6: sciter::value::Value::unpack_from
             at C:\Users\cliff\.cargo\git\checkouts\rust-sciter-06aa50f9c0fcf3d6\fab913b\src\value.rs:563
   7: sciter::eventhandler::process_events
             at C:\Users\cliff\.cargo\git\checkouts\rust-sciter-06aa50f9c0fcf3d6\fab913b\src\eventhandler.rs:208
   8: sciter::eventhandler::_event_handler_window_proc<librustdesk::ui::UI>
             at C:\Users\cliff\.cargo\git\checkouts\rust-sciter-06aa50f9c0fcf3d6\fab913b\src\eventhandler.rs:54
   9: <unknown>
  10: SciterAPI

BTW, the release version could work.

How to Reproduce

just execute cargo run on windows with source

Expected Behavior

app starts as normal

Operating system(s) on local side and remote side

windows 11 -> others

RustDesk Version(s) on local side and remote side

1.2.7 -> others

Screenshots

not necessary

Additional Context

No response

Originally created by @CliffHan on GitHub (Jul 27, 2024). ### Bug Description As I used `cargo run` to compile and run the default debug version, I got this error: ``` Finished `dev` profile [unoptimized + debuginfo] target(s) in 8m 24s Running `target\debug\rustdesk.exe` [2024-07-27T06:25:07Z INFO librustdesk::core_main] main start args:[] [2024-07-27T06:25:08Z INFO librustdesk::server] server not started (will try to start): 系统找不到指定的文件。 (os error 2) [2024-07-27T06:25:10Z INFO librustdesk::ipc] Started ipc server at path: \\.\pipe\RustDesk\query [2024-07-27T06:25:10Z INFO librustdesk::lan] lan discovery listener started thread 'main' panicked at library\core\src\panicking.rs:219:5: unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. error: process didn't exit successfully: `target\debug\rustdesk.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN) ``` I did some research, and found a similar case in [this stackoverflow thread](https://stackoverflow.com/questions/78504296/rust-project-is-suddenly-failing-on-windows-slicefrom-raw-parts-requires-the). It says that rust compiler added some unsafe precondtions assertion after 1.78: https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#asserting-unsafe-preconditions . With `RUST_BACKTRACE=1`, looks like error happens in sciter: ``` thread 'main' panicked at library\core\src\panicking.rs:219:5: unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` stack backtrace: 0: std::panicking::begin_panic_handler at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\std\src\panicking.rs:652 1: core::panicking::panic_nounwind_fmt::runtime at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\core\src\panicking.rs:110 2: core::panicking::panic_nounwind_fmt at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\core\src\panicking.rs:120 3: core::panicking::panic_nounwind at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library\core\src\panicking.rs:219 4: core::slice::raw::from_raw_parts::precondition_check at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9\library\core\src\ub_checks.rs:68 5: core::slice::raw::from_raw_parts<sciter::capi::scvalue::VALUE> at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9\library\core\src\ub_checks.rs:75 6: sciter::value::Value::unpack_from at C:\Users\cliff\.cargo\git\checkouts\rust-sciter-06aa50f9c0fcf3d6\fab913b\src\value.rs:563 7: sciter::eventhandler::process_events at C:\Users\cliff\.cargo\git\checkouts\rust-sciter-06aa50f9c0fcf3d6\fab913b\src\eventhandler.rs:208 8: sciter::eventhandler::_event_handler_window_proc<librustdesk::ui::UI> at C:\Users\cliff\.cargo\git\checkouts\rust-sciter-06aa50f9c0fcf3d6\fab913b\src\eventhandler.rs:54 9: <unknown> 10: SciterAPI ``` BTW, the release version could work. ### How to Reproduce just execute `cargo run` on windows with source ### Expected Behavior app starts as normal ### Operating system(s) on local side and remote side windows 11 -> others ### RustDesk Version(s) on local side and remote side 1.2.7 -> others ### Screenshots not necessary ### Additional Context _No response_
deekerman 2026-02-21 00:59:46 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@rustdesk commented on GitHub (Jul 27, 2024):

#763

@rustdesk commented on GitHub (Jul 27, 2024): #763
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#2868
No description provided.