Skip to content

Commit

Permalink
Disable memory alloc sanity checks by default for Autotools debug bui…
Browse files Browse the repository at this point in the history
…lds (HDFGroup#1468)
  • Loading branch information
jhendersonHDF committed Apr 13, 2022
1 parent 6e4feb5 commit b9fc873
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
17 changes: 9 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2782,9 +2782,11 @@ AC_ARG_ENABLE([memory-alloc-sanity-check],
[Enable this option to turn on internal memory
allocation sanity checking. This could cause
more memory use and somewhat slower allocation.
This option is orthogonal to the
--enable-using-memchecker option.
[default=yes if debug build, otherwise no]
This option may also cause issues with HDF5
filter plugins, so should not be enabled if
filters are to be used. This option is orthogonal
to the --enable-using-memchecker option.
[default=no]
])],
[MEMORYALLOCSANITYCHECK=$enableval])

Expand All @@ -2794,11 +2796,10 @@ AC_SUBST([MEMORYALLOCSANITYCHECK])

## Set default
if test "X-$MEMORYALLOCSANITYCHECK" = X- ; then
if test "X-$BUILD_MODE" = "X-debug" ; then
MEMORYALLOCSANITYCHECK=yes
else
MEMORYALLOCSANITYCHECK=no
fi
# Should consider enabling this option by default for
# 'developer' builds if that build mode is added in
# the future
MEMORYALLOCSANITYCHECK=no
fi

case "X-$MEMORYALLOCSANITYCHECK" in
Expand Down
19 changes: 19 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@ New Features

(ADB - 2022/03/11)

- HDF5 memory allocation sanity checking is now off by default for
Autotools debug builds

HDF5 can be configured to perform sanity checking on internal memory
allocations by adding heap canaries to these allocations. However,
enabling this option can cause issues with external filter plugins
when working with (reallocating/freeing/allocating and passing back)
buffers.

Previously, this option was off by default for all CMake build types,
but only off by default for non-debug Autotools builds. Since debug
is the default build mode for HDF5 when built from source with
Autotools, this can result in surprising segfaults that don't occur
when an application is built against a release version of HDF5.
Therefore, this option is now off by default for all build types
across both CMake and Autotools.

(JTH - 2022/03/01)

- Refactored the utils folder.

Added subfolder test and moved the 'swmr_check_compat_vfd.c file'
Expand Down

0 comments on commit b9fc873

Please sign in to comment.