Skip to content

Prevent hdf5 calling atexit() #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
are now generic over size only: `FixedAscii<N>` and `FixedUnicode<N>`.
- The version of `hdf5` built in `hdf5-src` has been updated from `1.10.6` to `1.10.7`.
- The `zlib` dependency is no longer included with `default-features`.
- `hdf5` no longer calls `H5close` automatically on program exit.

## 0.7.1

Expand Down
7 changes: 6 additions & 1 deletion src/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ use crate::internal_prelude::*;

lazy_static! {
static ref LIBRARY_INIT: () = {
h5lock!(::hdf5_sys::h5::H5open());
h5lock!({
// Ensure hdf5 does not invalidate handles which might
// still be live on other threads on program exit
::hdf5_sys::h5::H5dont_atexit();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment re: why this is here?

::hdf5_sys::h5::H5open();
});
let _e = crate::hl::filters::register_filters();
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/hl/plist/dataset_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ impl DatasetCreate {
h5try!(H5Pget_fill_value(self.id(), dtype.id(), buf.as_mut_ptr().cast()));
Ok(Some(unsafe { OwnedDynValue::from_raw(tp.clone(), buf) }))
}
_ => Ok(None),
FillValue::Undefined => Ok(None),
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/hl/plist/file_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@ impl FileCreateBuilder {
FileSpaceStrategy::PageAggregation => {
(H5F_fspace_strategy_t::H5F_FSPACE_STRATEGY_AGGR, 0, 0)
}
_ => (H5F_fspace_strategy_t::H5F_FSPACE_STRATEGY_NONE, 0, 0),
FileSpaceStrategy::None => {
(H5F_fspace_strategy_t::H5F_FSPACE_STRATEGY_NONE, 0, 0)
}
};
h5try!(H5Pset_file_space_strategy(id, strategy, persist, threshold));
}
Expand Down
2 changes: 1 addition & 1 deletion src/hl/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ where
Dout: ndarray::Dimension,
{
fn from(slice: ndarray::SliceInfo<T, Din, Dout>) -> Self {
slice.deref().as_ref().iter().cloned().map(Into::into).collect::<Vec<_>>().into()
slice.deref().as_ref().iter().copied().map(Into::into).collect::<Vec<_>>().into()
}
}

Expand Down