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

Remove the execinfo capability #2789

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This file contains a high-level description of this package's evolution. Release

## 4.9.3 - TBD


* Remove the use of execinfo to programmatically dump the stack; it never worked. See [Github #2789](https://github.com/Unidata/netcdf-c/pull/2789).
* Update the internal copy of tinyxml2 to latest code. See [Github #2771](https://github.com/Unidata/netcdf-c/pull/2771).
* Mitigate the problem of remote/nczarr-related test interference. See [Github #2755](https://github.com/Unidata/netcdf-c/pull/2755).
* Fix DAP2 proxy problems. See [Github #2764](https://github.com/Unidata/netcdf-c/pull/2764).
Expand Down
3 changes: 0 additions & 3 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,6 @@ with zip */
/* if true, HDF5 is at least version 1.10.5 and supports UTF8 paths */
#cmakedefine HDF5_UTF8_PATHS 1

/* if true, backtrace support will be used. */
#cmakedefine HAVE_EXECINFO_H 1

/* if true, include JNA bug fix */
#cmakedefine JNA 1

Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,6 @@ AC_CHECK_HEADERS([sys/resource.h])
# See if we have ftw.h to walk directory trees
AC_CHECK_HEADERS([ftw.h])

# See if we can do stack tracing programmatically
AC_CHECK_HEADERS([execinfo.h])

# Check for these functions...
AC_CHECK_FUNCS([strlcat snprintf strcasecmp fileno \
strdup strtoll strtoull \
Expand Down
32 changes: 0 additions & 32 deletions libdispatch/nclog.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include <unistd.h>
#endif

#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif

#include "netcdf.h"
#include "nclog.h"

Expand Down Expand Up @@ -278,10 +274,6 @@ ncuntrace(const char* fcn, int err, const char* fmt, ...)
vfprintf(nclog_global.nclogstream, fmt, args);
fprintf(nclog_global.nclogstream, "\n" );
fflush(nclog_global.nclogstream);
#ifdef HAVE_EXECINFO_H
if(err != 0)
ncbacktrace();
#endif
}
done:
va_end(args);
Expand All @@ -304,28 +296,4 @@ ncbreakpoint(int err)
return err;
}

#ifdef HAVE_EXECINFO_H
#define MAXSTACKDEPTH 100
void
ncbacktrace(void)
{
int j, nptrs;
void* buffer[MAXSTACKDEPTH];
char **strings;

if(getenv("NCBACKTRACE") == NULL) return;
nptrs = backtrace(buffer, MAXSTACKDEPTH);
strings = backtrace_symbols(buffer, nptrs);
if (strings == NULL) {
perror("backtrace_symbols");
errno = 0;
return;
}
fprintf(stderr,"Backtrace:\n");
for(j = 0; j < nptrs; j++)
fprintf(stderr,"%s\n", strings[j]);
free(strings);
}
#endif

/**@}*/
28 changes: 0 additions & 28 deletions libhdf5/hdf5debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,9 @@

#ifdef H5CATCH

#define STSIZE 1000

#ifdef HAVE_EXECINFO_H
#ifdef H5BACKTRACE
# if !defined _WIN32 && !defined __CYGWIN__
static void* stacktrace[STSIZE];
# endif
#endif
#endif

int
nch5breakpoint(int err)
{
#ifdef HAVE_EXECINFO_H
#ifdef H5BACKTRACE
# if !defined _WIN32 && !defined __CYGWIN__
int count = 0;
char** trace = NULL;
int i;

count = backtrace(stacktrace,STSIZE);
trace = backtrace_symbols(stacktrace, STSIZE);
fprintf(stderr,"backtrace:\n");
for(i=0;i<count;i++)
fprintf(stderr,"[%03d] %s\n",i,trace[i]);
# if 0
if(trace != NULL) free(trace);
# endif
# endif
#endif
#endif
return ncbreakpoint(err);
}

Expand Down