DioxusLabs / DioxusLabs/dioxus

Segfault when running multiple `dx serve --hot-patch` instances

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

Description

**Problem**

Specifically the app being run segfaults, not dx itself, in case that wasn't clear from the title. I think I've only seen one of the two instances running crash, though I have no reason to believe that is reliable.

I'm not sure this really counts as a bug. Loading dynamic libraries while they are being modified resulting in a crash is... not surprising. But I was asked to report this here (https://github.com/TheBevyFlock/bevy_simple_subsecond_system/issues/24#issuecomment-2926160764), so here it is.

**Steps To Reproduce**

I specifically observed this accidentally using two copies of `dx serve --hot-patch --example editor` on [this commit](https://github.com/gmorenz/bevy_anvil/commit/6d0450a1960a1716ef7b0be60f610849032a5805), and editing the color values on line 57 - I have no reason to believe that there's anything special about said repo or line though. I sometimes have to edit the value twice before it crashes (presumably there is a race going on).

**Expected behavior**

No segfault I guess? Potentially locks would be used to avoid two instances running at the same time similar to how cargo locks the build directory.

**Environment:**

```
$ dx --version
dioxus 0.7.0-alpha.0 (c8684a3)
$ rustc --version
rustc 1.88.0-nightly (10fa3c449 2025-04-26)
$ clang --version
clang version 19.1.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ pacman -Q lld
lld 19.1.7-1
```

Bevy simple subsecond system revision https://github.com/TheBevyFlock/bevy_simple_subsecond_system/commit/7787bcd13d6ba649e4e6ae49660579e950d35f6d

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.