emilk / emilk/egui

Segmentation fault on WSL 2

Open
#3,208 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

Hi there!

I'm currently learning egui to make a comic reader application, and have a bit of trouble making it work.

I'm using WSL 2 on Windows 11. On my first PC, everything works fine, but on my second I get a segmentation fault. Here is the minimal reproduction example I've gotten to:

```rust
use eframe::{App, NativeOptions};

fn main() -> eframe::Result<()> {
eframe::run_native(
"reader",
NativeOptions::default(),
Box::new(|_| Box::new(MyApp)),
)
}

struct MyApp;

impl App for MyApp {
fn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {});
}
}
```

The `update` function runs and the inner closure too, but I get a segmentation fault afterwards. I don't get to see any window displayed before the crash.

I'm currently using the latest version of `egui` and `eframe`, here is my `Cargo.toml`:

```toml
[package]
name = "reader"
version = "0.1.0"
edition = "2021"

[dependencies]
eframe = { version = "0.22.0", default-features = false, features = ["glow"] }
egui = "0.22.0"
```

Any idea of what's causing this?

**EDIT:** I'm using Ubuntu 23.04 (lunar), stock kernel, WSL 2 v1.2.5.0, with WSLg v1.0.51, Windows v10.0.22621.1992

Contributor guide

Open the contributing guide

Research direction

The issue provides a minimal Rust reproduction and Cargo.toml rather than a repository file or test. Start by running the example with eframe 0.22.0 and the reported WSL 2, Ubuntu, and WSLg versions, then trace the native startup after the update closure runs. Done means identifying the platform-specific crash cause and confirming the example starts without a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.