From 601480003ffdee444d8e48aed4222ad8dd23bb59 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sat, 3 Oct 2020 17:53:15 +0200 Subject: [PATCH] Centralise fault handling This should be done as all platforms essentially did the same anyway and there was nothing platform specific. --- CRT.c | 112 ++++++++++++++++++++++++++++++--- CRT.h | 5 +- Makefile.am | 22 +++---- XAlloc.c | 2 +- darwin/DarwinCRT.c | 35 ----------- darwin/DarwinCRT.h | 14 ----- dragonflybsd/DragonFlyBSDCRT.c | 35 ----------- dragonflybsd/DragonFlyBSDCRT.h | 15 ----- freebsd/FreeBSDCRT.c | 21 ------- freebsd/FreeBSDCRT.h | 14 ----- linux/LinuxCRT.c | 41 ------------ linux/LinuxCRT.h | 14 ----- openbsd/OpenBSDCRT.c | 22 ------- openbsd/OpenBSDCRT.h | 15 ----- solaris/SolarisCRT.c | 33 ---------- solaris/SolarisCRT.h | 15 ----- unsupported/UnsupportedCRT.c | 21 ------- unsupported/UnsupportedCRT.h | 14 ----- 18 files changed, 115 insertions(+), 335 deletions(-) delete mode 100644 darwin/DarwinCRT.c delete mode 100644 darwin/DarwinCRT.h delete mode 100644 dragonflybsd/DragonFlyBSDCRT.c delete mode 100644 dragonflybsd/DragonFlyBSDCRT.h delete mode 100644 freebsd/FreeBSDCRT.c delete mode 100644 freebsd/FreeBSDCRT.h delete mode 100644 linux/LinuxCRT.c delete mode 100644 linux/LinuxCRT.h delete mode 100644 openbsd/OpenBSDCRT.c delete mode 100644 openbsd/OpenBSDCRT.h delete mode 100644 solaris/SolarisCRT.c delete mode 100644 solaris/SolarisCRT.h delete mode 100644 unsupported/UnsupportedCRT.c delete mode 100644 unsupported/UnsupportedCRT.h diff --git a/CRT.c b/CRT.c index 9159450b..a6e606ef 100644 --- a/CRT.c +++ b/CRT.c @@ -18,8 +18,13 @@ in the source distribution for its full text. #include #include #include -#ifdef HAVE_SETUID_ENABLED #include + +#ifdef HAVE_EXECINFO_H +#include +#endif + +#ifdef HAVE_SETUID_ENABLED #include #endif @@ -545,8 +550,6 @@ char* CRT_termType; int CRT_colorScheme = 0; -void *backtraceArray[128]; - ATTR_NORETURN static void CRT_handleSIGTERM(int sgn) { (void) sgn; @@ -591,9 +594,9 @@ void CRT_restorePrivileges() { #endif /* HAVE_SETUID_ENABLED */ -// TODO: pass an instance of Settings instead. +static struct sigaction old_sig_handler[32]; -struct sigaction old_sigsegv_handler; +// TODO: pass an instance of Settings instead. void CRT_init(int delay, int colorScheme, bool allowUnicode) { initscr(); @@ -650,9 +653,15 @@ void CRT_init(int delay, int colorScheme, bool allowUnicode) { struct sigaction act; sigemptyset (&act.sa_mask); - act.sa_flags = (int)SA_RESETHAND; + act.sa_flags = (int)SA_RESETHAND|SA_NODEFER; act.sa_handler = CRT_handleSIGSEGV; - sigaction (SIGSEGV, &act, &old_sigsegv_handler); + sigaction (SIGSEGV, &act, &old_sig_handler[SIGSEGV]); + sigaction (SIGFPE, &act, &old_sig_handler[SIGFPE]); + sigaction (SIGILL, &act, &old_sig_handler[SIGILL]); + sigaction (SIGBUS, &act, &old_sig_handler[SIGBUS]); + sigaction (SIGPIPE, &act, &old_sig_handler[SIGPIPE]); + sigaction (SIGSYS, &act, &old_sig_handler[SIGSYS]); + sigaction (SIGABRT, &act, &old_sig_handler[SIGABRT]); signal(SIGTERM, CRT_handleSIGTERM); signal(SIGQUIT, CRT_handleSIGTERM); @@ -740,3 +749,92 @@ void CRT_setColors(int colorScheme) { CRT_colors = CRT_colorSchemes[colorScheme]; } + +void CRT_handleSIGSEGV(int signal) { + CRT_done(); + + fprintf(stderr, "\n\n" + "FATAL PROGRAM ERROR DETECTED\n" + "============================\n" + "Please check at https://htop.dev/issues whether this issue has already been reported.\n" + "If no similar issue has been reported before, please create a new issue with the following information:\n" + "\n" + "- Your htop version (htop --version)\n" + "- Your OS and kernel version (uname -a)\n" + "- Your distribution and release (lsb_release -a)\n" + "- Likely steps to reproduce (How did it happened?)\n" +#ifdef HAVE_EXECINFO_H + "- Backtrace of the issue (see below)\n" +#endif + "\n" + ); + + const char* signal_str = strsignal(signal); + if(!signal_str) { + signal_str = "unknown reason"; + } + fprintf(stderr, + "Error information:\n" + "------------------\n" + "A signal %d (%s) was received.\n" + "\n", + signal, signal_str + ); + +#ifdef HAVE_EXECINFO_H + fprintf(stderr, + "Backtrace information:\n" + "----------------------\n" + "The following function calls were active when the issue was detected:\n" + "---\n" + ); + + void *backtraceArray[256]; + + size_t size = backtrace(backtraceArray, ARRAYSIZE(backtraceArray)); + backtrace_symbols_fd(backtraceArray, size, 2); + fprintf(stderr, + "---\n" + "\n" + "To make the above information more practical to work with,\n" + "you should provide a disassembly of your binary.\n" + "This can usually be done by running the following command:\n" + "\n" +#ifdef HTOP_DARWIN + " otool -tvV `which htop` > ~/htop.otool\n" +#else + " objdump -d -S -w `which htop` > ~/htop.objdump\n" +#endif + "\n" + "Please include the generated file in your report.\n" + "\n" + ); +#endif + + fprintf(stderr, + "Running this program with debug symbols or inside a debugger may provide further insights.\n" + "\n" + "Thank you for helping to improve htop!\n" + "\n" + "htop " VERSION " aborting.\n" + "\n" + ); + + /* Call old sigsegv handler; may be default exit or third party one (e.g. ASAN) */ + if(sigaction (signal, &old_sig_handler[signal], NULL) < 0) { + /* This avoids an infinite loop in case the handler could not be reset. */ + fprintf(stderr, + "!!! Chained handler could not be restored. Forcing exit.\n" + ); + _exit(1); + } + + /* Trigger the previous signal handler. */ + raise(signal); + + // Always terminate, even if installed handler returns + fprintf(stderr, + "!!! Chained handler did not exit. Forcing exit.\n" + ); + _exit(1); +} diff --git a/CRT.h b/CRT.h index 629a8097..5b0b7304 100644 --- a/CRT.h +++ b/CRT.h @@ -117,8 +117,7 @@ typedef enum ColorElements_ { void CRT_fatalError(const char* note) ATTR_NORETURN; -extern struct sigaction old_sigsegv_handler; -void CRT_handleSIGSEGV(int sgn); +void CRT_handleSIGSEGV(int signal) ATTR_NORETURN; #define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A')) @@ -147,8 +146,6 @@ extern char* CRT_termType; extern int CRT_colorScheme; -extern void *backtraceArray[128]; - #ifdef HAVE_SETUID_ENABLED void CRT_dropPrivileges(void); diff --git a/Makefile.am b/Makefile.am index f4618eb6..b6f0f975 100644 --- a/Makefile.am +++ b/Makefile.am @@ -124,7 +124,6 @@ linux_platform_headers = \ linux/IOPriority.h \ linux/LinuxProcess.h \ linux/LinuxProcessList.h \ - linux/LinuxCRT.h \ linux/Battery.h \ linux/PressureStallMeter.h \ zfs/ZfsArcMeter.h \ @@ -134,7 +133,7 @@ linux_platform_headers = \ if HTOP_LINUX AM_LDFLAGS += -rdynamic myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c \ -linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c \ +linux/LinuxProcess.c linux/LinuxProcessList.c linux/Battery.c \ linux/PressureStallMeter.c \ zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c @@ -148,7 +147,6 @@ freebsd_platform_headers = \ freebsd/Platform.h \ freebsd/FreeBSDProcessList.h \ freebsd/FreeBSDProcess.h \ - freebsd/FreeBSDCRT.h \ freebsd/Battery.h \ zfs/ZfsArcMeter.h \ zfs/ZfsCompressedArcMeter.h \ @@ -156,8 +154,9 @@ freebsd_platform_headers = \ zfs/openzfs_sysctl.h if HTOP_FREEBSD +AM_LDFLAGS += -lexecinfo myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \ -freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c \ +freebsd/FreeBSDProcess.c freebsd/Battery.c \ zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c zfs/openzfs_sysctl.c myhtopplatheaders = $(freebsd_platform_headers) @@ -170,13 +169,12 @@ dragonflybsd_platform_headers = \ dragonflybsd/Platform.h \ dragonflybsd/DragonFlyBSDProcessList.h \ dragonflybsd/DragonFlyBSDProcess.h \ - dragonflybsd/DragonFlyBSDCRT.h \ dragonflybsd/Battery.h if HTOP_DRAGONFLYBSD AM_LDFLAGS += -lkvm -lkinfo -lexecinfo myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \ -dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c +dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/Battery.c myhtopplatheaders = $(dragonflybsd_platform_headers) endif @@ -188,12 +186,11 @@ openbsd_platform_headers = \ openbsd/Platform.h \ openbsd/OpenBSDProcessList.h \ openbsd/OpenBSDProcess.h \ - openbsd/OpenBSDCRT.h \ openbsd/Battery.h if HTOP_OPENBSD myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \ -openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c +openbsd/OpenBSDProcess.c openbsd/Battery.c myhtopplatheaders = $(openbsd_platform_headers) endif @@ -205,7 +202,6 @@ darwin_platform_headers = \ darwin/Platform.h \ darwin/DarwinProcess.h \ darwin/DarwinProcessList.h \ - darwin/DarwinCRT.h \ darwin/Battery.h \ zfs/ZfsArcMeter.h \ zfs/ZfsCompressedArcMeter.h \ @@ -215,7 +211,7 @@ darwin_platform_headers = \ if HTOP_DARWIN AM_LDFLAGS += -framework IOKit -framework CoreFoundation myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \ -darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c \ +darwin/DarwinProcessList.c darwin/Battery.c \ zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c zfs/openzfs_sysctl.c myhtopplatheaders = $(darwin_platform_headers) @@ -228,7 +224,6 @@ solaris_platform_headers = \ solaris/Platform.h \ solaris/SolarisProcess.h \ solaris/SolarisProcessList.h \ - solaris/SolarisCRT.h \ solaris/Battery.h \ zfs/ZfsArcMeter.h \ zfs/ZfsCompressedArcMeter.h \ @@ -237,7 +232,7 @@ solaris_platform_headers = \ if HTOP_SOLARIS myhtopplatsources = solaris/Platform.c \ solaris/SolarisProcess.c solaris/SolarisProcessList.c \ -solaris/SolarisCRT.c solaris/Battery.c \ +solaris/Battery.c \ zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c myhtopplatheaders = $(solaris_platform_headers) @@ -250,13 +245,12 @@ unsupported_platform_headers = \ unsupported/Platform.h \ unsupported/UnsupportedProcess.h \ unsupported/UnsupportedProcessList.h \ - unsupported/UnsupportedCRT.h \ unsupported/Battery.h if HTOP_UNSUPPORTED myhtopplatsources = unsupported/Platform.c \ unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \ -unsupported/UnsupportedCRT.c unsupported/Battery.c +unsupported/Battery.c myhtopplatheaders = $(unsupported_platform_headers) endif diff --git a/XAlloc.c b/XAlloc.c index 20ddafc8..c832d087 100644 --- a/XAlloc.c +++ b/XAlloc.c @@ -14,7 +14,7 @@ void fail() { curs_set(1); endwin(); - err(1, NULL); + abort(); } void* xMalloc(size_t size) { diff --git a/darwin/DarwinCRT.c b/darwin/DarwinCRT.c deleted file mode 100644 index a4f0eb3f..00000000 --- a/darwin/DarwinCRT.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -htop - DarwinCRT.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "DarwinCRT.h" -#include "CRT.h" -#include -#include -#include - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - #ifdef __APPLE__ - fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at https://htop.dev\n"); - #ifdef HAVE_EXECINFO_H - size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); - fprintf(stderr, "\n Please include in your report the following backtrace: \n"); - backtrace_symbols_fd(backtraceArray, size, 2); - fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); - fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); - fprintf(stderr, "\n\n otool -tvV `which htop` > ~/htop.otool"); - fprintf(stderr, "\n\nand then attach the file ~/htop.otool to your bug report."); - fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); - #endif - #else - fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); - fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); - #endif - abort(); -} diff --git a/darwin/DarwinCRT.h b/darwin/DarwinCRT.h deleted file mode 100644 index 258fb68e..00000000 --- a/darwin/DarwinCRT.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HEADER_DarwinCRT -#define HEADER_DarwinCRT -/* -htop - DarwinCRT.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; - -#endif diff --git a/dragonflybsd/DragonFlyBSDCRT.c b/dragonflybsd/DragonFlyBSDCRT.c deleted file mode 100644 index ae8e7fec..00000000 --- a/dragonflybsd/DragonFlyBSDCRT.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -htop - dragonflybsd/DragonFlyBSDCRT.c -(C) 2014 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "DragonFlyBSDCRT.h" -#include "CRT.h" -#include -#include -#ifdef HAVE_EXECINFO_H -#include -#endif - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at https://htop.dev\n"); - #ifdef HAVE_EXECINFO_H - size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); - fprintf(stderr, "\n Please include in your report the following backtrace: \n"); - backtrace_symbols_fd(backtraceArray, size, 2); - fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); - fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); - fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump"); - fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report."); - fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); - #else - fprintf(stderr, "\nPlease contact your DragonFlyBSD package maintainer!\n\n"); - #endif - abort(); -} diff --git a/dragonflybsd/DragonFlyBSDCRT.h b/dragonflybsd/DragonFlyBSDCRT.h deleted file mode 100644 index 9a0fdbeb..00000000 --- a/dragonflybsd/DragonFlyBSDCRT.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_DragonFlyBSDCRT -#define HEADER_DragonFlyBSDCRT -/* -htop - dragonflybsd/DragonFlyBSDCRT.h -(C) 2014 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; - -#endif diff --git a/freebsd/FreeBSDCRT.c b/freebsd/FreeBSDCRT.c deleted file mode 100644 index e1024d30..00000000 --- a/freebsd/FreeBSDCRT.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -htop - FreeBSDCRT.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "FreeBSDCRT.h" -#include "CRT.h" -#include -#include - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - fprintf(stderr, "\n\nhtop " VERSION " aborting.\n"); - fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); - fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); - abort(); -} diff --git a/freebsd/FreeBSDCRT.h b/freebsd/FreeBSDCRT.h deleted file mode 100644 index af64cf10..00000000 --- a/freebsd/FreeBSDCRT.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HEADER_FreeBSDCRT -#define HEADER_FreeBSDCRT -/* -htop - FreeBSDCRT.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; - -#endif diff --git a/linux/LinuxCRT.c b/linux/LinuxCRT.c deleted file mode 100644 index 7bbb80e0..00000000 --- a/linux/LinuxCRT.c +++ /dev/null @@ -1,41 +0,0 @@ -/* -htop - LinuxCRT.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "LinuxCRT.h" -#include "CRT.h" - -#include -#include -#include -#ifdef HAVE_EXECINFO_H -#include -#endif - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - #ifdef __linux - fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at https://htop.dev\n"); - #ifdef HAVE_EXECINFO_H - size_t size = backtrace(backtraceArray, ARRAYSIZE(backtraceArray)); - fprintf(stderr, "\n Please include in your report the following backtrace: \n"); - backtrace_symbols_fd(backtraceArray, size, 2); - fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); - fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); - fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump"); - fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report."); - fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); - #endif - #else - fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); - fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); - #endif - - /* Call old sigsegv handler; may be default exit or third party one (e.g. ASAN) */ - sigaction (SIGSEGV, &old_sigsegv_handler, NULL); -} diff --git a/linux/LinuxCRT.h b/linux/LinuxCRT.h deleted file mode 100644 index d9263d66..00000000 --- a/linux/LinuxCRT.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HEADER_LinuxCRT -#define HEADER_LinuxCRT -/* -htop - LinuxCRT.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn); - -#endif diff --git a/openbsd/OpenBSDCRT.c b/openbsd/OpenBSDCRT.c deleted file mode 100644 index 88cb8e23..00000000 --- a/openbsd/OpenBSDCRT.c +++ /dev/null @@ -1,22 +0,0 @@ -/* -htop - OpenBSDCRT.c -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "OpenBSDCRT.h" -#include "CRT.h" -#include -#include - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - fprintf(stderr, "\n\nhtop " VERSION " aborting.\n"); - fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); - fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); - abort(); -} diff --git a/openbsd/OpenBSDCRT.h b/openbsd/OpenBSDCRT.h deleted file mode 100644 index 6259b78c..00000000 --- a/openbsd/OpenBSDCRT.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_OpenBSDCRT -#define HEADER_OpenBSDCRT -/* -htop - OpenBSDCRT.h -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; - -#endif diff --git a/solaris/SolarisCRT.c b/solaris/SolarisCRT.c deleted file mode 100644 index ef16aabc..00000000 --- a/solaris/SolarisCRT.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -htop - SolarisCRT.c -(C) 2014 Hisham H. Muhammad -(C) 2018 Guy M. Broome -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "SolarisCRT.h" -#include "CRT.h" -#include -#include -#ifdef HAVE_EXECINFO_H -#include -#endif - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at https://htop.dev\n"); - #ifdef HAVE_EXECINFO_H - size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); - fprintf(stderr, "\n Please include in your report the following backtrace: \n"); - backtrace_symbols_fd(backtraceArray, size, 2); - fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); - fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); - fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump"); - fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report."); - fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); - #endif - abort(); -} diff --git a/solaris/SolarisCRT.h b/solaris/SolarisCRT.h deleted file mode 100644 index aa8c81bb..00000000 --- a/solaris/SolarisCRT.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_SolarisCRT -#define HEADER_SolarisCRT -/* -htop - SolarisCRT.h -(C) 2014 Hisham H. Muhammad -(C) 2018 Guy M. Broome -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; - -#endif diff --git a/unsupported/UnsupportedCRT.c b/unsupported/UnsupportedCRT.c deleted file mode 100644 index 5ee076cd..00000000 --- a/unsupported/UnsupportedCRT.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -htop - UnsupportedCRT.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" -#include "UnsupportedCRT.h" -#include "CRT.h" -#include -#include - -void CRT_handleSIGSEGV(int sgn) { - (void) sgn; - CRT_done(); - fprintf(stderr, "\n\nhtop " VERSION " aborting.\n"); - fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); - fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); - abort(); -} diff --git a/unsupported/UnsupportedCRT.h b/unsupported/UnsupportedCRT.h deleted file mode 100644 index f89d787c..00000000 --- a/unsupported/UnsupportedCRT.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HEADER_UnsupportedCRT -#define HEADER_UnsupportedCRT -/* -htop - UnsupportedCRT.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Macros.h" - -void CRT_handleSIGSEGV(int sgn) ATTR_NORETURN; - -#endif