FYI.
Quoting the readme:
So, as far as I am concerned, it is not thread safe. Hence, all pointers are internally tracked with Rcs.
Sadly, that's not enough and I'm not sure what's the best course of action for notmuch-rs (introducing locking in all functions seems a bit overkill) but I've asked on the mailing list (with an example fix) if Notmuch is supposed to be thread safe.
Here is a repro:
#[cfg(test)]
mod tests {
fn setup() {
let directory = tempfile::tempdir().unwrap();
let database = notmuch::Database::create(directory.path()).unwrap();
}
#[test]
fn thread1() {
setup()
}
#[test]
fn thread2() {
setup()
}
}
while cargo test; do :; done
Resulting in:
running 2 tests
error: test failed, to rerun pass `--bin repro`
Caused by:
process didn't exit successfully: `.../repro/target/debug/deps/repro-fe1206eee7835a6c` (signal: 11, SIGSEGV: invalid memory reference)
FYI.
Quoting the readme:
Sadly, that's not enough and I'm not sure what's the best course of action for notmuch-rs (introducing locking in all functions seems a bit overkill) but I've asked on the mailing list (with an example fix) if Notmuch is supposed to be thread safe.
Here is a repro:
Resulting in: