If I run this code:
fn main() {
    let sdl2 = sdl2::init().unwrap();
    let gcs = sdl2.game_controller().unwrap();
    let gamepad = gcs.open(0).unwrap();
    drop(gamepad); // <--------
    let gamepad = gcs.open(0).unwrap();
    drop(gamepad);
    drop(gcs);
    drop(sdl2);
}If I remove marked line (drop for the first instance of 0th gamepad), then Segmentation fault doesn't happen.
To be completely honest, I have no idea how that prevents the segfault.
Cargo.toml:
sdl2 = { version = "0.38.0", features = ["bundled", "hidapi", "static-link"] }OS: Windows 10
shell: Git Bash