Commit Graph

7816 Commits

Author SHA1 Message Date
jhendersonHDF
a37a049ceb
Simply check for datatypes with unusual number of unused bits (#4309)
Avoids potential undefined behavior in H5T_is_numeric_with_unusual_unused_bits
2024-04-03 15:40:15 -07:00
H. Joe Lee
f2cf0be9cb
Fix typo - glueing (#4299) 2024-04-02 07:12:17 -07:00
H. Joe Lee
1042ed4d49
Fix typo - Cnversion (#4301) 2024-04-02 07:11:21 -07:00
Dana Robinson
a314a7a497
Fix divide-by-zero when page buf page size is 0 (#4296)
If a corrupt file sets the page buffer size in the superblock to zero,
the library could attempt to divide by zero when allocating space in
the file. The library now checks for valid page buffer sizes when
reading the superblock message.

Fixes oss-fuzz issue 58762
2024-04-01 12:26:48 -07:00
H. Joe Lee
ff7f5861cb
Fix Figure 9. table format in HDF5 Groups User Guide (#4295) 2024-04-01 12:02:14 -05: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
bmribler
f24e8113a3
Add documentation (H5FD) (#4269) 2024-03-31 22:47:14 -05:00
jhendersonHDF
dc69e39f65
Add configure options for disabling extension features (#4277)
Add configure option to enable or disable extension features in general

Add configure option to enable or disable _Float16 support

Add new config options to various settings files
2024-03-31 22:45:50 -05:00
jhendersonHDF
ce53bc020d
Fixes for file format security issues (#4283) 2024-03-31 22:44:18 -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
jhendersonHDF
50d30bd4f0
Fix potential buffer read overflows in H5PB_read (#4279)
H5PB_read previously did not account for the fact that the size of the
read it's performing could overflow the page buffer pointer, depending
on the calculated offset for the read. This has been fixed by adjusting
the size of the read if it's determined that it would overflow the page.
2024-03-29 07:43:59 -05:00
jhendersonHDF
98c19af7c8
Fix range check in H5_addr_overlap (#4278)
When the H5_addr_overlap macro was updated to use H5_RANGE_OVERLAP,
it failed to take into account that H5_RANGE_OVERLAP expects the
range to be inclusive. This lead to an assertion failure in
H5MM_memcpy due to a memcpy operation on overlapping memory.
This has been fixed by subtracting 1 from the calculated high
bound values passed to H5_RANGE_OVERLAP
2024-03-29 07:41:42 -05:00
jhendersonHDF
03b6575b1b
Minor fixes after merge of file format security fixes (#4263)
* Update H5_IS_BUFFER_OVERFLOW to account for 'size' of 0

* Invert a few checks to avoid function call
2024-03-28 11:49:50 -07:00
jhendersonHDF
372381c530
Prevent stack overflows in H5E__push_stack (#4264) 2024-03-28 11:12:19 -07:00
bmribler
bdbe584d44
Add documentation (H5P) (#4262) 2024-03-27 21:06:43 -05:00
bmribler
44738f17a2
Add documentation (H5M) (#4259) 2024-03-27 20:14:23 -05:00
Dana Robinson
136739b37a
File format security issues (#4234) 2024-03-27 13:12:32 -07:00
Dana Robinson
74498cb211
Remove an error check regarding large cache objects (#4254)
* Remove an error check regarding large cache objects

In PR#4231 an assert() call was converted to a normal HDF5 error
check. It turns out that the original assert() was added by a
developer as a way of being alerted that large cache objects
existed instead of as a guard against incorrect behavior, making
it unnecessary in either debug or release builds.

The error check has been removed.

* Update RELEASE.txt
2024-03-27 10:55:28 -05:00
jhendersonHDF
37df21707b
Rewrite H5T__path_find_real for clarity (#4225)
* Move conversion path free logic to helper function
2024-03-27 08:07:57 -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
jhendersonHDF
da60238e83
Set DXPL in API context for native VOL attribute I/O calls (#4228) 2024-03-24 22:07:21 -05:00
Dana Robinson
3e9c2a6a5c
Fixed a cache assert with too-large metadata objects (#4231)
If the library tries to load a metadata object that is above the
library's hard-coded limits, the size will trip an assert in debug
builds. In HDF5 1.14.4, this can happen if you create a very large
number of links in an old-style group that uses local heaps.

The library will now emit a normal error when it tries to load a
metadata object that is too large.

Partially addresses GitHub #3762
2024-03-24 22:07:01 -05:00
bmribler
817175e6e3
Fix broken URLs in documentation (#4214)
Fixes GH-3881 partially.  There are pages that need to be recreated.
2024-03-24 15:12:36 -05:00
bmribler
ce8ad65b4f
Fix broken links (#4224) 2024-03-23 22:33:36 -05: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
bmribler
174c22df22
Summarize the library version table (#4212)
Fixes GH-3773
2024-03-22 11:54:46 -05:00
Glenn Song
02b5204472
Add clarification for current behavior of H5Get_objtype_by_idx() (#4120) 2024-03-22 11:16:01 -05:00
vchoi-hdfgroup
093cca7ae4
Propagate group creation properties to intermediate groups (#4139) 2024-03-22 08:12:14 -07:00
jhendersonHDF
c4cc33abe1
Fix issue with Subfiling VFD and multiple opens of same file (#4194)
* Fix issue with Subfiling VFD and multiple opens of same file

* Update H5_subfile_fid_to_context to return error value instead of ID

* Add helper routine to initialize open file mapping
2024-03-21 17:39:13 -07:00
bmribler
20c570b091
Fix H5Pset_efile_prefix documentation error (#4206)
Fixes GH issue #1759
2024-03-21 09:10:55 -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
Allen Byrne
85af302798
A path component may include a dot with other characters (#4192) 2024-03-20 16:44:05 -05:00
Glenn Song
a286066123
Handle certain empty subfiling environment variables (#4038) 2024-03-20 10:52:27 -07:00
Dana Robinson
8e78cfebf8
Add semicolons to the end of HSYS_GOTO_ERROR (#4193)
Looks like we forgot these when we did the other macros.
2024-03-20 09:31:11 -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
H. Joe Lee
c02be4df09
Add a missing period at the end of sentence. (#4184) 2024-03-19 16:32:53 -07:00
Allen Byrne
8f3e544193
Filter plugins updates for registration URL (#4180)
* Update filter plugin URL to new location

* Adjust test array size
2024-03-19 15:11:15 -05:00
jhendersonHDF
48d3e48d59
Add const to new _Float16 conversion routine parameters (#4181) 2024-03-19 07:10:57 -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
Allen Byrne
4e222bf5bb
Add filter plugin user guide text. Fix registered URL in docs (#4169) 2024-03-18 08:36:55 -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
51fab96f4e
Add Doxygen to API calls in H5VLnative.h (#4173) 2024-03-18 06:06:07 -07:00
Dana Robinson
eb0351efff
Address code page issues w/ Windows file paths (#4172)
On Windows, HDF5 attempted to convert file paths passed to open() and
remove() to UTF-16 in order to handle Unicode file paths. This scheme
does not work when the system uses code pages to handle non-ASCII
file names.

As suggested in the forum post below, we now also try to see if we
can open the file with open(), which should handle systems where
non-ASCII code pages are in use.

https://forum.hdfgroup.org/t/open-create-hdf5-files-with-non-utf8-chars-such-as-shift-jis/11785
2024-03-18 06:05:45 -07:00
jhendersonHDF
840476ead8
Fix an issue where the Subfiling VFD's context cache grows too large (#4159) 2024-03-17 18:48:16 -07:00
Dana Robinson
2908dd1d12
Bump the size of the mirror VFD IP field (#4167)
The IP address string isn't big enought to hold an IPv4-mapped IPv6
address.
2024-03-17 11:34:21 -07:00
jhendersonHDF
a56675e12a
Fix some minor warnings (#4165) 2024-03-16 19:43:47 -07:00
Dana Robinson
87970e1d53
Add Doxygen to H5FDmirror.h (#4158) 2024-03-16 11:44:59 -05:00
Dana Robinson
9a90122ef8
Header cleanup in C library (#4154)
* Ensure H5FL header is included everywhere

* Ensure H5SL header is included everywhere

* Ensure H5MM header is included everywhere
2024-03-16 11:42:32 -05:00
jhendersonHDF
1029e34fb9
Suppress H5Dmpio debugging output unless HDF5_DEBUG=d is set (#4155) 2024-03-16 11:42:01 -05:00
Dana Robinson
6d85ea26ab
Remove H5O header and friend status from H5A.c (#4150) 2024-03-15 13:01:22 -07:00
Sergey Kosukhin
6635198d7f
Fix buffer size calculation in the deflate filter (#4147) 2024-03-15 13:01:03 -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
Dana Robinson
92d1463a02
Clean up some hbool_t/TRUE/FALSE stragglers (#4143)
It looks like most of these snuck in via selection I/O work
2024-03-15 08:54:08 -07:00
Dana Robinson
f3900f2f61
Remove useless headers (#4145)
Removes unnecessary headers from C library source files.
2024-03-15 08:49:59 -07:00
Dana Robinson
56f1092ddb
Overhaul CMake LFS support (#4122)
Externally visible:
* The HDF_ENABLE_LARGE_FILE option (advanced) has been removed
* We no longer run a test program to determine if LFS works, which
  will help with cross-compiling
* On Linux we now unilaterally set -D_LARGEFILE_SOURCE and
  -D_FILE_OFFSET_BITS=64, regardless of 32/64 bit system. CMake
  doesn't offer a nice equivalent to AC_SYS_LARGEFILE and since
  those options do nothing on 64-bit systems, this seems safe and
  covers all our bases. We don't set -D_LARGEFILE64_SOURCE since
  we don't use any of the POSIX 64-bit specific API calls like
  ftello64, as noted above.
* We didn't test for LFS support on non-Linux platforms. We've added
  comments for how LFS should probably be supported on AIX and Solaris,
  which seem to be alive, though uncommon. PRs would be appreciated if
  anyone wishes to test this.

Internal:
* Drops off64_t size checks since this is unused (as in Autotools)
* Remove HDF_EXTRA_FLAGS, which is now unused
* Remove hack around deprecated LINUX_LFS

Fixes #2395
2024-03-12 14:36:50 -07:00
Glenn Song
27f73183e2
Initialize selection type in chunk struct (#4087) 2024-03-12 12:01:23 -07:00
jhendersonHDF
4b297e986c
Implement ID creation optimization for container datatype conversions (#4113)
Makes the datatype conversion context object available during both the
initialization and conversion processes for a datatype conversion
function, allowing the compound, variable-length and array datatype
conversion functions to avoid creating IDs for the datatypes when they
aren't necessary

Adds internal H5CX_pushed routine to determine if an API context is
available to retrieve values from

Also adds error checking to several places in H5T.c and H5Tconv.c where
the code had previously assumed object close operations would succeed
2024-03-12 03:42:32 -07:00
Dana Robinson
ac9541100f
Add Doxygen for HDFS VFD (#4106)
* Add Doxygen for HDFS VFD

* Fix Doxygen warning

* Update H5FDhdfs.h
2024-03-10 17:26:14 -07:00
Dana Robinson
9bc6c20166
Remove lint comments (#4107) 2024-03-10 16:17:49 -07:00
Dana Robinson
700d1a24df
Convert H5B__assert to use error checks (#4109)
Switches assert() calls to HGOTO_ERROR in H5B__assert() so it can be
used in production mode. Also renames it to H5B__verify_structure()
to better reflect what it checks.
2024-03-10 16:16:41 -07:00
Dana Robinson
16b62825b3
Clean up a few things in H5T.c (#4105)
* remove (size_t) noise casts
* replace (hid_t)FAIL with H5I_INVALID_HID
2024-03-10 12:42:29 -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
28aaeb967c
Change how stats are printed in H5Z (#4097)
H5Z used the soon-to-be-removed HDEBUG macro to decide if stats
would be dumped and to what stream. This is now handled by a
DUMP_DEBUG_STATS_g variable and the output is always sent to
stdout.

This is an internal change, not normally visible to users.
2024-03-09 23:10:58 -08:00
Dana Robinson
6cb4b2f6d7
Remove printf debugging from H5Smpio.c (#4098) 2024-03-09 20:30:34 -08:00
Dana Robinson
08cf031588
Remove H5DEBUG() calls from H5Dmpio.c (#4103)
Just use stdout when a stream is needed.
2024-03-09 20:30:17 -08:00
Dana Robinson
fd7cf2a962
Remove a few H5O printf debugging statements (#4096)
These were in H5Oint.c, were protected by H5O_DEBUG, and only dumped
to stdout if the HDF5_DEBUG environment variable were set to do so.
2024-03-09 20:27:59 -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
Dana Robinson
3d09a7d5f6
Remove H5B debug checks (#4089)
The H5B (version 1 B-tree) package would add some computationally
expensive integrity checks when H5B_DEBUG was defined. Due to their
negative effects on performance, this option was rarely turned on,
making the H5B__assert() check function stale, if not dead, code.

This change:

* Builds H5B__assert() when NDEBUG is not defined (the function
  relies on assert()) so it gets compiled more often.
* Removes some printf debugging statements in the B-tree code
* Removes all H5B "extra debug" checks that are leftover from
  past debugging sessions. Maintainers can add H5B__assert()
  selectively to perform integrity checks when debugging.
* Removes the HDF5_ENABLE_DEBUG_H5B CMake option

H5B_DEBUG now has no effect
2024-03-08 23:17:13 -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
Dana Robinson
3ea50208f9
Remove printf debugging in H5I package (#4088) 2024-03-08 12:55:16 -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
Dana Robinson
f24496074f
Remove printf debugging in H5HL code (#4086) 2024-03-07 18:36:44 -08:00
Dana Robinson
577a32fe83
Fix bin/trace script w/ out params (#4074)
The bin/trace script adds TRACE macros to public API calls in the main
C library. This script had a parsing bug that caused functions that
were annotated with /*out*/, etc. to be labeled as void pointers
instead of typed pointers.

This is mainly a developer feature and not visible to consumers
of the public API.

The bin/trace script now annotates public API calls properly.

Fixes GH #3733
2024-03-07 13:04:14 -08:00
Michael Aivazis
3277064da3
Increased H5FD_ROS3_MAX_SECRET_TOK_LEN to 4096 to accommodate long AWS secret tokens (#4064)
ros3: increased H5FD_ROS3_MAX_SECRET_TOK_LEN to 4096; stratified the debugging statements so there is more control over the output
2024-03-07 08:53:45 -08:00
Dana Robinson
30c34f927d
Add support for the new MSVC preprocessor (#4078)
Microsoft has added a new, standards-conformant preprocessor
to MSVC, which can be enabled with /Zc:preprocessor. This
preprocessor trips over our HDopen() function-like variadic
macro since it uses a hack that only works with the legacy
MSVC preprocessor.

This fix adds ifdefs to use the correct HDopen() macro
depending on the MSVC preprocessor selected.

Fixes #2515
2024-03-07 08:52:32 -08:00
Scot Breitenfeld
9d8e882496
Added new H5E with tests. (#4049)
Added Fortran H5E APIs:
h5eregister_class_f, h5eunregister_class_f, h5ecreate_msg_f, h5eclose_msg_f
h5eget_msg_f, h5epush_f, h5eget_num_f, h5ewalk_f, h5eget_class_name_f,
h5eappend_stack_f, h5eget_current_stack_f, h5eset_current_stack_f, h5ecreate_stack_f,
h5eclose_stack_f, h5epop_f, h5eprint_f (C h5eprint v2 signature)

Addresses Issue #3987
2024-03-07 03:34:55 -08:00
jhendersonHDF
f5f6975c2f
Fix issue where H5Tset_fields does not account for datatype offsets (#4061)
H5Tset_fields did not account for any offset in a floating-point datatype,
causing it to fail when a datatype's precision is correctly set such that
it doesn't include the offset bits.
2024-03-05 08:23:34 -06:00
jhendersonHDF
60532b6c56
Add note to H5Tset_fields about needing to set datatype precision first (#4059)
* Offset of a floating-point type also needs to be accounted for

* Clarify ordering of H5Tset_precision and H5Tset_fields
2024-03-05 08:21:37 -06:00
jhendersonHDF
221e429578
Fix memory leak in H5LTopen_file_image when H5LT_FILE_IMAGE_DONT_COPY flag is used (#4021)
When the H5LT_FILE_IMAGE_DONT_COPY flag is passed to H5LTopen_file_image, the internally-allocated
udata structure gets leaked as the core file driver doesn't have a way to determine when or if it
needs to call the 'udata_free' callback. This has been fixed by freeing the udata structure when
the 'image_free' callback gets made during file close, where the file is holding the last reference
to the udata structure.
2024-02-26 08:52:33 -08:00
Neil Fortner
560e80c0ad
Improve performance of flushing single objects (#4017)
Improve performance of flushing a single object, and remove metadata
cache flush markers
2024-02-23 09:06:06 -08:00
jhendersonHDF
46f7aa75fd
Fix H5F_get_access_plist to copy file locking settings (#4030)
H5F_get_access_plist previously did not copy over the file locking settings
from a file into the new File Access Property List that it creates. This would
make it difficult to match the file locking settings between an external file
and its parent file.
2024-02-22 14:52:36 -06:00
Sean McBride
7aed6abd52
Replaced last sprintf with snprintf (#4007)
* Replaced last sprintf with snprintf

To have the size of the buffer, it was required to change a function signature, and change all users of it.

In most cases, determining the buffer size wasn't  trivial and so SIZE_MAX is passed. But at least this improves the infrastructure. Someone can later figure out the correct sizes.
2024-02-20 12:19:50 -05:00
Sean McBride
f309fcebbd
Issue #1824: Replaced most remaining sprintf with safer snprint (#4003) 2024-02-13 08:22:17 -06:00
H. Joe Lee
beee0a327d
Add a missing file into Makefile.am for MinGW Autotools build error. (#4004) 2024-02-13 08:19:14 -06:00
vchoi-hdfgroup
49cce9173f
Fix for github issue #2414: segfault when copying dataset with attrib… (#3967)
* Fix for github issue #2414: segfault when copying dataset with attributes.
This also fixes github issue #3241: segfault when copying dataset.
Need to set the location via H5T_set_loc() of the src datatype
when copying dense attributes.
Otherwise the vlen callbacks are not set up therefore causing seg fault
when doing H5T_convert() -> H5T__conv_vlen().
2024-02-06 14:59:27 -06:00
H. Joe Lee
33ae371dbb
chore: fix typo (#3989)
close #144
2024-02-06 09:48:08 -06:00
Scot Breitenfeld
2c3d23d1e6
corrected warning: implicit conversion changes signedness (#3982) 2024-02-02 08:11:16 -06:00
Allen Byrne
365e23340c
Fix doxygen errors (#3962)
* Switch warnings as errors to default OFF

* Enable mac docs

* Add doxygen action uses step

* Use html div around snippet

* Allow preset name to be an argument to cmake-ctest.yml
2024-01-29 07:38:54 -06:00
mattjala
1bea9e6100
Document that fileno is same for all handles (#3963) 2024-01-26 12:30:12 -08:00
Dana Robinson
70ce646c22
Change 'extensible' to 'fixed' in H5FA code (#3964) 2024-01-26 07:58:58 -08:00
jhendersonHDF
f86fe61c7f
Remove cached datatype conversion path table entries on file close (#3942)
Remove cached datatype conversion path table entries on file close

When performing datatype conversions during I/O, the library
checks to see whether it can re-use a cached datatype conversion
pathway by performing comparisons between the source and destination
datatypes of the current operation and the source and destination
datatypes associated with each cached datatype conversion pathway.
For variable-length and reference datatypes, a comparison is made
between the VOL object for the file associated with these datatypes,
which may change as a file is closed and reopened. In workflows
involving a loop that opens a file, performs I/O on an object with a
variable-length or reference datatype and then closes the file, this
can lead to constant memory usage growth as the library compares the
file VOL objects between the datatypes as different and adds a new
cached conversion pathway entry on each iteration during I/O. This is
now fixed by clearing out any cached conversion pathway entries for
variable-length or reference datatypes associated with a particular
file when that file is closed.
2024-01-23 08:21:59 -08:00
Scot Breitenfeld
54fb809382
Fortran API work. (#3941)
* - Added Fortran APIs:
      H5FGET_INTENT_F, H5SSELECT_ITER_CREATE_F, H5SSEL_ITER_GET_SEQ_LIST_F,
      H5SSELECT_ITER_CLOSE_F, H5S_mp_H5SSELECT_ITER_RESET_F

    - Added Fortran Parameters:
      H5S_SEL_ITER_GET_SEQ_LIST_SORTED_F, H5S_SEL_ITER_SHARE_WITH_DATASPACE_F

    - Added tests for new APIs
    - Removed H5F C wrapper stubs
    - Documentation misc. cleanup.
2024-01-23 07:59:10 -08:00
mattjala
51f150a945
Update H5Fget_obj_count/ids docs to reflect dtype behavior (#3932)
* Update H5Fget_obj_count/ids to reflect dtype behavior

* Clarify comments on H5Fget_obj_ids
2024-01-19 21:11:06 -06:00
Glenn Song
3d1fc2c38a
Fix chid_t to hid_t (#3948)
Co-authored-by: Glenn Song <gsong@hdfgroup.org>
2024-01-19 21:08:19 -06:00
Dana Robinson
ab11e076bf
Replace off_t with HDoff_t internally (#3944)
off_t is a 32-bit signed value on Windows, so we should use HDoff_t
(which is __int64 on Windows) internally instead.

Also defines HDftell on Windows to be _ftelli64().
2024-01-18 09:03:59 -08:00
Dana Robinson
5ae4ecc1f2
Clean up Doxygen for szip functions and constants (#3943) 2024-01-18 09:03:43 -08:00
Allen Byrne
a00d62f77a
Use props for includes and remove global includes (#3921) 2024-01-04 12:06:36 -06:00
Quincey Koziol
3a21ee0877
Add 'warning density' computation to the warnhist script (#3910)
* Add 'warning density' computation to the warnhist script, along with several
cleanups to it.   Add "--enable-show-all-warnings" configure (and CMake)
option to disable compiler diagnostic suppression (and therefore show all the
otherwise suppressed compiler diagnostics), disabled by default.  Clean up
a buncn of misc. warnings.

Signed-off-by: Quincey Koziol <qkoziol@amazon.com>
2023-12-29 08:42:35 -06:00
jhendersonHDF
6ffc55c6d9
Implement optimized support for vector I/O in Subfiling VFD (#3896)
Vector I/O requests are now processed within a single
set of I/O call batches, rather than each I/O vector
entry (tuple constructed from the types, addrs, sizes
and bufs arrays) being processed individually. This allows I/O to be
more efficiently parallelized among the I/O concentrator processes
during large I/O requests.

* Fixed some calculations and add test cases for issues spotted from review

* Removed a variable that was compensating for previous miscalculations
2023-12-27 16:28:41 -06:00
Gerd Heber
37124bc1c1
Doc versions (#3903)
* Added missing \since tags to H5D.

* Committing clang-format changes

* Fixed H5T version info.

* Committing clang-format changes

* Added missing version info to H5E.

* Committing clang-format changes

* Added version info to H5F public APIs.

* Committing clang-format changes

* Added missing H5Z public API version info.

* Added missing version info to H5G public APIs

* Added missing version info to H5I public API.

* Added missing version info to H5 public APIs

* Committing clang-format changes

* Added missing version info to H5P public APIs

* Added missing version info to H5R public APIs

* Fix comment error.

* Committing clang-format changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-21 14:51:58 -06:00
H. Joe Lee
a70c001735
Remove redundant backslash character from comment. (#3899) 2023-12-19 19:06:14 -06:00
Luc Grosheintz
cad5da6868
Fix typo in error message for MPI_Type_dup. (#3867) 2023-11-22 11:06:42 -06:00
mattjala
af4c6c4f15
Fix segfault on user compound dtype conversion callback (#3842)
* Fix segfault on user compound conversion

* Check if lib conversion func is in use
2023-11-22 07:55:25 -06:00
vchoi-hdfgroup
ed31aaca79
Implement selection vector I/O with collective chunk filling (#3826)
* Changes for ECP-344: Implement selection vector I/O with collective chunk filling.
Also fix a bug in H5FD__mpio_write_vector() to account for fixed size optimization
when computing max address.

* Fixes based on PR review comments:
For H5Dchunk.c: fix H5MM_xfree()
For H5FDmpio.c:
1) Revert the fix to H5FD__mpio_write_vector()
2) Apply the patch from Neil on the proper length of s_sizes reported by H5FD__mpio_vector_build_types()

* Put back the logic of dividing up the work among all the mpi ranks similar to the
original H5D__chunk_collective_fill() routine.

* Add a test to verify the fix for the illegal reference problem in H5FD__mpio_write_vector().
2023-11-16 10:12:45 -06:00
Allen Byrne
ef39882fa1
Change dest for doxygen (#3856)
* Switch doxygen refs to hdf5/develop
2023-11-15 17:32:07 -06:00
mattjala
b5bfea2cc3
Make filter unregister callbacks safe for VOL connectors (#3629)
* Make filter callbacks use top-level API functions

When using VOL connectors, H5I_iterate may not provide
valid object pointers to its callback. This change keeps
existing functionality in H5Zunregister() without using
potentially unsafe pointers.

* Filter callbacks use internal API

* Skip MPI work on non-native VOL
2023-11-13 14:31:24 -06:00
mattjala
5e0b59a70c
Test and document path handling of H5Lcreate_* API (#3829) 2023-11-10 22:34:46 -06:00
Dana Robinson
e0d095ebf0
Disable FP exceptions in H5T init code (#3837)
The H5T floating-point datatype initialization code can raise exceptions when handling signaling NaNs. This change disables FE_INVALID exceptions during initialization.

Also removes the -ieee=full change for NAG Fortran as that shouldn't be necessary anymore.

Fixes #3831
2023-11-07 08:13:30 -08:00
jhendersonHDF
7404b57da6
Rework MPI Info FAPL preserve PR to use VFD 'ctl' operations (#3782) 2023-11-02 21:42:28 -05:00
jhendersonHDF
562c53c44a
Fix misc. warnings from GCC when compiling with -fsanitize=undefined (#3787) 2023-11-01 08:16:33 -05:00
H. Joe Lee
e9e4ffaec7
Remove H5system.c warning on Windows oneAPI. (#3812) 2023-11-01 07:12:03 -05:00
jhendersonHDF
39c0284c38
Fix a couple usages of MPI_Info_get (#3809) 2023-10-31 06:05:52 -07:00
Dana Robinson
58ef7dcdc9
Update Doxygen initializers & identifiers in VFDs (#3795)
* Add Doxygen for all H5FD_<VFD> initializers
* Add Doxygen for all H5FD_<VFD>_VALUE values
* Mark H5FD_<vfd>_init() calls private in Doxygen
2023-10-30 11:13:54 -05:00
Dana Robinson
87636d6855
Add Doxygen to H5FDsplitter.h (#3794)
* H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION
* H5FD_SPLITTER_PATH_MAX
* H5FD_SPLITTER_MAGIC
* H5FD_splitter_vfd_config_t
* H5Pset_fapl_splitter()
* H5Pget_fapl_splitter()
2023-10-30 11:13:01 -05:00
jhendersonHDF
edb5cffdb2
Avoid attempted use of NULL pointer in parallel compression code (#3786)
The parallel compression test code tests for the case where all MPI ranks have no selection in a dataset when writing to it. Add an early exit to the code to avoid attempting to use a NULL pointer due to there being no work to do.
2023-10-27 21:20:29 -07:00
Dana Robinson
6ccace572e
Fixed a file handle leak in the core VFD (#3779)
When opening a file with the core VFD and a file image, if the file
already exists, the file check would leak the POSIX file handle.

Fixes GitHub issue #635
2023-10-25 23:16:32 -05:00
tbeu
ebeb642fcd
Fix typo in comment (#3775) 2023-10-25 20:08:41 -07:00
vchoi-hdfgroup
6578c452b5
Preserve MPI-I/O file hints when fapl is closed (#3755)
* Fix for issue #3025: Save the MPI info in the file struct so H5Fget_access_plist() can retrieve it from there.
2023-10-24 21:48:28 -05:00
Glenn Song
ea1714b303
Fix H5Pset_evict_on_close failing regardless of actual parallel use (#3761)
Allow H5Pset_evict_on_close to be called regardless of whether a parallel build of HDF5 is being used

Fail during file opens if H5Pset_evict_on_close has been set to true on the given File Access Property List and the size of the MPI communicator being used is greater than 1
2023-10-24 12:51:55 -05:00
jhendersonHDF
8cff88c507
Fix some issues with collective metadata reads for chunked datasets (#3716)
Add functions/callbacks for explicit control over chunk index open/close

Add functions/callbacks to check if chunk index is open or not so
that it can be opened if necessary before temporarily disabling
collective metadata reads in the library

Add functions/callbacks for requesting loading of additional chunk
index metadata beyond the chunk index itself
2023-10-23 19:08:06 -07:00
jhendersonHDF
af49eb5b86
Fix hangs during collective I/O with independent metadata writes (#3693) 2023-10-23 19:06:44 -07:00
Dana Robinson
ceb03358a1
Bump the ros3 VFD cache to 16 MiB (#3759) 2023-10-23 19:06:18 -07:00
Dana Robinson
d76d591555
Add a simple cache to the ros3 VFD (#3753)
Adds a small cache of the first N bytes of a file opened with the
read-only S3 (ros3) VFD, where N is 4kiB or the size of the file,
whichever is smaller. This avoids a lot of small I/O operations
on file open.

Addresses GitHub issue #3381
2023-10-23 12:45:41 -07:00
jhendersonHDF
a4c318de28
Fix buffer overflow in cache debugging code (#3691) 2023-10-23 12:33:37 -07:00
mattjala
5a00539e0d
Add native VOL checks to deprecated functions (#3647)
* Add native VOL checks to deprecated functions

* Remove unneeded native VOL checks

* Move native checks to top level calls
2023-10-23 12:32:54 -07:00
bmribler
21ec3730c5
Additional update to the library version matrix for H5Pset_libver_bounds() (#3742)
This is the follow-up of PR #3702.
2023-10-21 19:15:12 -05:00
bmribler
709367cb1a
Update the library version matrix for H5Pset_libver_bounds() (#3702)
* Fixed #3524

Added 1.12, 1.14, and 1.16 to the table for libver bounds in the H5Pset_libver_bounds docs.
2023-10-20 14:17:46 -05:00
Neil Fortner
630d6e27c9
Add new API function H5Pget_actual_select_io_mode() (#2974)
This function allows the user to determine if the library performed selection I/O, vector I/O, or scalar (legacy) I/O during the last HDF5 operation performed with the provided DXPL. Expanded existing tests to check this functionality.
2023-10-20 10:32:17 -07:00
H. Joe Lee
fce7ce1869
Clean up comments. (#3695) 2023-10-18 09:11:02 -07:00
jhendersonHDF
9557256819
Sync changes that are only in 1.14 branch (#3704) 2023-10-17 21:54:40 -07:00
Dana Robinson
08d0909c9c
Fix unused variable warning in H5F_sfile_assert_num (#3700) 2023-10-17 12:22:10 -07:00
jhendersonHDF
a6bc1186c3
Initialize API context MPI types to MPI_BYTE (#3688) 2023-10-17 09:16:48 -07:00
Dana Robinson
1b62827204
Add Doxygen for H5Pset_fapl_sec2() (#3685)
*
2023-10-16 12:21:01 -05:00
Dana Robinson
8550798100
Fix invalid memory access in S3 comms (#3681)
In the ros3 VFD, passing an empty string parameter to an internal
API call could result in accessing the -1th element of a string.
This would cause failures on big-endian systems like s390x.

This parameter is now checked before writing to the string.

Fixes GitHub #1168
2023-10-16 12:20:18 -05:00
Dana Robinson
1cbda391c4
Suppress MPI_Waitall warnings w/ MPICH (#3680)
MPICH defines MPI_STATUSES_IGNORE (a pointer) to 1, which raises warnings
w/ gcc. This is a known issue that the MPICH devs are not going to fix.

See here:
    https://github.com/pmodels/mpich/issues/5687

This fix suppresses those issues w/ gcc
2023-10-16 07:53:37 -05:00
Dana Robinson
516167d31b
Remove CANBE_UNUSED() from subfiling VFD (#3678)
This macro was an attempt to quiet warnings about release mode unused
variables that only appear in asserts. It resolves to a void cast, which
doesn't quiet warnings when an assignment has already taken place.
2023-10-16 07:52:23 -05:00
Dana Robinson
882bcd01b9
Fix a strncpy call to use dest size not src (#3677)
A strncpy call in a path construction call used the size of the src
buffer instead of the dest buffer as the limit n.

This was switched to use the dest size and properly terminate the
string if truncation occurs.
2023-10-15 13:40:19 -07:00
H. Joe Lee
eda1344a72
Remove clang warnings (#3656) 2023-10-13 09:31:50 -07:00
vchoi-hdfgroup
6f56d06f6a
Add more tests for selection I/O. (#3528) 2023-10-10 10:13:00 -05:00
jhendersonHDF
bfbfaf72e1
Update parallel compression feature to support multi-dataset I/O (#3591) 2023-10-10 10:11:22 -05:00
Scot Breitenfeld
6edd9a0aab
Drop MPI-2 support (#3643) 2023-10-07 18:16:30 -07:00
H. Joe Lee
084c35dad0
Disambiguate error output messages. (#3634)
* Disambiguate error output messages.

* Address @brtnfld review.
2023-10-05 08:31:39 -07:00
H. Joe Lee
c511d07817
Fix grammar (#3635) 2023-10-05 08:04:04 -07:00
Neil Fortner
b166368601
Remove unused member from H5D_shared_t struct. (#3628) 2023-10-03 16:39:24 -07:00
jhendersonHDF
34fcb9c5a4
Fix several spelling/grammar issues (#3621) 2023-10-03 09:01:28 -07:00
bmribler
1fd82abe58
Cleanup unused statements (#3553) (#3617)
Removed unnecessary assert statements and noise comments.
2023-09-29 07:05:36 -07:00
H. Joe Lee
5f27bc8688
Fix grammar (#3614) 2023-09-28 17:36:14 -07:00
bmribler
55c6609127
Fixed unused variable in H5CS.c (#3552) (#3612)
* Fixed #3552
2023-09-28 17:33:53 -07:00