slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.54k stars 600 forks source link

App crash on macOs with skia renderer #6146

Open windoze opened 1 month ago

windoze commented 1 month ago

OS: macOs Sonoma 14.6.1 Machine: Mac Studio M1 Ultra

Reproduce steps:

  1. Create an simple project with cargo generate --git https://github.com/slint-ui/slint-rust-template --name test-prj.
  2. Change slint features in Cargo.toml to slint = { version = "1.7.2", default-features = false, features = ["std", "backend-winit", "renderer-skia", "compat-1-2"] }
  3. Run app with cargo run or cargo run --release.

The app crash with no error message, only output:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/slint-rust-template`
zsh: segmentation fault  cargo run

I haven't digged into the issue, not sure if it's because Slint or Skia.

tronical commented 1 month ago

Could you try running lldb target/debug/slint-rust-template, then type r at the prompt, hit enter, and then paste the output you get there?

windoze commented 1 month ago

Sure.

[🕙 16:58:53]❯ lldb ./target/debug/slint-rust-template
(lldb) target create "./target/debug/slint-rust-template"
Current executable set to '/Users/chenxu/repos/test1/target/debug/slint-rust-template' (arm64).
(lldb) r
Process 34906 launched: '/Users/chenxu/repos/test1/target/debug/slint-rust-template' (arm64)
Process 34906 stopped
* thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0

Seems like null pointer was used at somewhere.

tronical commented 1 month ago

Thanks. Could you run bt on the same prompt after it crashed?

windoze commented 1 month ago

It shows basically nothing.

(lldb) bt
* thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000000000000