arm64 support + Segmentation fault unsafety when not ran as root on Linux #1165

Closed
opened 2026-02-20 23:19:49 -05:00 by deekerman · 3 comments
Owner

Originally created by @emidoots on GitHub (Dec 20, 2022).

Hello! I see that Rustdesk has armhf support for the raspberry pi (32 bit), but it would be great to support arm64 too.

arm64 SBCs are increasingly popular, as they are the most powerful arm development boards (e.g. the Rock Pi 5b).

I followed the build instructions and not much needs to change in order to get it working:

  1. The binary download wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so needs x64 changed to arm64
  2. vcpkg install libyuv is currently broken on arm64, but can be easily worked around by disabling NEON support: https://github.com/microsoft/vcpkg/issues/27410#issuecomment-1358892081

Once I did this I got a segmentation fault though:

 ./target/debug/rustdesk 
[2022-12-20T06:25:11Z INFO  librustdesk::server] DISPLAY=Ok(":0")
[2022-12-20T06:25:11Z INFO  librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority")
[2022-12-20T06:25:11Z INFO  librustdesk::server] server not started (will try to start): Connection refused (os error 111)
[2022-12-20T06:25:11Z INFO  librustdesk::server] DISPLAY=Ok(":0")
[2022-12-20T06:25:11Z INFO  librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority")
[2022-12-20T06:25:11Z INFO  librustdesk::lan] lan discovery listener started
[2022-12-20T06:25:11Z INFO  librustdesk::common] Testing nat ...
[2022-12-20T06:25:11Z INFO  librustdesk::rendezvous_mediator] start rendezvous mediator of rs-ny.rustdesk.com
[2022-12-20T06:25:11Z INFO  librustdesk::rendezvous_mediator] start rendezvous mediator of rs-cn.rustdesk.com
[2022-12-20T06:25:11Z INFO  librustdesk::rendezvous_mediator] start rendezvous mediator of rs-sg.rustdesk.com
[2022-12-20T06:25:11Z INFO  librustdesk::rendezvous_mediator] register_pk of rs-ny due to key not confirmed
[2022-12-20T06:25:11Z INFO  librustdesk::ipc] Started ipc server at path: /tmp/RustDesk/ipc
INFO:TIS: scaleFactor 1
INFO:TIS: current platform: Linux
INFO:TIS: is_xfce:  false
Segmentation fault

Notably, if it is ran as root there is no segfault but it exits immediately:

$ sudo ./target/debug/rustdesk 
Authorization required, but no authorization protocol specified
[2022-12-20T06:25:20Z INFO  librustdesk::server] DISPLAY=Ok(":0")
[2022-12-20T06:25:20Z INFO  librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority")
[2022-12-20T06:25:20Z INFO  librustdesk::server] server not started (will try to start): Connection refused (os error 111)
[2022-12-20T06:25:20Z INFO  librustdesk::server] DISPLAY=Ok(":0")
[2022-12-20T06:25:20Z INFO  librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority")

(rustdesk:85340): Gtk-WARNING **: 23:25:20.341: cannot open display: :0
Originally created by @emidoots on GitHub (Dec 20, 2022). Hello! I see that Rustdesk has armhf support for the raspberry pi (32 bit), but it would be great to support arm64 too. arm64 SBCs are increasingly popular, as they are the most powerful arm development boards (e.g. the Rock Pi 5b). I followed the build instructions and not much needs to change in order to get it working: 1. The binary download `wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so` needs `x64` changed to `arm64` 2. `vcpkg install libyuv` is currently broken on arm64, but can be easily worked around by disabling NEON support: https://github.com/microsoft/vcpkg/issues/27410#issuecomment-1358892081 Once I did this I got a segmentation fault though: ``` ./target/debug/rustdesk [2022-12-20T06:25:11Z INFO librustdesk::server] DISPLAY=Ok(":0") [2022-12-20T06:25:11Z INFO librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority") [2022-12-20T06:25:11Z INFO librustdesk::server] server not started (will try to start): Connection refused (os error 111) [2022-12-20T06:25:11Z INFO librustdesk::server] DISPLAY=Ok(":0") [2022-12-20T06:25:11Z INFO librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority") [2022-12-20T06:25:11Z INFO librustdesk::lan] lan discovery listener started [2022-12-20T06:25:11Z INFO librustdesk::common] Testing nat ... [2022-12-20T06:25:11Z INFO librustdesk::rendezvous_mediator] start rendezvous mediator of rs-ny.rustdesk.com [2022-12-20T06:25:11Z INFO librustdesk::rendezvous_mediator] start rendezvous mediator of rs-cn.rustdesk.com [2022-12-20T06:25:11Z INFO librustdesk::rendezvous_mediator] start rendezvous mediator of rs-sg.rustdesk.com [2022-12-20T06:25:11Z INFO librustdesk::rendezvous_mediator] register_pk of rs-ny due to key not confirmed [2022-12-20T06:25:11Z INFO librustdesk::ipc] Started ipc server at path: /tmp/RustDesk/ipc INFO:TIS: scaleFactor 1 INFO:TIS: current platform: Linux INFO:TIS: is_xfce: false Segmentation fault ``` Notably, if it is ran as root there is no segfault but it exits immediately: ``` $ sudo ./target/debug/rustdesk Authorization required, but no authorization protocol specified [2022-12-20T06:25:20Z INFO librustdesk::server] DISPLAY=Ok(":0") [2022-12-20T06:25:20Z INFO librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority") [2022-12-20T06:25:20Z INFO librustdesk::server] server not started (will try to start): Connection refused (os error 111) [2022-12-20T06:25:20Z INFO librustdesk::server] DISPLAY=Ok(":0") [2022-12-20T06:25:20Z INFO librustdesk::server] XAUTHORITY=Ok("/home/wrench/.Xauthority") (rustdesk:85340): Gtk-WARNING **: 23:25:20.341: cannot open display: :0 ```
deekerman 2026-02-20 23:19:49 -05:00
Author
Owner

@rustdesk commented on GitHub (Dec 20, 2022):

#763

@rustdesk commented on GitHub (Dec 20, 2022): #763
Author
Owner

@rustdesk commented on GitHub (Dec 20, 2022):

https://github.com/rustdesk/rustdesk/releases/download/nightly/rustdesk-1.2.0-aarch64-unknown-linux-gnu-ubuntu-18.04.deb
If you still have crash, please help debug and PR please, honestly we have no aarch64 dev env.

@rustdesk commented on GitHub (Dec 20, 2022): https://github.com/rustdesk/rustdesk/releases/download/nightly/rustdesk-1.2.0-aarch64-unknown-linux-gnu-ubuntu-18.04.deb If you still have crash, please help debug and PR please, honestly we have no aarch64 dev env.
Author
Owner

@emidoots commented on GitHub (Dec 20, 2022):

Thanks, I found the real answer here: https://github.com/rustdesk/rustdesk/issues/853#issuecomment-1358921587

@emidoots commented on GitHub (Dec 20, 2022): Thanks, I found the real answer here: https://github.com/rustdesk/rustdesk/issues/853#issuecomment-1358921587
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#1165
No description provided.