Skip to content
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

h5_is_library_threadsafe() gives unreliable results due to unspecified initial value #1137

Closed
david-macmahon opened this issue Jan 19, 2024 · 1 comment · Fixed by #1138
Closed

Comments

@david-macmahon
Copy link
Contributor

HDF5.API.h5_is_library_threadsafe() has an unspecified initial value in src/api/helpers.jl:

function h5_is_library_threadsafe()
    is_ts = Ref{Cuint}()
    h5_is_library_threadsafe(is_ts)
    return is_ts[] > 0
end

and H5is_library_threadsafe only updates the low 8 bits:

julia> is_ts=Ref{Cuint}(-1 % Cuint)
Base.RefValue{UInt32}(0xffffffff)

julia> ccall((:H5is_library_threadsafe, HDF5.API.libhdf5), HDF5.API.herr_t, (Ref{Cuint},), is_ts);

julia> is_ts[]
0xffffff00
@simonbyrne
Copy link
Collaborator

Would you mind opening a pull request?

david-macmahon added a commit to david-macmahon/HDF5.jl that referenced this issue Jan 19, 2024
mkitti added a commit that referenced this issue Mar 26, 2024
* Update helpers.jl with initial value for Ref{Cuint}

Fixes #1137

* Switch to using Cuchar

---------

Co-authored-by: Mark Kittisopikul <markkitt@gmail.com>
Co-authored-by: Mark Kittisopikul <kittisopikulm@janelia.hhmi.org>
mkitti added a commit that referenced this issue Apr 5, 2024
* Update helpers.jl with initial value for Ref{Cuint}

Fixes #1137

* Switch to using Cuchar

---------

Co-authored-by: Mark Kittisopikul <markkitt@gmail.com>
Co-authored-by: Mark Kittisopikul <kittisopikulm@janelia.hhmi.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants