rust で egui を使ったプロジェクトを実行時にカーネルパニックを起こしてしまい調べたところ、macOS側の互換切れが原因で obj2c で落ちてしまっていた様子。
参考
https://github.com/madsmtm/objc2/issues/765
発生したエラー
1 2 3 4 |
thread 'main' panicked at /Users/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/objc2-foundation-0.2.2/src/generated/NSEnumerator.rs:7:1: invalid message send to -[_TtGCs23_ContiguousArrayStorageCSo8NSScreen_$ countByEnumeratingWithState:objects:count:]: expected return to have type code 'q', but found 'Q' note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
対応策
objc2 のデバッグアサーションを無効化する設定を Cargo.toml に追記する
1 2 3 |
[profile.dev.package.objc2] debug-assertions = false |