Skip to content

macOS 26.0 (Tahoe beta) で objc2 がカーネルパニックを起こす

rust で egui を使ったプロジェクトを実行時にカーネルパニックを起こしてしまい調べたところ、macOS側の互換切れが原因で obj2c で落ちてしまっていた様子。

参考

https://github.com/madsmtm/objc2/issues/765

発生したエラー

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 <code>{{EJS0}}</code> environment variable to display a backtrace

対応策

objc2 のデバッグアサーションを無効化する設定を Cargo.toml に追記する

[profile.dev.package.objc2]
debug-assertions = false

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です