Commit Graph

4139 Commits

Author SHA1 Message Date
jhendersonHDF
0849a03c7b Minor refactoring of testframe.c testing framework (#4930)
Added setup and cleanup callback parameters to TestInit() to perform
setup and cleanup tasks once for whole test program

Removed TestCleanup() function since its functionality is covered by
PerformTests()

Added check of the HDF5_NOCLEANUP environment variable in
GetTestCleanup()
2024-10-11 07:41:31 -05:00
Quincey Koziol
6280fd3219 Remove H5E_clear_stack() from H5SM code (#4861)
Introduces 'try' flag for H5B2_modify() call
2024-10-11 07:41:31 -05:00
Larry Knox
f813d1e5ce
Sync 2 develop changes October 2 to hdf5_1_16 (#4946)
* Correct publish path

* Update clang-format to 17 (#4931)

Also bump the clang-format GitHub actions to 17

* Committing clang-format changes
2024-10-10 13:45:57 -05:00
jhendersonHDF
34d6ef545a
Refactor h5test.c, testframe.c and testpar.h testing frameworks (#4891)
Added new testframe.h header to document testing framework functions and
split them away from h5test.h and from test programs that don't
integrate with the testframe.c testing framework

Added new test setup callback to testframe.c testing framework

Added parameters to AddTest() to specify size of test parameters so they
can be copied for later use

Enabled HDF5 error stacks in testframe.c framework by default and added
some error stack suppressions to some testhdf5 tests

Added new maxthreads option to testframe.c framework to allow specifying
the maximum number of threads a multi-threaded test can use

Moved TestExpress functionality out of testframe.c and into more general
h5test.c for wider use by tests through getter and setter

Updated some tests to not mix and match functionality between h5test.c/h
and testframe.c/h

Moved some functionality from testphdf5.h into testpar.h for parallel
tests that aren't part of testphdf5

Added new parallel test library that contains common shared
functionality for parallel tests (similar to h5test library)
2024-10-01 16:10:03 -05:00
Matt L
e2da35371b
Clean up thread-local error stacks in all threads (#4852)
* Clean up error stacks from secondary threads
2024-10-01 08:53:53 -07:00
bmribler
c2baceab9a
Fixed a memory leak from H5FL_blk_malloc (#4882)
In H5F__accum_reset(), when H5F__accum_flush() failed, the freeing of
f_sh->accum.buf was never reached, causing resource leak.

@fortnern added the third argument to H5F__accum_reset() so we can free
f_sh->accum.buf when we close the file, that is, when H5F__accum_reset()
is called from the H5F__dest() route, and can leave the accumulator in place
otherwise.
2024-09-26 16:05:50 -05:00
mattjala
39fdf5d075
Fix missing routine on MacOS ttsafe test (#4863) 2024-09-23 05:36:54 -05:00
Quincey Koziol
52d42fdb93
Reduce test iterations, etc. to keep time down on sower systems (#4853)
Signed-off-by: Quincey Koziol <quincey@koziol.cc>
2024-09-19 01:46:29 -07:00
mattjala
d1cfe5295b
Fix memory leaks in ttsafe tests (#4842) 2024-09-18 10:35:45 -05:00
Larry Knox
901a8db2a2
Fix copyright notice urls in new test/ttsafe* files. (#4824)
* Update obsolete COPYING file URLs in copyright headers.
2024-09-12 15:23:31 -05:00
Dana Robinson
66cfc803ff
Add mirror VFD to serial -Werror CI action (#4753)
* Add mirror VFD to serial -Werror CI action

* NUL terminate mirror_vfd.c strings
2024-09-07 16:27:44 -07:00
Quincey Koziol
92532bbec8
Rename and add more locking infrastructure (#4729)
Rename existing recursive R/W locks from H5TS_rw_lock_t to H5TS_rec_rwlock_t, so it's more obvious that they are recursive.

Add non-recursive R/W lock, H5TS_rwlock_t

Add spinlock, H5TS_spinlock_t

Add an atomic void pointer, H5TS_atomic_voidp_t
2024-09-07 10:38:46 -07:00
bmribler
a75542b3e7
Detect invalid ID to H5Gmove2 (#4765)
User's application segfaulted because the returned value H5I_BADID wasn't
detected when H5I_get_type() was called.  This PR adds checks for invalid
file/group identifiers passed into H5Gmove2.

This defect occurs in many other places, hence, issue GH-4764.

Fixes #4737
2024-09-06 08:50:10 -07:00
Quincey Koziol
e66ec4f5ee
Resolve race around single counter by using two counters (#4792) 2024-08-30 14:11:01 -05:00
H. Joe Lee
90b07416a6
Remove dummy comments that repeat function names. (#4775) 2024-08-27 09:06:40 -07:00
mattjala
ff14dee3e9
Remove early test exit (#4757)
* Don't skip file tests

* Remove test with invalid flag for H5Fopen

* Verify that create/open of unseekable file fails

* Remove failure verification
2024-08-26 13:29:13 -05:00
bmribler
d0fe57624f
Replace non-VOL calls with VOL calls - part 3 (#4756)
This PR switches H5I_object_verify() to H5VL_vol_object_verify() in the H5G API
and removes unnecessary casts.
2024-08-26 09:04:18 -07:00
Quincey Koziol
c38064b7f7
Another try at correcting the ping pong semaphore test (#4754)
* Add ifdef around prototype

* Add casts to make MSVC happy

* Fix missing atomic load
2024-08-24 21:39:56 -05:00
Dana Robinson
5c5b727127
Restore rand_r in a few parallel tests (#4749)
The t_pmulti_dset and t_select_io_dset tests rely on the behavior
of the previous private rand_r-like implementation to get the
correct sequence of random numbers to pass. This has been restored
using a fully private rand_r-like implementation that doesn't
rely on rand_r and will work on Windows and other platforms
where rand_r doesn't exist.
2024-08-23 17:22:40 -05:00
bmribler
9adacb54a6
Replace non-VOL calls with VOL calls - part 2 (#4748)
This PR switches H5I_object_verify() to H5VL_vol_object_verify() in the H5F API
and fixes documentation of H5Fmount and H5Funmount.

* More on H5F API
2024-08-23 11:44:48 -05:00
bmribler
379a5baa0f
Fix inconsistent documentation of get_name functions (#4715)
- Verified that the listed functions do not include null terminator in the returned length
- Improved some of the tests
- Corrected documentation

Fixes GH-4704

* Casted a positive int to size_t
2024-08-23 11:17:35 -05:00
bmribler
aea4c53654
Fix incorrect VOL vs. non-VOL calls partially (#4733)
* Fix incorrect VOL vs. non-VOL calls

H5Lget_info2() called H5I_object() instead of H5VL_vol_object() crashed
user application.
This is a wide-spread issue (GH-4730) but this PR only addresses GH-4705.

* Remove an incorrect change
2024-08-20 19:36:40 -05:00
Quincey Koziol
adc3a37e96
Fix semaphore test (#4725)
* Make counter in semaphore test an atomic variable

* Revert using atomic counter and fix counter access outside of semaphore
2024-08-19 08:53:10 -05:00
bmribler
b4731e4a85
Cleanup up tests (#4724) 2024-08-19 08:02:13 -05:00
mattjala
d25cc7d41b
Test creating unseekable file (#4720) 2024-08-19 07:35:40 -05:00
bmribler
d875f749e5
Add tests for H5R get name APIs (#4657)
Added functionality tests for the following APIs:
H5Rget_file_name
H5Rget_obj_name
H5Rget_attr_name

Also removed "+1" when returning a name length in H5R__get_attr_name().
The exter "+1" gave an incorrect value for the length of the referenced
object's attribute name.

Fixed GH-4447

* Fix Fortran test

The C API H5Rget_attr_name incorrectly added 1 to the length of the
referenced object's attribute name, so the Fortran API h5rget_attr_name_f
removed 1 from the returned value to accommodate the incorrectness.
This PR fixes H5Rget_attr_name so this workaround in h5rget_attr_name_f
is no longer needed.

* Add test H5Aget_name against H5Rget_attr_name
2024-08-12 09:40:48 -05:00
Allen Byrne
695c0f2907
Use local variable in btree2 and print value (#4679)
* Correct logic

* Technically, level 1 Express could skip tests
2024-08-08 21:57:22 -05:00
bmribler
5c39fddb92
Add check of returned value from API calls. (#4702)
These were found while investigating GH-4672, but they were not related
to GH-4672.
2024-08-08 07:38:25 -05:00
Quincey Koziol
eede36f0cd
Remove another H5E_BEGIN/END_TRY within the library (#4675)
* Update logic for (deprecated) H5Gget_objinfo() call to eliminate H5E_BEGIN_TRY

* Handle case for '.' at the end of a path
2024-08-06 06:21:07 -05:00
Allen Byrne
f77b70859f
Rework Dynamic Analysis and sanitize testing (#4681)
* Ignore predetermined failing test and check pointer before use

* Rework Analysis process
2024-08-05 09:53:53 -05:00
Quincey Koziol
6061296fc7
Remove racey condition for starting threads (#4693)
Signed-off-by: Quincey Koziol <quincey@koziol.cc>
2024-08-05 07:36:47 -05:00
Allen Byrne
1be198decf
Correct the properties for using THREADS library (#4690) 2024-08-02 10:57:20 -05:00
Allen Byrne
0f620e91be
CMake link line needs to use new HDF5_ENABLE_THREADS (#4685) 2024-08-01 22:29:44 -05:00
Quincey Koziol
9fd88560d5
Refactor threading and other concurrency support (#4469)
Complete overhaul of the concurrency-related aspects of the library (threading, atomics, locking, etc.), adding private routines in the H5TS package to allow internal algorithms to use all of these capabilities.

Adds many new features & components in the H5TS package that are equivalent to common concurrency data structures and capabilities: "regular" and recursive mutices, condition variables, semaphores, thread barriers, 'once' support, thread pools, atomic variables, thread-local keys, and spawning & joining internal threads.

Now supports C11, pthreads, and Windows threading for all H5TS capabilities, except the recursive readers/writers lock, which is not supported on Windows (because Windows threads don't provide a callback on thread-local variable deletion).

The "global" API lock is switched to use a recursive mutex from the H5TS package, instead of its own variant.

API context code (H5CX package) and error stacks (H5E package) now use the common thread-local info, instead of their own variants.

Subfiling code is switched from using Mercury threading features to the new internal H5TS features.

Removes the mercury threading code.

Adds a configure option (--enable-threads / HDF5_ENABLE_THREADS), enabled by default, to control whether threading is enabled within the library.
2024-07-31 12:34:43 -05:00
Larry Knox
f54abf7032
Remove outdated line from Copyright header in new files. (#4676) 2024-07-29 12:57:36 -05:00
bmribler
9fd4fd0b58
Replace incorrect use of an internal function (#4668)
* Replace incorrect use of an internal function

In some API functions, the internal function H5I_object() was used instead
of H5I_object_verify(), which verifies the type of an ID argument.  So
when an inappropriate ID was passed in to the affected API, it was accepted.
This behavior can cause issues at a later time, including a segfault, as
reported in issue #GH-4656.

The fix was applied to the following functions:
H5Fget_intent()
H5Fget_fileno()
H5Fget_freespace()
H5Fget_create_plist()
H5Fget_access_plist()
H5Fget_vfd_handle()
H5Dvlen_get_buf_size()
H5Fget_mdc_config()
H5Fset_mdc_config()
H5Freset_mdc_hit_rate_stats()

Fixes GH-4662
2024-07-24 10:42:58 -05:00
Scot Breitenfeld
8d50786f7a
Reworked cleaning up API test files (#4626)
* Reworked cleaning up test files, only removing test files if present to account for skipped tests

* changed to using H5Fis_accessible

* update to full use of remove_test_file
2024-07-05 12:38:26 -07:00
jhendersonHDF
773831f3cb
Add H5F_LIBVER_V116 to internal library version structures (#4619)
Also add H5F_LIBVER_V116 flag to Fortran wrappers
2024-07-02 09:26:05 -05:00
Scot Breitenfeld
d6541ba8e3
Test fixes for log-based vol (#4618)
* fixes to address failures in the log-based VOL

* moved file cleanup to tests proper

* skipped index API test if not supported
2024-07-02 09:25:15 -05:00
Dana Robinson
f8690c1844
Clean up s3comms test code (#4594)
* Remove JS* macros
* Remove dead code
* Bring in line with other test code
2024-06-21 09:02:07 -07:00
Allen Byrne
162f01292c
Rework the TestExpress usage and refactor dead code (#4590) 2024-06-20 14:01:43 -07:00
Dana Robinson
9fe7132fe3
Remove dead H5FD_s3comms_percent_encode_char() (#4591) 2024-06-19 16:22:21 -05:00
Dana Robinson
45711d7c94
Remove magic fields from s3comms structs (#4589) 2024-06-19 13:03:10 -07:00
Dana Robinson
f931c2aed2
Removed unused code from H5FDs3comms.c (#4588)
* H5FD_s3comms_nlowercase()
* H5FD_s3comms_trim()
* H5FD_s3comms_uriencode()
2024-06-19 12:24:13 -07:00
Dana Robinson
a229778142
Cleanup of ros3 test (#4587)
* Removed JS* macro scheme (replaced w/ h5test.h macros)
* Moved curl setup/teardown to main()
* A lot of cleanup and simplification
2024-06-19 08:36:45 -05:00
Quincey Koziol
850d6c8f06
Pause recording errors instead of clearing the error stack (#4475)
An internal capability that's similar to the H5E_BEGIN_TRY / H5E_END_TRY
macros in H5Epublic.h, but more efficient since we can avoid pushing errors on
the stack entirely (and those macros use public API routines).

This capability (and other techniques) can be used to remove use of
H5E_clear_stack() and H5E_BEGIN_TRY / H5E_END_TRY within library routines.

We want to remove H5E_clear_stack() because it can trigger calls to the H5I
interface from within the H5E code, which creates a great deal of complexity
for threadsafe code.  And we want to remove H5E_BEGIN_TRY / H5E_END_TRY's
because they make public API calls from within the library code.

Also some other minor tidying in routines related to removing the use of
H5E_clear_stack() and H5E_BEGIN_TRY / H5E_END_TRY from H5Fint.c
2024-06-18 14:17:43 -07:00
jhendersonHDF
4a0b1b66a5
Allow usage of page buffering for serial file access from parallel HDF5 builds (#4568) 2024-06-13 14:18:31 -05:00
Allen Byrne
539d1756e5
Add compression includes to tests needing zlib support (#4561) 2024-06-12 07:57:58 -05:00
Dana Robinson
f44fa558f2
Clean up off_t --> HDoff_t stragglers (#4555)
* off_t --> HDoff_t in test

* off_t --> HDoff_t in h5ls, h5dump, & h5repack

* Minor off_t tweak to configure.ac

* off_t --> HDoff_t fixes in src

This changes the type of the offset parameter in H5Pget_external()
to HDoff_t to match H5Pset_external(), along with other minor tweaks.

* off_t --> HDoff_t in C++ wrappers

* Fix off_t usage in Java wrapper
2024-06-07 17:25:06 -07:00
mattjala
c1b3255c69
Fix typos in context/property documentation (#4550) 2024-06-07 09:04:40 -07:00