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

Merge issue 839 develop PRs to hdf5 1 10 - round 2 #852

Merged
merged 46 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c5d3ff5
Revert addition of & to 2 parameters in DSetCreatPropList::setVirtual to
lrknox May 17, 2021
df9c7de
Merge branch 'hdf5_1_10' of https://github.com/HDFGroup/hdf5 into hdf…
lrknox Jun 3, 2021
426b504
Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)
jhendersonHDF May 12, 2021
da089c5
Removes gratuitous (double)x.yF casts (#632)
derobins May 7, 2021
e2bfcf4
Cleans up a const warning left over from previous constification (#633)
derobins May 7, 2021
a317873
Purges UFAIL from the library (#637)
derobins May 11, 2021
cc05a1e
Bmr dev hdffv 11223 (#640)
bmribler May 12, 2021
59a0ebd
Committing clang-format changes
github-actions[bot] Jun 3, 2021
6ed1a94
Restore "error:" in line 2666.
lrknox Jun 3, 2021
c502c85
Merge branch 'hdf5_1_10' of https://github.com/lrknox/hdf5 into hdf5_…
lrknox Jun 3, 2021
d3a6523
Revert "Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)"
lrknox Jun 3, 2021
8234aac
Snapshot version 1.10 release 8-1. Update version to 1.10.8-2.
lrknox Jul 14, 2021
764cc03
Merge branch 'HDFGroup:hdf5_1_10' into hdf5_1_10
lrknox Jul 14, 2021
51e0e42
(fix) Segmentation fault when using a compound type. (#143)
jwsblokland Dec 2, 2020
7c70f57
(fix) H5Z_xform_create function and scientific notation (#144)
jwsblokland Dec 2, 2020
81ab548
Adds const to a few global variables (#623)
derobins May 4, 2021
caccc86
Made private my_yyinput function static (#618)
seanm May 4, 2021
cfc57ce
Reduces overly-pedantic casting in the public headers (#644)
derobins May 15, 2021
c7e76e2
Use internal version of H5Eprint2 to avoid possible stack overflow (#…
jhendersonHDF May 26, 2021
db8298b
Fixes for a couple of trivial warnings (#676)
derobins May 24, 2021
edddb11
Removes alternative function enter/leave macro scheme (#678)
derobins May 29, 2021
2279e01
Various CMake changes (#679)
derobins May 24, 2021
b9788b6
Revert "Removes alternative function enter/leave macro scheme (#678)"
lrknox Jul 15, 2021
4fdbb41
err_compat test cleanup (#681)
derobins May 25, 2021
652ffca
Sets the memory alloc sanity check option to disabled in autotools (#…
derobins May 25, 2021
08a5e38
Revert "Sets the memory alloc sanity check option to disabled in auto…
lrknox Jul 15, 2021
580adbc
Removes alternative function enter/leave macro scheme (#678)
derobins May 29, 2021
a69a754
Committing clang-format changes
github-actions[bot] Jul 15, 2021
2ae7065
Merge branch 'hdf5_1_10' into merge_839_hdf5_1_10
lrknox Jul 15, 2021
ef387ad
Squashed commit of the following:
lrknox Jul 20, 2021
628fcae
Revert references to SIZE_MAX to ((size_t)(-1)) in C header defines u…
lrknox Jul 21, 2021
1bfaf3b
Merge branch 'hdf5_1_10' into hdf5_1_10
lrknox Jul 21, 2021
5196d12
Merge branch 'hdf5_1_10' into merge_839_hdf5_1_10
lrknox Jul 22, 2021
56ed78b
Fix H5FD_mpio_Debug="rw" can report MPI_count instead of bytes (#699)
brtnfld May 28, 2021
3e709e7
Removes pre-C99 build and header cruft (#700)
derobins May 28, 2021
02adcc9
Clean up type size checks in configure.ac (#702)
derobins May 29, 2021
7dea73c
Removes some DEC Alpha cruft from H5detect and H5private.h (#708)
derobins Jun 2, 2021
be6ad9a
Cleans up hsize_t and haddr_t size guessing (#709)
derobins Jun 2, 2021
a2a3905
Revert "Cleans up hsize_t and haddr_t size guessing (#709)"
lrknox Jul 23, 2021
7f1dda8
Updates bin/trace script to correctly wrap H5TRACE macros near clang-…
derobins Jun 3, 2021
2f2b373
Fixes a segfault when H5Pset_mdc_log_options is called multiple times…
derobins Apr 29, 2021
6c2a75a
Fix for a segfault when H5Pset_fapl_log is passed an invalid fapl ID …
derobins Apr 29, 2021
41e8ef0
Fixes crashes when size_hint > UINT32_MAX is passed to H5Gcreate1 (#611)
derobins Apr 30, 2021
bb0ce96
Adds __STDC_FORMAT_MACROS before including inttypes.h w/ C++ (#726)
derobins Jun 4, 2021
d8ef8cf
Remove conflicts from RELEASE.txt
lrknox Jul 23, 2021
005df08
Always include inttypes.h
lrknox Jul 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions bin/trace
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,33 @@ sub rewrite_func ($$$$$) {
# Compose the trace macro
$trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \"";
$trace .= join("", @arg_str) . "\"";
my $len = 4 + length $trace; # Add 4, for indenting the line
for (@arg_name) {
# Wrap lines that will be longer than the limit, after ');' is added
if ($len + length >= ($max_trace_macro_line_len - 2)) {
$argtrace .= join("", @arg_str) . "\"";

# Add 4 for indenting the line
my $len = 4 + length($trace);

for my $i (0 .. $#arg_name) {
# Handle wrapping

# Be VERY careful here! clang-format and this script MUST agree
# on which lines get wrapped or there will be churn as each tries
# to undo the other's output.
#
# TWO cases must be handled:
# 1) The argument is that last one and ');' will be appended
# 2) The argument is NOT the last one and ',' will be appended
#
# NB: clang-format does NOT consider terminal newlines when
# counting columns for the ColumnLimit
#
# The extra '2' added after $len includes the ', ' that would be
# added BEFORE the argument.
#
my $adjust = ($i + 1 == scalar(@arg_str)) ? 2 : 1;
my $len_if_added = $len + 2 + length($arg_name[$i]) + $adjust;

# Wrap lines that will be longer than the limit
if ($len_if_added > $max_trace_macro_line_len) {
# Wrap line, with indention
$trace .= ",\n ";
$len = 13; # Set to 13, for indention
Expand All @@ -317,8 +340,11 @@ sub rewrite_func ($$$$$) {
}

# Append argument
$trace .= "$_";
$len += length; # Add length of appended argument name
$trace .= "$arg_name[$i]";
$argtrace .= ", $arg_name[$i]";

# Add length of appended argument name
$len += length($arg_name[$i]);
}

# Append final ');' for macro
Expand Down
18 changes: 0 additions & 18 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,9 @@
optimization operation */
#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@

/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@

/* Define to 1 if you have the `ioctl' function. */
#cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@

/* Define to 1 if you have the <io.h> header file. */
#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@

/* Define to 1 if you have the `crypto' library (-lcrypto). */
#cmakedefine H5_HAVE_LIBCRYPTO @H5_HAVE_LIBCRYPTO@

Expand Down Expand Up @@ -358,18 +352,9 @@
/* Define if `struct stat' has the `st_blocks' field */
#cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@

/* Define to 1 if you have the <stdbool.h> header file. */
#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@

/* Define to 1 if you have the <stddef.h> header file. */
#cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@

/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@

/* Define to 1 if you have the <stdint.h> header file for Cplusplus. */
#cmakedefine H5_HAVE_STDINT_H_CXX @H5_HAVE_STDINT_H_CXX@

/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@

Expand Down Expand Up @@ -713,9 +698,6 @@
/* The size of `__int64', as computed by sizeof. */
#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@

/* Define to 1 if you have the ANSI C header files. */
#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@

/* Define if strict file format checks are enabled */
#cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@

Expand Down
29 changes: 3 additions & 26 deletions config/cmake_ext_mod/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,13 @@ CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)

# Windows
CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H)
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
endif ()

if (CMAKE_SYSTEM_NAME MATCHES "OSF")
CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H)
else ()
set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE)
set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE)
endif ()

CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
Expand All @@ -146,12 +136,9 @@ CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H)
CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H)
CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H)
CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H)
# _Bool type support
CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H)

## Check for non-standard extenstion quadmath.h

Expand Down Expand Up @@ -237,11 +224,6 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
endif ()
endmacro ()

#-----------------------------------------------------------------------------
# Check for these functions before the time headers are checked
#-----------------------------------------------------------------------------
HDF_FUNCTION_TEST (STDC_HEADERS)

#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -416,13 +398,9 @@ HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T)
# Extra C99 types
#-----------------------------------------------------------------------------

# _Bool type support
if (HAVE_STDBOOL_H)
set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL)
else ()
HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
endif ()
# Size of bool
set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)

if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -560,7 +538,6 @@ if (MINGW OR NOT WINDOWS)
foreach (other_test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
# STDC_HEADERS
HAVE_FUNCTION
HAVE_C99_DESIGNATED_INITIALIZER
SYSTEM_SCOPE_THREADS
Expand Down
8 changes: 0 additions & 8 deletions config/cmake_ext_mod/HDFTests.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ int main(void)
}
#endif

#ifdef STDC_HEADERS
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
int main() { return 0; }
#endif /* STDC_HEADERS */


#ifdef HAVE_ATTRIBUTE

Expand Down
11 changes: 0 additions & 11 deletions config/cmake_ext_mod/HDFUseCXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ endif ()
include (CheckIncludeFileCXX)
include (TestForSTDNamespace)

# IF the c compiler found stdint, check the C++ as well. On some systems this
# file will be found by C but not C++, only do this test IF the C++ compiler
# has been initialized (e.g. the project also includes some c++)
if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
endif ()
endif ()

# For other CXX specific tests, use this MACRO.
macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${OTHER_TEST})
Expand Down
53 changes: 13 additions & 40 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,6 @@ AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h])
AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h])
AC_CHECK_HEADERS([stddef.h setjmp.h features.h])
AC_CHECK_HEADERS([dirent.h])
AC_CHECK_HEADERS([stdint.h], [C9x=yes])
AC_CHECK_HEADERS([stdbool.h])
AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h])

## Darwin
Expand All @@ -1241,15 +1239,15 @@ esac
## Windows
case "`uname`" in
CYGWIN*)
AC_CHECK_HEADERS([io.h sys/timeb.h])
AC_CHECK_HEADERS([sys/timeb.h])
UNAME_CYGWIN="yes"
;;
MINGW*)
AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h])
AC_CHECK_HEADERS([winsock2.h sys/timeb.h])
AC_HAVE_LIBRARY([ws2_32])
;;
*)
AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h])
AC_CHECK_HEADERS([winsock2.h sys/timeb.h])
;;
esac

Expand Down Expand Up @@ -1340,16 +1338,15 @@ CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS"
## Checkpoint the cache
AC_CACHE_SAVE

## Posix.1g types (C9x)
## Write the confdefs.h header for checking sizes
cat >>confdefs.h <<\EOF
#include <sys/types.h>
EOF

if test "X$C9x" = "Xyes"; then
cat >>confdefs.h <<\EOF
#include <stdbool.h>
#include <stdint.h>
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#endif
#include <time.h>
EOF
fi

AC_CHECK_SIZEOF( [int8_t])
AC_CHECK_SIZEOF( [uint8_t])
Expand Down Expand Up @@ -1379,34 +1376,12 @@ AC_CHECK_SIZEOF([uint_least64_t])
AC_CHECK_SIZEOF( [int_fast64_t])
AC_CHECK_SIZEOF( [uint_fast64_t])

AC_CHECK_SIZEOF([bool])
AC_CHECK_SIZEOF([off_t])
AC_CHECK_SIZEOF([ptrdiff_t])
AC_CHECK_SIZEOF([size_t])
AC_CHECK_SIZEOF([ssize_t])
AC_CHECK_SIZEOF([ptrdiff_t])

cat >>confdefs.h <<\EOF
#include <sys/types.h> /*for off_t definition*/
EOF
AC_CHECK_SIZEOF([off_t])

if test "X$C9x" = "Xyes"; then
cat >>confdefs.h <<\EOF
#ifdef HAVE_STDBOOL_H
#include <stdbool.h> /* for bool definition */
#else
#define bool _Bool
#endif
EOF
AC_CHECK_SIZEOF([bool])
fi

AC_CHECK_SIZEOF(time_t, [], [
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
])
AC_CHECK_SIZEOF([time_t])

## Checkpoint the cache
AC_CACHE_SAVE
Expand Down Expand Up @@ -1911,10 +1886,8 @@ if test "X$THREADSAFE" = "Xyes"; then
AC_CACHE_VAL([hdf5_cv_system_scope_threads],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
#if STDC_HEADERS
#include <stdlib.h>
#include <pthread.h>
#endif
],[
pthread_attr_t attribute;
int ret;
Expand Down
43 changes: 43 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,49 @@ New Features

Library:
--------
- H5Gcreate1() now rejects size_hint parameters larger than UINT32_MAX

The size_hint value is ultimately stored in a uint32_t struct field,
so specifying a value larger than this on a 64-bit machine can cause
undefined behavior including crashing the system.

The documentation for this API call was also incorrect, stating that
passing a negative value would cause the library to use a default
value. Instead, passing a "negative" value actually passes a very large
value, which is probably not what the user intends and can cause
crashes on 64-bit systems.

The Doxygen documentation has been updated and passing values larger
than UINT32_MAX for size_hint will now produce a normal HDF5 error.

(DER - 2021/04/29, HDFFV-11241)


- H5Pset_fapl_log() no longer crashes when passed an invalid fapl ID

When passed an invalid fapl ID, H5Pset_fapl_log() would usually
segfault when attempting to free an uninitialized pointer in the error
handling code. This behavior is more common in release builds or
when the memory sanitization checks were not selected as a build
option.

The pointer is now correctly initialized and the API call now
produces a normal HDF5 error when fed an invalid fapl ID.

(DER - 2021/04/28, HDFFV-11240)

- Fixes a segfault when H5Pset_mdc_log_options() is called multiple times

The call incorrectly attempts to free an internal copy of the previous
log location string, which causes a segfault. This only happens
when the call is invoked multiple times on the same property list.
On the first call to a given fapl, the log location is set to NULL so
the segfault does not occur.

The string is now handled properly and the segfault no longer occurs.

(DER - 2021/04/27, HDFFV-11239)

- HSYS_GOTO_ERROR now emits the results of GetLastError() on Windows

HSYS_GOTO_ERROR is an internal macro that is used to produce error
Expand Down
4 changes: 2 additions & 2 deletions src/H5Dpublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
/*****************/

/* Macros used to "unset" chunk cache configuration parameters */
#define H5D_CHUNK_CACHE_NSLOTS_DEFAULT SIZE_MAX
#define H5D_CHUNK_CACHE_NBYTES_DEFAULT SIZE_MAX
#define H5D_CHUNK_CACHE_NSLOTS_DEFAULT ((size_t)-1)
#define H5D_CHUNK_CACHE_NBYTES_DEFAULT ((size_t)-1)
#define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0)

/* Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts() */
Expand Down
7 changes: 5 additions & 2 deletions src/H5FDlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,15 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sULz", fapl_id, logfile, flags, buf_size);

/* Do this first, so that we don't try to free a wild pointer if
* H5P_object_verify() fails.
*/
HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));

/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")

HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));

/* Duplicate the log file string
* A little wasteful, since this string will just be copied later, but
* passing it in as a pointer sets off a chain of impossible-to-resolve
Expand Down
Loading