DioxusLabs / DioxusLabs/dioxus

Subsecond crashes if target-cpu=native

Open
#4,962 0 comments 1 reaction 0 assignees View on GitHub
bug subsecond
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

If project contains `rustflags = ["-Ctarget-cpu=native"]`

Subsecond hot reloading crashes with

```
19:26:39 [linux] thread '' (302193) panicked at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-devtools-0.7.1/src/lib.rs:81:64:
19:26:39 [linux] called `Result::unwrap()` on an `Err` value: Dlopen(".../dx/game/debug/linux/app/libgame-patch-1763054780412.so: undefined symbol: _ZN4core9core_arch3x863aes16_mm_aesdec_si12817h945d372cf5cd5992E__inline_asm_5q3fvvsjzx9aaekuvmw5tx9n6_n0")
19:26:39 [linux] stack backtrace:
19:26:42 [linux] 0: __rustc::rust_begin_unwind
19:26:42 [linux] at /rustc/29a69716f2c0f19b5f9163bb4d8c50fb818cf326/library/std/src/panicking.rs:690:5
19:26:42 [linux] 1: core::panicking::panic_fmt
19:26:42 [linux] at /rustc/29a69716f2c0f19b5f9163bb4d8c50fb818cf326/library/core/src/panicking.rs:80:14
19:26:42 [linux] 2: core::result::unwrap_failed
19:26:42 [linux] at /rustc/29a69716f2c0f19b5f9163bb4d8c50fb818cf326/library/core/src/result.rs:1867:5
19:26:42 [linux] 3: unwrap<(), subsecond::PatchError>
19:26:42 [linux] at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1233:23
19:26:42 [linux] 4: {closure#0}
19:26:42 [linux] at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-devtools-0.7.1/src/lib.rs:81:64
19:26:42 [linux] 5: {closure#0}
19:26:42 [linux] at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-devtools-0.7.1/src/lib.rs:106:21
19:26:42 [linux] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```

Missing symbol name `_ZN4core9core_arch3x863aes16_mm_aesdec_si12817h945d372cf5cd5992E__inline_asm_5q3fvvsjzx9aaekuvmw5tx9n6_n0` made me think that it is due to modern cpu instructions.

If I add `RUSTFLAGS="-Ctarget-cpu=x86-64"` problem is fixed.

**Steps To Reproduce**

Steps to reproduce the behavior:

- Add rustflags to Cargo.toml
- Try to hot reload code with subsecond. Probably project needs code that uses given symbol.

**Environment:**

- Dioxus version: 0.7.1
- Bevy version: 0.17 with patched dioxus version
- Rust version: nightly
- OS info: Ubuntu 24.04
- App platform: desktop

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.