Skip to content

Commit

Permalink
Removed "function/code stack" debugging configure option (HDFGroup#4454)
Browse files Browse the repository at this point in the history
Easily replaced w/third-party tools, e.g. libbacktrace
(https://github.com/ianlancetaylor/libbacktrace)
  • Loading branch information
qkoziol authored and lrknox committed May 7, 2024
1 parent 72c6b0c commit 40e877a
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 883 deletions.
2 changes: 0 additions & 2 deletions bin/trace
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,12 @@ sub rewrite_func ($$$$$) {
# First remove:
# * /*in*/, /*out*/, /*in_out*/, and /*in,out*/ comments
# * preprocessor lines that start with #
# * H5FL_TRACKING_PARAMS macros (free list code only)
#
# then split the function arguments on commas
$args =~ s/\/\*\s*in\s*\*\///g; # Get rid of /*in*/
$args =~ s/\/\*\s*out\s*\*\///g; # Get rid of /*out*/
$args =~ s/\/\*\s*in,\s*out\s*\*\///g; # Get rid of /*in,out*/
$args =~ s/\/\*\s*in_out\s*\*\///g; # Get rid of /*in_out*/
$args =~ s/H5FL_TRACK_PARAMS//g; # Remove free list macro
$args =~ s/\n#.*?\n/\n/g; # Remove lines beginning with '#'
my @args = split /,[\s\n]*/, $args;
my $argno = 0;
Expand Down
10 changes: 0 additions & 10 deletions config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,6 @@ if (HDF5_WANT_DCONV_EXCEPTION)
endif ()
MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION)

# ----------------------------------------------------------------------
# Check if they would like the function stack support compiled in
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF)
mark_as_advanced (HDF5_ENABLE_CODESTACK)
if (HDF5_ENABLE_CODESTACK)
set (${HDF_PREFIX}_HAVE_CODESTACK 1)
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK)

# ----------------------------------------------------------------------
# Check if they would like to show all warnings (not suppressed internally)
#-----------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@
/* Define to 1 if CLOCK_MONOTONIC_COARSE is available */
#cmakedefine H5_HAVE_CLOCK_MONOTONIC_COARSE @H5_HAVE_CLOCK_MONOTONIC_COARSE@

/* Define if the function stack tracing code is to be compiled in */
#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@

/* Define to 1 if you have the <curl/curl.h> header file. */
#cmakedefine H5_HAVE_CURL_CURL_H @H5_HAVE_CURL_H@

Expand Down
13 changes: 1 addition & 12 deletions config/cmake/HDF5DeveloperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,6 @@ if (HDF5_ENABLE_DEBUG_H5C_SANITY_CHECKS)
# list (APPEND HDF5_DEBUG_APIS H5C_DO_MEMORY_SANITY_CHECKS=1)
endif ()

option (HDF5_ENABLE_DEBUG_H5FL_TRACK "Enable tracking of free list allocations" OFF)
mark_as_advanced (HDF5_ENABLE_DEBUG_H5FL_TRACK)
if (HDF5_ENABLE_DEBUG_H5FL_TRACK)
list (APPEND HDF5_DEBUG_APIS H5FL_TRACK)

# Free list tracking requires the codestack functionality
set (HDF5_ENABLE_CODESTACK ON CACHE BOOL "Enable the function stack tracing (for developer debugging)." FORCE)
else ()
unset (HDF5_ENABLE_CODESTACK CACHE)
endif ()

option (HDF5_ENABLE_DEBUG_H5FS_ASSERT "Enable extra debugging of H5FS module" OFF)
mark_as_advanced (HDF5_ENABLE_DEBUG_H5FS_ASSERT)
if (HDF5_ENABLE_DEBUG_H5FS_ASSERT)
Expand All @@ -178,7 +167,7 @@ endif ()
# free lists entirely for developer build modes, as they can
# make certain types of issues (like references to stale pointers)
# much more difficult to debug
if (NOT HDF5_ENABLE_DEBUG_H5FL AND NOT HDF5_ENABLE_DEBUG_H5FL_TRACK)
if (NOT HDF5_ENABLE_DEBUG_H5FL)
list (APPEND HDF5_DEVELOPER_DEFS H5_NO_FREE_LISTS)
endif ()

Expand Down
1 change: 0 additions & 1 deletion config/cmake/libhdf5.settings.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@
Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
API Tracing: @HDF5_ENABLE_TRACE@
Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@
Function Stack Tracing: @HDF5_ENABLE_CODESTACK@
Use file locking: @HDF5_FILE_LOCKING_SETTING@
Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@
Optimization Instrumentation: @HDF5_Enable_Instrument@
34 changes: 0 additions & 34 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2885,40 +2885,6 @@ if test -n "$DEBUG_PKG_LIST"; then
done
fi

## ----------------------------------------------------------------------
## Check if they would like the function stack support compiled in
##
AC_MSG_CHECKING([whether function stack tracking is enabled])
AC_ARG_ENABLE([codestack],
[AS_HELP_STRING([--enable-codestack],
[Enable the function stack tracing (for developer debugging).
[default=no]
])],
[CODESTACK=$enableval])

## Set the default level.
if test "X-$CODESTACK" = X- ; then
CODESTACK=no
fi

## Allow this variable to be substituted in
## other files (src/libhdf5.settings.in, etc.)
AC_SUBST([CODESTACK])

case "X-$CODESTACK" in
X-yes)
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_CODESTACK], [1],
[Define if the function stack tracing code is to be compiled in])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_ERROR([Unrecognized value: $CODESTACK])
;;
esac

## ----------------------------------------------------------------------
## Enable tracing of the API
##
Expand Down
1 change: 0 additions & 1 deletion release_docs/INSTALL_CMake.txt
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,6 @@ HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming."
HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF
HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF
HDF5_SHOW_ALL_WARNINGS "Show all warnings (i.e. not suppress "noisy" ones internally)" OFF
HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF
HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF
HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF
HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON
Expand Down
10 changes: 10 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ New Features

Configuration:
-------------
- Removed "function/code stack" debugging configuration option:

CMake: HDF5_ENABLE_CODESTACK
Autotools: --enable-codestack

This was used to debug memory leaks internal to the library, but has been
broken for >1.5 years and is now easily replaced with third-party tools
(e.g. libbacktrace: https://github.com/ianlancetaylor/libbacktrace) on an
as-needed basis when debugging an issue.

- Added configure options for enabling/disabling non-standard programming
language features

Expand Down
11 changes: 0 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ set (H5C_HDRS
IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SOURCES}" )


set (H5CS_SOURCES
${HDF5_SRC_DIR}/H5CS.c
)
set (H5CS_HDRS
)
IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SOURCES}" )


set (H5CX_SOURCES
${HDF5_SRC_DIR}/H5CX.c
)
Expand Down Expand Up @@ -777,7 +769,6 @@ set (common_SRCS
${H5B_SOURCES}
${H5B2_SOURCES}
${H5C_SOURCES}
${H5CS_SOURCES}
${H5CX_SOURCES}
${H5D_SOURCES}
${H5E_SOURCES}
Expand Down Expand Up @@ -872,8 +863,6 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Cpkg.h
${HDF5_SRC_DIR}/H5Cprivate.h

${HDF5_SRC_DIR}/H5CSprivate.h

${HDF5_SRC_DIR}/H5CXprivate.h

${HDF5_SRC_DIR}/H5Dpkg.h
Expand Down
Loading

0 comments on commit 40e877a

Please sign in to comment.