clang-rs icon indicating copy to clipboard operation
clang-rs copied to clipboard

Segfault when using with clang-19 on Windows with "runtime" feature enabled

Open twistedfall opened this issue 9 months ago • 1 comments

Hi, as reported here https://github.com/twistedfall/opencv-rust/issues/628 there is currently problem when trying to use the clang crate on Windows in combination with runtime feature enabled and clang-19. The following trivial program segfaults:

// main.rs
fn main() {
   let _ =  clang::Clang::new();
}
# Cargo.toml
[package]
name = "ttt"
version = "0.1.0"
edition = "2021"

[dependencies]
clang = { version = "2.0.0", features = ["runtime"] }

Running it with cargo run produces:

$ cargo run
   Compiling ttt v0.1.0 (C:\Users\win\ttt)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.52s
     Running `target\debug\ttt.exe`
error: process didn't exit successfully: `target\debug\ttt.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
Segmentation fault

twistedfall avatar Jan 12 '25 15:01 twistedfall