Commit Graph

4081 Commits

Author SHA1 Message Date
Dana Robinson
4dbaec7991
Remove HD from last non-win32 C89 functions (#4348)
Removes the HD prefix from the last C89 functions with no special
Windows equilvalent:

* rename
* rewind
* setbuf
* signal
* tmpfile
2024-04-08 07:58:13 -07:00
Dana Robinson
a99d620172
Clean up random number generator code (#4338)
* Clean up random number generator code

Depending on the platform, we use a mix of random, rand, and rand_r
to generate pseudo-random numbers, along with a messy set of ifdefs
in H5private.h. We are not a cryptographic library, only use random
numbers in our test code, and have no need for anything more than the
C standard's (s)rand(). There's no point dithering about using rand()
vs random() when we're also doing bad things like using mod to
restrict the range, which introduces bias.

Also removes CMake/configure checks for rand_r and random

* Remove random/rand_r checks from build system

* Fix missed HDrandom after GitHub merge
2024-04-07 15:15:25 -07:00
Dana Robinson
0de523bc42
Remove HD macros for C time functions (#4337)
* HDasctime
* HDclock
* HDctime
* HDdifftime
* HDgmtime
* HDlocaltime
* HDmktime
* HDtime
* HDtzset

HDgettimeofday will be done later
2024-04-07 14:09:23 -07:00
jhendersonHDF
3db69574f0
Fix h5py testing failure due to invalid datatype IDs (#4321)
Fixes an issue where invalid datatype IDs are passed to application conversion
functions in the case where the top-level conversion function is a library-internal
function that operates on a container-like datatype, but one or more of the
base datatype members are converted with an application conversion function.
2024-04-04 09:55:20 -05:00
H. Joe Lee
c6e26a1da9
Fix typo - differetly (#4311) 2024-04-02 14:55:12 -07:00
Neil Fortner
589f5238fe
Fix problems with background buffers and array datatypes (#4218)
* Fix bug in array conversion with strided background buffer. Convert some
memmove calls to non-overlapping buffers to memcpy.

* Revert inappropriate use of mempy to memmove in H5T__conv_array

* Add testing

* Add RELEASE.txt note and overwrite test case.
2024-03-31 22:49:45 -05:00
Allen Byrne
875fb3e70a
Add missing foreach for VFD and Pasthrough runs (#4292) 2024-03-31 22:43:36 -05:00
Dana Robinson
80fc8558b0
Fix off_t straggers (#4291)
Convert off_t to HDoff_t (mainly for Windows):

* h5jam
* h5unjam
* chunk_info test
2024-03-31 12:12:26 -07:00
Allen Byrne
6596c3edc3
Add TestExpress=0 workflow (#4281)
* Add TestExpress=0 CI
2024-03-29 14:19:58 -05:00
Dana Robinson
855b95b34b
Relaxed behavior of H5Pset_page_buffer_size() when opening files (#4280)
This API call sets the size of a file's page buffer cache. This call
was extremely strict about matching its parameters to the file strategy
and page size used to create the file, requiring a separate open of the
file to obtain these parameters.

These requirements have been relaxed when using the fapl to open
a previously-created file:

* When opening a file that does not use the H5F_FSPACE_STRATEGY_PAGE
  strategy, the setting is ignored and the file will be opened, but
  without a page buffer cache. This was previously an error.

* When opening a file that has a page size larger than the desired
  page buffer cache size, the page buffer cache size will be increased
  to the file's page size. This was previously an error.

The behavior when creating a file using H5Pset_page_buffer_size() is
unchanged.

Fixes GitHub issue #3382
2024-03-29 11:46:31 -07:00
Dana Robinson
c3d1c7c0ab
CHECK --> CHECK_PTR in tmisc.c (#4274) 2024-03-28 12:07:52 -07:00
Dana Robinson
82442ed983
Clean up test/cmpd_dtransform.c (#4270)
* Clean up test/cmpd_dtransform.c

* Fix uninitialized memory warning from sanitizers
* FAIL_STACK_ERROR --> TEST_ERROR
* Emit output
* Delete test file when done

* Fix typo

* H5Fdelete() --> remove()
2024-03-27 20:26:08 -07:00
H. Joe Lee
ce3784de25
Replace user-define with user-defined (#4261) 2024-03-27 13:55:44 -07:00
Dana Robinson
136739b37a
File format security issues (#4234) 2024-03-27 13:12:32 -07:00
jhendersonHDF
9ea01546b6
Skip userblock test in chunk_info.c for multi-file VFDs (#4249) 2024-03-26 16:17:35 -05:00
jhendersonHDF
9a08e3f476
Fix a minor warning in h5test.c (#4242) 2024-03-25 21:56:34 -05:00
Dana Robinson
fc46c83614
Take user block into account when returning chunk addresses (#4236)
Both H5Dchunk_iter() and H5Dget_chunk_info(_by_coord)() did not take
the size of the user block into account when reporting addresses. Since
the #1 use of these functions is to root around in the file for the raw
data, this is kind of a problem.

Fixes GitHub issue #3003
2024-03-25 19:27:14 -07:00
bmribler
81c811b721
Fix links md files (#4239) 2024-03-25 10:54:31 -05:00
Dana Robinson
ecdb656f08
Clean up types in h5test.c (#4235)
Reduces warnings on 32-bit and LLP64 systems
2024-03-25 08:23:28 -07:00
Dana Robinson
1136ac5268
Use cp -rp in test_plugin.sh (#4233)
When building with debug symbols on MacOS, the cp -p commands in
test_plugin.sh will attempt to copy the .dSYM directories with
debugging info, which will fail since -r is missing.

Using cp -rp is harmless and allows the test to run

Fixes HDFFV-10542
2024-03-25 07:46:12 -05:00
jhendersonHDF
2515bbd922
Fix Java JNI warnings (#4229) 2024-03-24 18:09:05 -07:00
jhendersonHDF
86ca181bd8
Fix 'make check-vfd' target for Autotools (#4211)
Changes Autotools testing to use HDF5_TEST_DRIVER environment
variable to avoid running tests that don't work well with several
VFDs

Restores old h5_get_vfd_fapl() testing function to setup a FAPL
with a particular VFD

Adds a macro for the default VFD name
2024-03-22 21:31:16 -05:00
vchoi-hdfgroup
093cca7ae4
Propagate group creation properties to intermediate groups (#4139) 2024-03-22 08:12:14 -07:00
Dana Robinson
15608c00b5
Call memset before stat calls (#4202)
The buffers passed to stat-like calls are only partially filled in by
the call, leaving ununitialized memory areas when the stat buffers are
created on the stack.

This change memsets the buffers to 0 before the stat calls, quieting
the -fsanitze=memory complaints.
2024-03-21 05:31:30 -07:00
mattjala
e99b0af7e0
Skip vlen IO API test for cache VOL (#4135)
* Fix cache VOL segfault in vlen io test
* Skip vlen IO API test
2024-03-20 10:50:40 -07:00
Dana Robinson
56c527d752
Fixes several MinGW + Autotools issues (#4190)
* Fixes detection of various Windows libraries, etc.
* Corrects alarm(2) configure checks
* Uses Win32 threads by default w/ Pthreads override, if desired
* Set _WIN32_WINNT correctly for MinGW
* Fix setenv(3) wrapper for MinGW, which does not have getenv_s()

MinGW Autotools support is still not Amazing, but this at least
allows the library and tools build and is better about thread-safety
2024-03-20 08:40:09 -07:00
jhendersonHDF
4c0f1468d2
Skip part of dtypes.c _Float16 file size check for certain VFDs (#4182) 2024-03-19 22:06:49 -07:00
jhendersonHDF
c91b3e6168
Remove some H5T_copy calls that are now unnecessary (#4164)
Removes some datatype copying calls that are now unnecessary after
refactoring the datatype conversion code to use pointers internally
rather than IDs

Rewrites the enum conversion function so that it uses cached copies
of the source and destination datatypes in order to avoid modifying
the datatypes passed in

Adds a 'recursive' field to the datatype conversion context which
allows the conversion functions for members of a container datatype
to skip unnecessary repetitive conversion setup code

Changes internal datatype conversion callback functions so that the
source and destination datatype structure pointers are const

Removes some unused and unnecessary internal IDs registered with
H5I_register
2024-03-18 21:44:31 -07:00
jhendersonHDF
330b80a266
Add support for _Float16 16-bit floating point type (#4065)
Fixed some conversion issues with Clang due to problematic undefined
behavior when casting a negative floating-point value to an integer

Fixed a bug in the library's software integer to floating-point
conversion function where a user's conversion exception function
returning H5T_CONV_UNHANDLED in the case of overflows would result in
incorrect data after conversion

Added configure checks for functions and macros related to _Float16
usage since some compilers expose the datatype but not the functions or
macros

Fixed a dt_arith test failure when H5_WANT_DCONV_EXCEPTION isn't defined

Fixed a few warnings from not explicitly casting some _Float16 variables
upwards
2024-03-18 21:36:46 -07:00
Dana Robinson
344ba97fec
Allow H5Soffset_simple to accept NULL offsets (#4152)
The reference manual states that the offset parameter of H5Soffset_simple()
  can be set to NULL to reset the offset of a simple dataspace to 0. This
  has never been true, and passing NULL was regarded as an error.

  The library will now accept NULL for the offset parameter and will
  correctly set the offset to zero.

  Fixes HDFFV-9299
2024-03-18 06:57:52 -07:00
Dana Robinson
fa44de4cdb
Fix mirror VFD script (#4170)
This had directory problems when running locally.
2024-03-17 18:47:59 -07:00
jhendersonHDF
a56675e12a
Fix some minor warnings (#4165) 2024-03-16 19:43:47 -07:00
Neil Fortner
40e1c6d078
Fix error when overwriting an indirectly nested vlen with a shorter sequence (#4140) 2024-03-15 09:26:56 -07:00
Allen Byrne
437f21549b
Fix doxygen link to example function usage (#4133) 2024-03-15 08:24:32 -07:00
jhendersonHDF
ca9c942844
Skip part of dsets.c test for IBM long double type (#4136) 2024-03-15 00:12:50 -07:00
mattjala
c3714b9f15
Fix segfault in vlen io API test (#4130) 2024-03-13 14:55:51 -05:00
jhendersonHDF
037c8b63d5
Handle IBM long double issues in dsets.c test_floattypes test (#4116)
* Handle IBM long double issues in dsets.c test_floattypes test
2024-03-12 07:49:41 -05:00
jhendersonHDF
4279c351f5
Fix up dsets test for some platforms with different long double format (#4114) 2024-03-11 14:39:13 -05:00
Allen Byrne
8340c4cb1f
long double tests has problems setting precision with offset (#4102)
* long double tests has problems setting precision with offset

* Disable long double until more development fixes issues
2024-03-11 07:58:35 -05:00
Dana Robinson
7403f20757
Move common variables out of cache test blocks (#4108)
Fixes a stack size warning w/ XCode
2024-03-10 16:17:37 -07:00
Dana Robinson
f0ba8baa0d
Minimize use of abort() (#4110)
The abort() call is used at several places where it probably shouldn't.
2024-03-10 12:42:16 -07:00
jhendersonHDF
ef401a5f5e
Refactor datatype conversion code to use pointers rather than IDs (#4104)
The datatype conversion code previously used IDs for the source and
destination datatypes rather than pointers to the internal structures
for those datatypes. This was mostly due to the need for an ID for these
datatypes that can be passed to an application-registered datatype
conversion function or datatype conversion exception function. However,
using IDs internally caused a lot of unnecessary ID lookups and hurt
performance of datatype conversions in general. This was especially
problematic for compound datatype conversions, where the ID lookups were
occuring on every member of every compound element of a dataset. The
code has now been refactored to use pointers internally and only create
IDs for datatypes when necessary.

Fixed a test issue in dt_arith where a library datatype conversion
function was being cast to an application conversion function. Since the
two have different prototypes, this started failing after the parameters
for a library conversion function changed from hid_t to H5T_t * and an
extra parameter was added. This appears to have worked coincidentally in
the past since the only different between a library conversion function
and application conversion function was an extra DXPL parameter at the
end of an application conversion function

Fixed an issue where memory wasn't being freed in the h5fc_chk_idx test
program. Even though the program exits quickly after allocating the
memory, it still causes failures when testing with -fsanitize=address
2024-03-09 23:47:31 -08:00
Dana Robinson
0ea1d7280b
Clean up off_t usage (#4095)
* Add comments to C++ and Fortran API calls that use off_t
* Remove noise casts for small integers
2024-03-09 09:06:10 -08:00
jhendersonHDF
d8af09dd8f
Expand check for variable-length or reference types when clearing datatype conversion paths (#4085)
When clearing out datatype conversion paths involving variable-length or reference datatypes
on file close, also check for these datatypes inside compound or array datatypes
2024-03-08 21:15:56 -08:00
Allen Byrne
84ead492c0
Update long double test with correct values (#4060)
Update long double test with correct values
2024-03-08 14:13:38 -08:00
Dana Robinson
b0af7cf58b
Fixed asserts due to H5Pset_est_link_info() values (#4081)
* Fixed asserts due to H5Pset_est_link_info() values

If large values for est_num_entries and/or est_name_len were passed
to H5Pset_est_link_info(), the library would attempt to create an
object header NIL message to reserve enough space to hold the links in
compact form (i.e., concatenated), which could exceed allowable object
header message size limits and trip asserts in the library.

This bug only occurred when using the HDF5 1.8 file format or later and
required the product of the two values to be ~64k more than the size
of any links written to the group, which would cause the library to
write out a too-large NIL spacer message to reserve the space for the
unwritten links.

The library now inspects the phase change values to see if the dataset
is likely to be compact and checks the size to ensure any NIL spacer
messages won't be larger than the library allows.

Fixes GitHub #1632

* Fix copy-paste comments
2024-03-07 18:36:58 -08:00
mattjala
64a0b71c86
Close and reopen file during dset vlen IO API tests (#4050)
- Close/reopen file and file objects to prevent cache from being used instead of actual I/O.
- Moved vlen io test datasets under the dset container group instead of the root group
- Moved the PASSED() invocation to after individual test cleanup in case an error occurs during H5Treclaim
2024-03-07 09:07:05 -08:00
Dana Robinson
10a35d0ebb
Fix uninitialized bytes in selection I/O test (#4073)
This was due to a complex type fill value being set to -1 instead
of a proper complex value. This was a test problem and not a core
library issue.
2024-03-06 07:48:28 -08:00
Dana Robinson
e4d9b639d5
Fix uninitialized bytes in cmpd_dset test (#4072)
Compound fill values were set to the integer -1, causing valgrind
to flag 'uninitialized bytes' errors.

This is just a problem with the cmpd_dset test and not a core
library problem.
2024-03-05 14:33:09 -08:00
Dana Robinson
13348ab915
Fix a memory leak in the cmpd_dset test (#4071)
This was due to not freeing a test buffer. It was not a core
library memory leak.
2024-03-05 13:16:17 -08:00