From 0f30852242d906cb21d0246b3e68527f608d4d84 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 9 Nov 2022 09:22:14 -0800 Subject: Removes dmalloc support (#2239) This has not been used to debug the library in a very long time. Most developers use valgrind, -fsanitize=address, or some other memory checker instead of this library. This removes: * dmalloc.h include from H5private.h * --with-dmalloc= Autotools configure option * HDF5_ENABLE_USING_DMALLOC CMake option --- CMakeLists.txt | 9 ---- config/cmake/H5pubconf.h.in | 6 --- config/cmake/libhdf5.settings.cmake.in | 1 - configure.ac | 77 ---------------------------------- release_docs/RELEASE.txt | 13 ++++++ src/H5private.h | 7 ---- src/libhdf5.settings.in | 1 - 7 files changed, 13 insertions(+), 101 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1148f2d..31cae2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -544,15 +544,6 @@ if (HDF5_ENABLE_COVERAGE) endif () #----------------------------------------------------------------------------- -# Option to indicate using dmalloc -#----------------------------------------------------------------------------- -# option (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) -# if (HDF5_ENABLE_USING_DMALLOC) -# find_package (DMALLOC) -# set (H5_HAVE_DMALLOC DMALLOC_FOUND) -# endif () - -#----------------------------------------------------------------------------- # Option to indicate using a memory checker #----------------------------------------------------------------------------- option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 70813ac..2eb4005 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -119,9 +119,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_DLFCN_H @H5_HAVE_DLFCN_H@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_DMALLOC_H @H5_HAVE_DMALLOC_H@ - /* Define if library information should be embedded in the executables */ #cmakedefine H5_HAVE_EMBEDDED_LIBINFO @H5_HAVE_EMBEDDED_LIBINFO@ @@ -192,9 +189,6 @@ /* Define to 1 if you have the `dl' library (-ldl). */ #cmakedefine H5_HAVE_LIBDL @H5_HAVE_LIBDL@ -/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ -#cmakedefine H5_HAVE_LIBDMALLOC @H5_HAVE_LIBDMALLOC@ - /* Proceed to build with libhdfs */ #cmakedefine H5_HAVE_LIBHDFS @H5_HAVE_LIBHDFS@ diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 49caf83..85f8842 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -83,7 +83,6 @@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@ Subfiling VFD: @H5_HAVE_SUBFILING_VFD@ (Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@ (Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@ - dmalloc: @H5_HAVE_LIBDMALLOC@ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@ API Tracing: @HDF5_ENABLE_TRACE@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ diff --git a/configure.ac b/configure.ac index fed9ca7..c12c0f2 100644 --- a/configure.ac +++ b/configure.ac @@ -1537,83 +1537,6 @@ AC_ARG_WITH([fnord], ]) ## ---------------------------------------------------------------------- -## Is dmalloc (debug malloc library) requested? It has a header file -## `dmalloc.h' and a library `-ldmalloc' and their locations might be -## specified with the `--with-dmalloc' command-line switch. The value -## is an include path and/or a library path. If the library path is -## specified then it must be preceded by a comma. -## -AC_SUBST([HAVE_DMALLOC]) - -## Default is not present -HAVE_DMALLOC=no - -AC_ARG_WITH([dmalloc], - [AS_HELP_STRING([--with-dmalloc=DIR], - [Use dmalloc memory debugging aid [default=no]])],, - [withval=no]) - -case "X-$withval" in - X-yes) - HAVE_DMALLOC="yes" - AC_CHECK_HEADERS([dmalloc.h],, [unset HAVE_DMALLOC]) - if test "x$HAVE_DMALLOC" = "xyes"; then - AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC]) - fi - if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find dmalloc library]) - fi - ;; - X-|X-no|X-none) - HAVE_DMALLOC="no" - AC_MSG_CHECKING([for dmalloc library]) - AC_MSG_RESULT([suppressed]) - ;; - *) - HAVE_DMALLOC="yes" - case "$withval" in - *,*) - dmalloc_inc="`echo $withval |cut -f1 -d,`" - dmalloc_lib="`echo $withval |cut -f2 -d, -s`" - ;; - *) - if test -n "$withval"; then - dmalloc_inc="$withval/include" - dmalloc_lib="$withval/lib" - fi - ;; - esac - - saved_CPPFLAGS="$CPPFLAGS" - saved_AM_CPPFLAGS="$AM_CPPFLAGS" - saved_LDFLAGS="$LDFLAGS" - saved_AM_LDFLAGS="$AM_LDFLAGS" - - if test -n "$dmalloc_inc"; then - CPPFLAGS="$CPPFLAGS -I$dmalloc_inc" - AM_CPPFLAGS="$AM_CPPFLAGS -I$dmalloc_inc" - fi - - AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_DMALLOC]) - - if test "x$HAVE_DMALLOC" = "xyes"; then - if test -n "$dmalloc_lib"; then - LDFLAGS="$LDFLAGS -L$dmalloc_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" - fi - - AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC]) - fi - - if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find dmalloc library]) - fi - ;; -esac - - - -## ---------------------------------------------------------------------- ## Make the external filters list available to *.in files ## At this point it's unset (no external filters by default) but it ## will be filled in during the deflate (zlib) and szip processing diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e435cae..ba79997 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,19 @@ New Features Configuration: ------------- + - Removal of dmalloc support + + The ability to build with dmalloc support has been removed along with + the following configure options: + + Autotools: + --with-dmalloc= + + CMake: + HDF5_ENABLE_USING_DMALLOC + + (DER - 2022/11/08) + - Removal of memory allocation sanity checks configure options With the removal of the memory allocation sanity checks feature, the diff --git a/src/H5private.h b/src/H5private.h index 6afbc17..2ed55bb 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -210,13 +210,6 @@ #endif /* H5_HAVE_MPE */ /* - * dmalloc (debugging malloc) support - */ -#ifdef H5_HAVE_DMALLOC_H -#include "dmalloc.h" -#endif /* H5_HAVE_DMALLOC_H */ - -/* * NT doesn't define SIGBUS, but since NT only runs on processors * that do not have alignment constraints a SIGBUS would never be * raised, so we just replace it with SIGILL (which also should diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index dbdbc74..73135aa 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -86,7 +86,6 @@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@ Subfiling VFD: @SUBFILING_VFD@ (Read-Only) S3 VFD: @ROS3_VFD@ (Read-Only) HDFS VFD: @HAVE_LIBHDFS@ - dmalloc: @HAVE_DMALLOC@ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@ API tracing: @TRACE_API@ Using memory checker: @USINGMEMCHECKER@ -- cgit v0.12