aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 85 forks source link

Prevent hdf5 calling atexit() #160

Closed mulimoen closed 3 years ago

mulimoen commented 3 years ago

hdf5 calling atexit could create double free situations, where an orphaned thread would try to access a handle after it's been freed by the main thread.

The functioncality disabled by this involves flushing data, closing objects, and cleaning up memory used. This is provided by Drop by rust, and pure rust programs will not be affected by this change.

In multi-language applications, care must be taken that all handles are closed by the programmer before program exit.

Fixes #159

aldanor commented 3 years ago

Looks good, thanks! Maybe a quick note in the changelog?

mulimoen commented 3 years ago

Thanks @aldanor, I've added an entry to the changelog and a comment on the initialisation.

mulimoen commented 3 years ago

Failure in CI/wine is unrelated to the current PR