rust-rocksdb / rust-rocksdb

rust wrapper for rocksdb
Apache License 2.0
1.88k stars 737 forks source link

STATUS_ACCESS_VIOLATION error when compiled with GNU toolchain on Windows 10 #665

Open q2p opened 2 years ago

q2p commented 2 years ago

Toolchain: stable-x86_64-pc-windows-gnu Rust version: 1.62.1 Cargo.toml

[package]
name = "a"
version = "0.0.1"
edition = "2021"
publish = false

[dependencies]
rocksdb = { version = "0.18.0", default-features = false }

main.rs

fn main() {
  let opts = rocksdb::Options::default();
}

Error message:

> cargo run --release
warning: unused variable: `opts`
 --> src\main.rs:4:7
  |
4 |   let opts = rocksdb::Options::default();
  |       ^^^^ help: if this is intentional, prefix it with an underscore: `_opts`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: `a` (bin "a") generated 1 warning
    Finished release [optimized] target(s) in 5.79s
     Running `target\release\a.exe`
error: process didn't exit successfully: `target\release\a.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
joley-gh commented 1 year ago

This is still a problem, which is quite annoying. I tryed to build RocksDB with Mingw64 and used the env variables provided in #310. This worked but i got millions of linking errors regarding missing references to stdc++ functions.

I would be happy if the default vendor version of rocksdb would at least be compatible with the gnu toolchain. It seems that the default vendor of rocksdb_sys is only compatible with the msvc toolchain. Also there seems to be a pullrequest regarding the support of the gnu toolchain #472, which doesen't get merged since 2020. Wouldn't that fix the issue?

Maybe someone can help, for now the beste solution semms to be switching to the msvc toolchain

notdanilo commented 3 months ago

I am getting the same error with

1.71.1-x86_64-pc-windows-msvc (overridden by 'D:\dev\3rd\rust-rocksdb\rust-toolchain.toml')
rustc 1.71.1 (eb26296b5 2023-08-03)