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

[1.14.4.2 regression] H5Lexists(): unable to synchronously check link existence #4472

Closed
jschueller opened this issue May 10, 2024 · 0 comments · Fixed by #4473
Closed

[1.14.4.2 regression] H5Lexists(): unable to synchronously check link existence #4472

jschueller opened this issue May 10, 2024 · 0 comments · Fixed by #4473
Assignees
Labels
Component - C++ C++ wrappers Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub

Comments

@jschueller
Copy link
Contributor

jschueller commented May 10, 2024

Describe the bug

since the 1.14.4.2 update the following code sample exits with error from the H5Lexists function:

#include <H5Cpp.h>
#include <iostream>

int main()
{
  H5::H5File h5File_;
  try
  {
    h5File_ = H5::H5File("/tmp/zou.h5", H5F_ACC_TRUNC);
  }
  catch (const H5::Exception &)
  {
    return 1;
  }
  const htri_t exist = H5Lexists(h5File_.getId(), "1", H5P_DEFAULT);
  std::cout << "H5Lexists="<<exist<<std::endl;
}

(ok with 1.14.3 and previous versions)

it returns the following output:

HDF5-DIAG: Error detected in HDF5 (1.14.4-2) thread 0:
  #000: H5L.c line 1207 in H5Lexists(): unable to synchronously check link existence
    major: Links
    minor: Can't get value
  #001: H5L.c line 1172 in H5L__exists_api_common(): can't set object access arguments
    major: Links
    minor: Can't set value
  #002: H5VLint.c line 2677 in H5VL_setup_name_args(): invalid location identifier
    major: Invalid arguments to routine
    minor: Inappropriate type
  #003: H5VLint.c line 1733 in H5VL_vol_object(): invalid identifier
    major: Invalid arguments to routine
    minor: Inappropriate type
H5Lexists=-1

Expected behavior
H5Lexists should return 0 (the file does not exist)

Platform (please complete the following information)

  • HDF5 version 1.14.4.2
  • OS: Archlinux
  • GCC 13.2.1
  • Autotools
  • --enable-cxx
  • no MPI library

Additional context

I noticed that its ok if I initialize the h5File_ variable in one line instead of using the default ctor then reassign it (in my real code h5File_ is an attribute of a class so I have to use some default ctor)

int main()
{
  H5::H5File h5File_ = H5::H5File("/tmp/zou.h5", H5F_ACC_TRUNC);

  const htri_t exist = H5Lexists(h5File_.getId(), "1", H5P_DEFAULT);
  std::cout << "H5Lexists="<<exist<<std::endl;
}

bisecting results in b69c6fc, (#3306), in particular the new Group::operator= /cc @seanm @bmribler @derobins

jschueller added a commit to jschueller/hdf5 that referenced this issue May 10, 2024
@brtnfld brtnfld added Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - C++ C++ wrappers Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub UNCONFIRMED New issues are unconfirmed until a maintainer can duplicate them labels May 10, 2024
@bmribler bmribler removed the UNCONFIRMED New issues are unconfirmed until a maintainer can duplicate them label May 10, 2024
@lrknox lrknox closed this as completed in ea76013 May 10, 2024
qkoziol pushed a commit to qkoziol/hdf5 that referenced this issue May 13, 2024
byrnHDF pushed a commit to byrnHDF/hdf5 that referenced this issue May 14, 2024
lrknox pushed a commit to lrknox/hdf5 that referenced this issue May 20, 2024
lrknox added a commit that referenced this issue May 23, 2024
* win32defs: Fix Wundef warning (#4467)

* Refactor error handling code to eliminate internal ID calls (#4453)

All calls to the H5I routines are now made in API routines (sometimes in
FUNC_ENTER/LEAVE_* macros), except for some calls to H5E_clear_stack() within
the library, but I'm planning to remove those over time.

Also, made all the library internal error messages into static const variables,
instead of malloc'ing them, which means that they can just be referenced
and not copied.

Several new and updated auto-generated header files were necessary to enable
this.

* CMake: Fix mingw/fortran build (#4466)

* Update for blosc2 in plugins and prefix hdf5 cmake varnames (#4468)

* Fix an issue where compound datatype member IDs can be leaked during conversion (#4459)

Also fixes issues with handling of partially initialized datatypes during library shutdown

* H5Group: Fix operator= (#4473)

Closes #4472

* Fix github issue #2523: doxygen -- fix grammatically incorrect sentence alias (#4474)

* Remove env step not used by CI in testing (#4476)

* Add H5fortkit dependecy for H5Rff.F90 (#4482)

* Properly clean up cache when failing to load an object header (#4477)

* Properly clean up cache when failing to load an object header

* Don't check message type a second time in H5G__open_oid if the first attempt returns error

* Add more asserts to H5O__assert() to avoid segfaults

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Add a missing image from the original document (#4490)

* Disable EOF checks for SWMR readers in more cases. (#4489)

Fixes a race condition where the reader opens the file and sets its EOF from the
file's size (from the stat() call in the driver open callback).  Then, before
the reader can read the file's superblock, a SWMR writer races in, extends the
file, and closes the file, writing an updated superblock with the 'writer' and
'SWMR writer' flags in the superblock off (appropriately).  Then the reader
proceeds to read the superblock, and flags the EOF as wrong.  Taking out the
check for the 'writer' and 'SWMR writer' flags will cause SWMR readers to avoid
flagging the file as incorrect.

* Remove unnecessary fortran install (#4498)

* Only one version of binaries is produced for platforms (#4496)

* Fix for github issue #2220. (#4497)

Document the limitation in the Passthrough Conncector section of the VOL Connector Author Guide.
The limitation is posted by Neil in the github issue on Dec 22, 2022.

* Release asset tarballs with no version filenames (#4494)

* Improve spec. reading superblock into cache (a little) by using v2 size (#4491)

* Improve spec. reading superblock into cache (a little) by using v2 size

Instead of reading the absolute minimal possible, use the likely value of
a v2+ superblock w/8-byte addresses & lengths.

* Fix for github Issue #1388 can't delete renamed dense attribute with corder tracking enabled (#4462)

* Fix for github issue #1388: can't delete renamed dense attribute with corder tracking enabled

The problem occurs in step 3(b) below which will delete the attribute with corder x
from the creation order index v2 B-tree.

The rename sequence in H5A__dense_rename() occurs in the following order:
1) The old attribute with corder x was removed from the creation order index v2 B-tree
2) The new renamed attribute was inserted via H5A__dense_insert():
(a) insert the attribute with new name j into the name index v2 B-tree
(b) insert the attribute with corder x into the creation order index v2 B-tree
3) The old attribute was removed via H5A__dense_remove():
(a) remove the attribute with old name k from the name index v2 B-tree
(b) remove the attribute with coorder x from the creation order index v2 B-tree

Fix: deactivate the "corder_bt2_addr" field so that H5A__dense_remove()
won't delete the attribute with corder x from the creation order index v2 B-tree.

* Fix/revert a libtool sed hack (#4501)

* Revert "Remove Autotools sed hack (#3848)"

This reverts commit 8b3ffde.

* Fix libtool sed cleanup on MacOS

Convert sed -i line to sed > libtool.bak && mv libtool.bak libtool
to avoid non-portable -i option.

* Update src/H5public.h

* Set H5 specific vars immediately if legacy find (#4512)

* Correct find process vars (vs in-line build)

* Correct SZIP find

* Everything is libaec 1.0.6 or newer

* Correct option help text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C++ C++ wrappers Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants