rustdesk-server icon indicating copy to clipboard operation
rustdesk-server copied to clipboard

RustDesk Server 1.1.13 (Docker) hbbs code 132 crashes

Open Hackerpcs opened this issue 10 months ago • 17 comments
trafficstars

Describe the bug After upgrading to latest 1.1.13 server version from docker hub, I get code 132 crashes on hbbs. Reverting to 1.1.12 works around the issue

Describe the environment docker-compose.yaml: (10.x IP is placeholder)

networks:
  rustdesk-net:
    external: false

services:
  hbbs:
    container_name: hbbs
    ports:
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21118:21118
    #image: rustdesk/rustdesk-server:1.1.12
    image: rustdesk/rustdesk-server:latest
    command: hbbs -r 10.10.10.10:21117 -k _
    volumes:
      - ./hbbs:/root
    environment:
      LIMIT_SPEED: 400
      SINGLE_BANDWIDTH: 400
    networks:
      - rustdesk-net
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: hbbr
    ports:
      - 21117:21117
      - 21119:21119
    image: rustdesk/rustdesk-server:latest
    command: hbbr -k _
    volumes:
      - ./hbbr:/root
    environment:
      LIMIT_SPEED: 400
      HBBR_SINGLE_BANDWIDTH: 400
      SINGLE_BANDWIDTH: 400
    networks:
      - rustdesk-net
    restart: unless-stopped

Docker logs:

# docker compose -f /foo/docker-compose.yml logs -f

hbbs  | [2025-01-21 05:18:09.747825 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:09.750575 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:09.750602 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:09.752680 +00:00] INFO [libs/hbb_common/src/config.rs:902] Generated new keypair for id:
hbbs  | [2025-01-21 05:18:11.482726 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:11.483096 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:11.483121 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:13.731550 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:13.731683 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:13.731706 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:13.745909 +00:00] INFO [src/rendezvous_server.rs:99] serial=0
hbbs  | [2025-01-21 05:18:13.747344 +00:00] INFO [src/common.rs:45] rendezvous-servers=[]
hbbs  | [2025-01-21 05:18:13.747374 +00:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
hbbs  | [2025-01-21 05:18:13.747387 +00:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
hbbs  | [2025-01-21 05:18:13.747401 +00:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
hbbs  | [2025-01-21 05:18:15.922223 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbr  | [2025-01-21 05:18:08.916217 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbr  | [2025-01-21 05:18:08.916376 +00:00] INFO [src/relay_server.rs:582] Key: foobarbaz
hbbr  | [2025-01-21 05:18:08.916474 +00:00] INFO [src/relay_server.rs:61] #blacklist(blacklist.txt): 0
hbbr  | [2025-01-21 05:18:08.917262 +00:00] INFO [src/relay_server.rs:76] #blocklist(blocklist.txt): 0
hbbs  | [2025-01-21 05:18:15.922318 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:15.922338 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:15.933178 +00:00] INFO [src/rendezvous_server.rs:99] serial=0
hbbs  | [2025-01-21 05:18:15.933403 +00:00] INFO [src/common.rs:45] rendezvous-servers=[]
hbbs  | [2025-01-21 05:18:15.933427 +00:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
hbbs  | [2025-01-21 05:18:15.933441 +00:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
hbbs  | [2025-01-21 05:18:15.933531 +00:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
hbbs  | [2025-01-21 05:18:15.934058 +00:00] INFO [src/rendezvous_server.rs:138] mask: None
hbbs  | [2025-01-21 05:18:15.934080 +00:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
hbbs  | [2025-01-21 05:18:15.934110 +00:00] INFO [src/common.rs:45] relay-servers=["10.10.10.10:21117"]
hbbs  | [2025-01-21 05:18:15.934459 +00:00] INFO [src/rendezvous_server.rs:153] ALWAYS_USE_RELAY=N
hbbs  | [2025-01-21 05:18:15.935281 +00:00] INFO [src/rendezvous_server.rs:185] Start
hbbs  | [2025-01-21 05:18:18.289506 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:18.289565 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:18.289578 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:21.250938 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:21.252362 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:21.252384 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:25.849228 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:25.851058 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:25.851514 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:33.873632 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:33.878016 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:33.878058 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:48.540860 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:18:48.541550 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:18:48.541595 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:18:48.553165 +00:00] INFO [src/rendezvous_server.rs:99] serial=0
hbbs  | [2025-01-21 05:18:48.553221 +00:00] INFO [src/common.rs:45] rendezvous-servers=[]
hbbs  | [2025-01-21 05:18:48.553235 +00:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
hbbs  | [2025-01-21 05:18:48.553247 +00:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
hbbs  | [2025-01-21 05:18:48.553360 +00:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
hbbs  | [2025-01-21 05:19:16.046909 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:19:16.046966 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:19:16.046980 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs  | [2025-01-21 05:19:16.053284 +00:00] INFO [src/rendezvous_server.rs:99] serial=0
hbbs  | [2025-01-21 05:19:16.053841 +00:00] INFO [src/common.rs:45] rendezvous-servers=[]
hbbs  | [2025-01-21 05:19:16.053854 +00:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
hbbs  | [2025-01-21 05:19:16.053859 +00:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
hbbs  | [2025-01-21 05:19:16.053865 +00:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
hbbs  | [2025-01-21 05:19:16.054653 +00:00] INFO [src/rendezvous_server.rs:138] mask: None
hbbs  | [2025-01-21 05:19:16.054844 +00:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
hbbs  | [2025-01-21 05:20:08.965675 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:20:08.966504 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:20:08.966547 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbr  | [2025-01-21 05:18:08.917364 +00:00] INFO [src/relay_server.rs:82] Listening on tcp :21117
hbbr  | [2025-01-21 05:18:08.917376 +00:00] INFO [src/relay_server.rs:84] Listening on websocket :21119
hbbr  | [2025-01-21 05:18:08.917561 +00:00] INFO [src/relay_server.rs:87] Start
hbbr  | [2025-01-21 05:18:08.918563 +00:00] INFO [src/relay_server.rs:105] DOWNGRADE_THRESHOLD: 0.66
hbbr  | [2025-01-21 05:18:08.918592 +00:00] INFO [src/relay_server.rs:115] DOWNGRADE_START_CHECK: 1800s
hbbr  | [2025-01-21 05:18:08.918607 +00:00] INFO [src/relay_server.rs:125] LIMIT_SPEED: 400Mb/s
hbbr  | [2025-01-21 05:18:08.918620 +00:00] INFO [src/relay_server.rs:136] TOTAL_BANDWIDTH: 1024Mb/s
hbbr  | [2025-01-21 05:18:08.918633 +00:00] INFO [src/relay_server.rs:146] SINGLE_BANDWIDTH: 400Mb/s
hbbs exited with code 132
hbbs  | [2025-01-21 05:22:12.608414 +00:00] INFO [src/rendezvous_server.rs:99] serial=0
hbbs  | [2025-01-21 05:22:12.608786 +00:00] INFO [src/common.rs:45] rendezvous-servers=[]
hbbs  | [2025-01-21 05:22:12.608802 +00:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
hbbs  | [2025-01-21 05:22:12.608814 +00:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
hbbs  | [2025-01-21 05:22:12.608974 +00:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
hbbs  | [2025-01-21 05:22:12.609351 +00:00] INFO [src/rendezvous_server.rs:138] mask: None
hbbs  | [2025-01-21 05:22:12.609460 +00:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
hbbs  | [2025-01-21 05:22:12.609829 +00:00] INFO [src/common.rs:45] relay-servers=["10.10.10.10:21117"]
hbbs  | [2025-01-21 05:22:12.610981 +00:00] INFO [src/rendezvous_server.rs:153] ALWAYS_USE_RELAY=N
hbbs  | [2025-01-21 05:22:12.611887 +00:00] INFO [src/rendezvous_server.rs:185] Start
hbbs exited with code 132
hbbs  | [2025-01-21 05:23:14.504878 +00:00] INFO [src/common.rs:121] Private key comes from id_ed25519
hbbs  | [2025-01-21 05:23:14.504930 +00:00] INFO [src/rendezvous_server.rs:1205] Key: foobarbaz
hbbs  | [2025-01-21 05:23:14.504940 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
hbbs exited with code 132
hbbs exited with code 132
hbbs exited with code 132

Arch Linux host OS on the VPS

Hackerpcs avatar Jan 21 '25 05:01 Hackerpcs

Can't reproduce with arch linux, same docker-compose.yaml, could you provide more informations on your environment?

Will it crash if running https://github.com/21pages/rustdesk-server/releases/download/test/hbbs on your host?

21pages avatar Jan 21 '25 11:01 21pages

Could you help to debug this problem?

  1. Stop the original container, cd path/to/docker-compose.yaml, docker-compose down
  2. Copy your original directory, cp -r rustdesk-server rustdesk-server-debug
  3. cd rustdesk-server-debug, change rustdesk/rustdesk-server to 21pages/rustdesk-server in the docker-compose.yaml
  4. docker-compose up -d
  5. Show the log, docker-compose logs -f hbbs

21pages avatar Jan 22 '25 03:01 21pages

Remove all envs for your hbbs, they are not doing anything for hbbs, though I think it is not the problem

Also try remove all args for hbbs, like command: hbbs

xlionjuan avatar Jan 28 '25 16:01 xlionjuan

Might be related: https://github.com/aptos-labs/aptos-core/issues/1019

After some search, I found multiple results mentioned "CPU Instruction"

What is the result when running this?

sudo cat /proc/cpuinfo | grep avx

xlionjuan avatar Jan 28 '25 17:01 xlionjuan

I have same issue because I'm trying to run it on VPS. Your command @xlionjuan returns nothing, so probably it's not possible to run it on this machine.

dimmuboy avatar Feb 27 '25 20:02 dimmuboy

@dimmuboy What is the output of the

sudo cat /proc/cpuinfo

xlionjuan avatar Feb 27 '25 20:02 xlionjuan

@dimmuboy What is the output of the

sudo cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version 1.5.3
stepping        : 3
microcode       : 0x1
cpu MHz         : 1695.747
cache size      : 4096 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl cpuid tsc_known_freq pni cx16 hypervisor lahf_lm pti
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown bhi
bogomips        : 3391.49
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

dimmuboy avatar Mar 02 '25 20:03 dimmuboy

A VPS without AVX support is crazy, I guess some code or dependencies in hbbs utilizes AVX.

xlionjuan avatar Mar 03 '25 02:03 xlionjuan

Mine doesn't have it too. 1.1.12 continues to work normally

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 6
model name      : QEMU Virtual CPU version 2.1.2
stepping        : 3
microcode       : 0x1000065
cpu MHz         : 2099.998
cache size      : 512 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl cpuid tsc_known_freq pni cx16 x2apic popcnt hypervisor lahf_lm svm abm sse4a 3dnowprefetch vmmcall
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 4199.99
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 6
model name      : QEMU Virtual CPU version 2.1.2
stepping        : 3
microcode       : 0x1000065
cpu MHz         : 2099.998
cache size      : 512 KB
physical id     : 1
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl cpuid tsc_known_freq pni cx16 x2apic popcnt hypervisor lahf_lm svm abm sse4a 3dnowprefetch vmmcall
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 4199.99
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

Hackerpcs avatar Mar 03 '25 03:03 Hackerpcs

Recommend to ask VPS provider

xlionjuan avatar Mar 03 '25 07:03 xlionjuan

Recommend to ask VPS provider

Thanks, I decided to migrate to different provider. Contabo looks good fine for me 🙂

dimmuboy avatar Mar 04 '25 16:03 dimmuboy

Sorry to +1, but me too.

Noticing that we all have QEMU Virtual CPU. Seems that QEMU guests do not include AVX extension by default. So, this would affect a lot of users who are with VPS providers using this same virtualisation technology.

I think it would be nice if rustdesk server does not solely rely on AVX :)

In the meantime I've just asked my own VPS provider about AVX support, will see...

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version 1.5.3
stepping        : 3
microcode       : 0x1000065
cpu MHz         : 3493.436
cache size      : 512 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl cpuid tsc_known_freq pni cx16 hypervisor lahf_lm svm abm sse4a 3dnowprefetch vmmcall
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 6986.87
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management:

...

navhaxs avatar Mar 24 '25 06:03 navhaxs

My VPS provider support was very quick and were able to enable AVX on my instance 👍🏼. I recommend anyone seeing this issue to try contact their VPS provider.

navhaxs avatar Mar 24 '25 06:03 navhaxs

@navhaxs This is not QEMU's problem, it is all on the provider, without AVX support is not acceptable no matter what.

xlionjuan avatar Mar 24 '25 06:03 xlionjuan

@xlionjuan Yeah it is unfortunate. I just mean that you should expect to see many more people also run into this crash due to their VPS provider 🙁

The default QEMU guest CPU config does NOT have AVX https://superuser.com/questions/453786/how-do-i-get-avx-support-in-qemu. I just tested a simple VM on my other Proxmox server, which is also QEMU-based, and can confirm this.

Maybe a error message can be added, like how MongoDB does it? That would help future users :) https://reddit.com/r/homelab/comments/yvo4jm/how_do_i_enable_avx_on_my_server/

navhaxs avatar Mar 25 '25 10:03 navhaxs

Question is, is there a feature that was added in 1.1.13 and above that doesn't work without AVX and is now required? From the releases I see on 1.1.13 just "Version check and refactor hbb_common to share with rustdesk client" and on 1.1.14 "Fix windows crash"

Hackerpcs avatar Mar 25 '25 10:03 Hackerpcs

I'm guessing it is related to Rust lang itself, but I can't sure.

xlionjuan avatar Mar 25 '25 10:03 xlionjuan

user 1.1.12 it's ok

gitcook avatar Jun 06 '25 09:06 gitcook