From 7a34fe2e0f29c1c3f2bf259c524cbe44351e3b11 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 15 Mar 2013 10:55:36 -0600 Subject: [PATCH 01/56] - Build tests with -fno-builtin --- memstomp-testsuite.patch | 4 ++-- memstomp.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/memstomp-testsuite.patch b/memstomp-testsuite.patch index fbd9c12..7e63d12 100644 --- a/memstomp-testsuite.patch +++ b/memstomp-testsuite.patch @@ -669,7 +669,7 @@ diff -Nrup a/testsuite/memstomp.overlap/wmempcpy.c b/testsuite/memstomp.overlap/ + + set src [lindex $sources 0] + -+ if {[catch {exec gcc $src} results]} { ++ if {[catch {exec gcc -fno-builtin $src} results]} { + fail "$src compilation $results" + } else { + pass "$src compilation $results" @@ -728,7 +728,7 @@ diff -Nrup a/testsuite/memstomp.overlap/wmempcpy.c b/testsuite/memstomp.overlap/ + global memstomp + set src [lindex $sources 0] + -+ if {[catch {exec gcc $src} results]} { ++ if {[catch {exec gcc -fno-builtin $src} results]} { + fail "$src compilation $results" + } else { + pass "$src compilation $results" diff --git a/memstomp.spec b/memstomp.spec index d1b8bbe..8891884 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -53,6 +53,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri Mar 15 2013 Jeff Law 0.1.4-4 +- Build tests with -fno-builtin + * Mon Mar 11 2013 Jeff Law 0.1.4-4 - Add manpage - Add initial testsuite From cbbad87e5b849a7132a2ebf58ab1f31cbeecd224 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 15 Mar 2013 10:55:36 -0600 Subject: [PATCH 02/56] - Build tests with -fno-builtin --- memstomp-testsuite.patch | 4 ++-- memstomp.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/memstomp-testsuite.patch b/memstomp-testsuite.patch index fbd9c12..7e63d12 100644 --- a/memstomp-testsuite.patch +++ b/memstomp-testsuite.patch @@ -669,7 +669,7 @@ diff -Nrup a/testsuite/memstomp.overlap/wmempcpy.c b/testsuite/memstomp.overlap/ + + set src [lindex $sources 0] + -+ if {[catch {exec gcc $src} results]} { ++ if {[catch {exec gcc -fno-builtin $src} results]} { + fail "$src compilation $results" + } else { + pass "$src compilation $results" @@ -728,7 +728,7 @@ diff -Nrup a/testsuite/memstomp.overlap/wmempcpy.c b/testsuite/memstomp.overlap/ + global memstomp + set src [lindex $sources 0] + -+ if {[catch {exec gcc $src} results]} { ++ if {[catch {exec gcc -fno-builtin $src} results]} { + fail "$src compilation $results" + } else { + pass "$src compilation $results" diff --git a/memstomp.spec b/memstomp.spec index d1b8bbe..8891884 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -53,6 +53,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri Mar 15 2013 Jeff Law 0.1.4-4 +- Build tests with -fno-builtin + * Mon Mar 11 2013 Jeff Law 0.1.4-4 - Add manpage - Add initial testsuite From 4efbb3b54423aa65e8a2fb2679d91fb7ec1ead4f Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 9 May 2013 22:26:19 -0600 Subject: [PATCH 03/56] Fix typo in initialization message (#961495) --- memstomp-rh961495.patch | 12 ++++++++++++ memstomp.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 memstomp-rh961495.patch diff --git a/memstomp-rh961495.patch b/memstomp-rh961495.patch new file mode 100644 index 0000000..49b7345 --- /dev/null +++ b/memstomp-rh961495.patch @@ -0,0 +1,12 @@ +diff -Nrup a/memstomp.c b/memstomp.c +--- a/memstomp.c 2011-03-30 21:27:19.000000000 -0600 ++++ b/memstomp.c 2013-05-09 22:23:39.210837345 -0600 +@@ -174,7 +174,7 @@ static void setup(void) { + initialized = true; + + char prname[17]; +- fprintf(stderr, "memstomp: "PACKAGE_VERSION" sucessfully initialized for process %s (pid %lu).\n", ++ fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n", + get_prname(prname), (unsigned long) getpid()); + } + diff --git a/memstomp.spec b/memstomp.spec index 8891884..97e0b9c 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -20,6 +20,7 @@ BuildRequires: binutils-devel autoconf automake dejagnu Patch0: memstomp-testsuite.patch Patch1: memstomp-man.patch +Patch2: memstomp-rh961495.patch %description @@ -34,6 +35,7 @@ overlapping memory arguments to certain library calls. %setup -q -n %{name}-%{version}-%{githash} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build @@ -53,6 +55,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu May 09 2013 Jeff Law 0.1.4-5 +- Fix typo in initialization message (#961495) + * Fri Mar 15 2013 Jeff Law 0.1.4-4 - Build tests with -fno-builtin From 02e626533559965eb9d44de391c4e82c138d15b6 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 9 May 2013 22:26:19 -0600 Subject: [PATCH 04/56] Fix typo in initialization message (#961495) --- memstomp-rh961495.patch | 12 ++++++++++++ memstomp.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 memstomp-rh961495.patch diff --git a/memstomp-rh961495.patch b/memstomp-rh961495.patch new file mode 100644 index 0000000..49b7345 --- /dev/null +++ b/memstomp-rh961495.patch @@ -0,0 +1,12 @@ +diff -Nrup a/memstomp.c b/memstomp.c +--- a/memstomp.c 2011-03-30 21:27:19.000000000 -0600 ++++ b/memstomp.c 2013-05-09 22:23:39.210837345 -0600 +@@ -174,7 +174,7 @@ static void setup(void) { + initialized = true; + + char prname[17]; +- fprintf(stderr, "memstomp: "PACKAGE_VERSION" sucessfully initialized for process %s (pid %lu).\n", ++ fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n", + get_prname(prname), (unsigned long) getpid()); + } + diff --git a/memstomp.spec b/memstomp.spec index 8891884..97e0b9c 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -20,6 +20,7 @@ BuildRequires: binutils-devel autoconf automake dejagnu Patch0: memstomp-testsuite.patch Patch1: memstomp-man.patch +Patch2: memstomp-rh961495.patch %description @@ -34,6 +35,7 @@ overlapping memory arguments to certain library calls. %setup -q -n %{name}-%{version}-%{githash} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build @@ -53,6 +55,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu May 09 2013 Jeff Law 0.1.4-5 +- Fix typo in initialization message (#961495) + * Fri Mar 15 2013 Jeff Law 0.1.4-4 - Build tests with -fno-builtin From adcfaf979267ba032c07319efa142e21959c83d0 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 10 May 2013 17:55:35 -0600 Subject: [PATCH 05/56] Improve man page (#961518) --- memstomp-man.patch | 81 +++++++++++++++++++++++++++++++++++++--------- memstomp.spec | 5 ++- 2 files changed, 70 insertions(+), 16 deletions(-) diff --git a/memstomp-man.patch b/memstomp-man.patch index d06462f..b6839f6 100644 --- a/memstomp-man.patch +++ b/memstomp-man.patch @@ -9,25 +9,76 @@ CLEANFILES = \ memstomp ---- /dev/null 2013-02-26 15:11:24.372721019 -0700 -+++ b/memstomp.man 2013-03-11 21:54:06.847082615 -0600 -@@ -0,0 +1,19 @@ +diff -Nrup a/memstomp.man b/memstomp.man +--- a/memstomp.man 1969-12-31 17:00:00.000000000 -0700 ++++ b/memstomp.man 2013-05-10 17:53:37.767722170 -0600 +@@ -0,0 +1,69 @@ +.\" This is a comment +.\" Contact Owen@thelinuxblog.com -+.TH memstomp 1 "05 February 2013" ".1" "memstomp" ++.TH MEMSTOMP 1 "09 April 2013" "0.1.4" +.SH NAME -+memstomp ++memstomp \- detect function calls with overlapping memory regions +.SH SYNOPSIS -+memstomp [OPTIONS...] APPLICATION [ARGUMENTS...] ++.B memstomp ++.RB [ \-dk ] ++.I application ++.RI [ argument ...] ++.PP ++.B memstomp ++.B \-h +.SH DESCRIPTION -+memstomp can help detect memory argument overlaps to various mem* and str* functions. ++The ++.B memstomp ++utility identifies function calls that use overlapping memory regions in situations when such an overlap is not allowed by various standards. When a problem is detected, memstomp displays a backtrace to help you debug the problem, and if executed with the ++.B \-\-debug\-info ++command line option, it even uses the available debugging information. Since the backtrace code is not thread safe, memstomp also allows you to use the ++.B \-\-kill ++option to immediately terminate the analyzed program when an invalid function call is detected. ++.PP ++This version of memstomp inspects the following function calls: ++.BR memcpy (), ++.BR memccpy (), ++.BR mempcpy (), ++.BR strcpy (), ++.BR stpcpy (), ++.BR strncpy (), ++.BR stpncpy (), ++.BR strcat (), ++.BR strncat (), ++.BR wmemcpy (), ++.BR wmempcpy (), ++.BR wcscpy (), ++.BR wcsncpy (), ++.BR wcscat (), ++and ++.BR wcsncat (). +.SH OPTIONS -+-h, --help Show help -+ -+-d, --debug-info Make use of debug information in stack traces -+ -+-k, --kill Kill application when problem is detected -+ ++.TP ++.BR \-d ", " \-\-debug\-info ++Make use of debugging information to produce more detailed stack traces. ++.TP ++.BR \-k ", " \-\-kill ++Kill the analyzed application when a problem is detected. ++.TP ++.BR \-h ", " \-\-help ++Display usage information and exit. +.SH SEE ALSO -+.SH BUGS -+ ++.BR memcpy (3), ++.BR memccpy (3), ++.BR mempcpy (3), ++.BR strcpy (3), ++.BR stpcpy (3), ++.BR strncpy (3), ++.BR stpncpy (3), ++.BR strcat (3), ++.BR strncat (3), ++.BR wmemcpy (3), ++.BR wmempcpy (3), ++.BR wcscpy (3), ++.BR wcsncpy (3), ++.BR wcscat (3), ++.BR wcsncat (3) ++.SH AUTHORS ++Lennart Poettering ++.br ++William Cohen diff --git a/memstomp.spec b/memstomp.spec index 97e0b9c..3f00fcc 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -55,6 +55,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri May 10 2013 Jeff Law 0.1.4-7 +- Improve man page (#961518) + * Thu May 09 2013 Jeff Law 0.1.4-5 - Fix typo in initialization message (#961495) From 6cf5cbd198b48049ba0857d90ad47051238d687c Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 10 May 2013 17:55:35 -0600 Subject: [PATCH 06/56] Improve man page (#961518) --- memstomp-man.patch | 81 +++++++++++++++++++++++++++++++++++++--------- memstomp.spec | 5 ++- 2 files changed, 70 insertions(+), 16 deletions(-) diff --git a/memstomp-man.patch b/memstomp-man.patch index d06462f..b6839f6 100644 --- a/memstomp-man.patch +++ b/memstomp-man.patch @@ -9,25 +9,76 @@ CLEANFILES = \ memstomp ---- /dev/null 2013-02-26 15:11:24.372721019 -0700 -+++ b/memstomp.man 2013-03-11 21:54:06.847082615 -0600 -@@ -0,0 +1,19 @@ +diff -Nrup a/memstomp.man b/memstomp.man +--- a/memstomp.man 1969-12-31 17:00:00.000000000 -0700 ++++ b/memstomp.man 2013-05-10 17:53:37.767722170 -0600 +@@ -0,0 +1,69 @@ +.\" This is a comment +.\" Contact Owen@thelinuxblog.com -+.TH memstomp 1 "05 February 2013" ".1" "memstomp" ++.TH MEMSTOMP 1 "09 April 2013" "0.1.4" +.SH NAME -+memstomp ++memstomp \- detect function calls with overlapping memory regions +.SH SYNOPSIS -+memstomp [OPTIONS...] APPLICATION [ARGUMENTS...] ++.B memstomp ++.RB [ \-dk ] ++.I application ++.RI [ argument ...] ++.PP ++.B memstomp ++.B \-h +.SH DESCRIPTION -+memstomp can help detect memory argument overlaps to various mem* and str* functions. ++The ++.B memstomp ++utility identifies function calls that use overlapping memory regions in situations when such an overlap is not allowed by various standards. When a problem is detected, memstomp displays a backtrace to help you debug the problem, and if executed with the ++.B \-\-debug\-info ++command line option, it even uses the available debugging information. Since the backtrace code is not thread safe, memstomp also allows you to use the ++.B \-\-kill ++option to immediately terminate the analyzed program when an invalid function call is detected. ++.PP ++This version of memstomp inspects the following function calls: ++.BR memcpy (), ++.BR memccpy (), ++.BR mempcpy (), ++.BR strcpy (), ++.BR stpcpy (), ++.BR strncpy (), ++.BR stpncpy (), ++.BR strcat (), ++.BR strncat (), ++.BR wmemcpy (), ++.BR wmempcpy (), ++.BR wcscpy (), ++.BR wcsncpy (), ++.BR wcscat (), ++and ++.BR wcsncat (). +.SH OPTIONS -+-h, --help Show help -+ -+-d, --debug-info Make use of debug information in stack traces -+ -+-k, --kill Kill application when problem is detected -+ ++.TP ++.BR \-d ", " \-\-debug\-info ++Make use of debugging information to produce more detailed stack traces. ++.TP ++.BR \-k ", " \-\-kill ++Kill the analyzed application when a problem is detected. ++.TP ++.BR \-h ", " \-\-help ++Display usage information and exit. +.SH SEE ALSO -+.SH BUGS -+ ++.BR memcpy (3), ++.BR memccpy (3), ++.BR mempcpy (3), ++.BR strcpy (3), ++.BR stpcpy (3), ++.BR strncpy (3), ++.BR stpncpy (3), ++.BR strcat (3), ++.BR strncat (3), ++.BR wmemcpy (3), ++.BR wmempcpy (3), ++.BR wcscpy (3), ++.BR wcsncpy (3), ++.BR wcscat (3), ++.BR wcsncat (3) ++.SH AUTHORS ++Lennart Poettering ++.br ++William Cohen diff --git a/memstomp.spec b/memstomp.spec index 97e0b9c..3f00fcc 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -55,6 +55,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri May 10 2013 Jeff Law 0.1.4-7 +- Improve man page (#961518) + * Thu May 09 2013 Jeff Law 0.1.4-5 - Fix typo in initialization message (#961495) From e1d8a8146081cd57d355cb916dd642fa9cd4697c Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 14 May 2013 15:36:43 -0600 Subject: [PATCH 07/56] Link in libiberty (#962763) --- memstomp-rh962763.patch | 15 +++++++++++++++ memstomp.spec | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 memstomp-rh962763.patch diff --git a/memstomp-rh962763.patch b/memstomp-rh962763.patch new file mode 100644 index 0000000..9fce643 --- /dev/null +++ b/memstomp-rh962763.patch @@ -0,0 +1,15 @@ +diff -Nrup a/configure.ac b/configure.ac +--- a/configure.ac 2013-05-14 14:27:04.316530952 -0600 ++++ b/configure.ac 2013-05-14 14:27:37.854394379 -0600 +@@ -72,8 +72,10 @@ AC_CHECK_HEADERS([sys/poll.h]) + AC_CHECK_HEADERS([sys/ioctl.h]) + AC_CHECK_HEADERS([byteswap.h]) + ++AC_SEARCH_LIBS([htab_find_slot], [iberty], [], [AC_MSG_ERROR([*** libiberty not found])]) ++AC_CHECK_HEADERS([libiberty.h], [], [AC_MSG_ERROR([*** libiberty.h header not found])]) + AC_SEARCH_LIBS([bfd_init], [bfd], [], [AC_MSG_ERROR([*** libbfd not found])]) +-AC_CHECK_HEADERS([bfd.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])]) ++AC_CHECK_HEADERS([bfd.h], [], [AC_MSG_ERROR([*** bfd.h header not found])]) + + #### Typdefs, structures, etc. #### + diff --git a/memstomp.spec b/memstomp.spec index 3f00fcc..e9b7c5b 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -21,6 +21,7 @@ BuildRequires: binutils-devel autoconf automake dejagnu Patch0: memstomp-testsuite.patch Patch1: memstomp-man.patch Patch2: memstomp-rh961495.patch +Patch3: memstomp-rh962763.patch %description @@ -36,6 +37,7 @@ overlapping memory arguments to certain library calls. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build @@ -55,6 +57,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Tue May 14 2013 Jeff Law 0.1.4-8 +- Link in libiberty too (#962763) + * Fri May 10 2013 Jeff Law 0.1.4-7 - Improve man page (#961518) From 004e6f113517bc23c7af735e43584f4eb439cf19 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 30 May 2013 06:09:42 -0600 Subject: [PATCH 08/56] - Add -q/--quiet options for quiet mode. --- memstomp-quietmode.patch | 83 ++++++++++++++++++++++++++++++++++++++++ memstomp.spec | 7 +++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 memstomp-quietmode.patch diff --git a/memstomp-quietmode.patch b/memstomp-quietmode.patch new file mode 100644 index 0000000..727ffed --- /dev/null +++ b/memstomp-quietmode.patch @@ -0,0 +1,83 @@ +diff -Nrup a/memstomp.c b/memstomp.c +--- a/memstomp.c 2013-05-30 06:02:56.578486389 -0600 ++++ b/memstomp.c 2013-05-30 06:06:42.648731070 -0600 +@@ -64,6 +64,8 @@ + + static bool abrt_trap = false; + ++static bool quiet_mode = false; ++ + #ifndef SCHED_RESET_ON_FORK + /* "Your libc lacks the definition of SCHED_RESET_ON_FORK. We'll now + * define it ourselves, however make sure your kernel is new +@@ -162,7 +164,10 @@ static void setup(void) { + if (LIKELY(initialized)) + return; + +- if (!dlsym(NULL, "main")) ++ if (getenv("MEMSTOMP_QUIET")) ++ quiet_mode = true; ++ ++ if (!dlsym(NULL, "main") && !quiet_mode) + fprintf(stderr, + "memstomp: Application appears to be compiled without -rdynamic. It might be a\n" + "memstomp: good idea to recompile with -rdynamic enabled since this produces more\n" +@@ -173,9 +178,11 @@ static void setup(void) { + + initialized = true; + +- char prname[17]; +- fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n", +- get_prname(prname), (unsigned long) getpid()); ++ if (!quiet_mode) { ++ char prname[17]; ++ fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n", ++ get_prname(prname), (unsigned long) getpid()); ++ } + } + + static void show_summary(void) { } +diff -Nrup a/memstomp.in b/memstomp.in +--- a/memstomp.in 2011-03-30 21:27:19.000000000 -0600 ++++ b/memstomp.in 2013-05-30 06:06:42.649731067 -0600 +@@ -18,7 +18,7 @@ + # You should have received a copy of the GNU Lesser General Public + # License along with memstomp. If not, see . + +-if ! TEMP=`getopt -o +dhk --long help,debug-info,kill -n memstomp -- "$@"` ; then ++if ! TEMP=`getopt -o +dqhk --long help,quiet,debug-info,kill -n memstomp -- "$@"` ; then + exit 1 + fi + +@@ -38,6 +38,10 @@ while : ; do + shift 1 + ;; + ++ -q|--quiet) ++ export MEMSTOMP_QUIET=1 ++ shift 1 ++ ;; + + -h|--help) + cat < 0.1.4-9 +- Add -q/--quiet options for quiet mode. + * Tue May 14 2013 Jeff Law 0.1.4-8 - Link in libiberty too (#962763) From 5880f6b115d6dcc5e5af8d985b93c9cfcbbcc93a Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 14 May 2013 15:36:43 -0600 Subject: [PATCH 09/56] Link in libiberty (#962763) --- memstomp-rh962763.patch | 15 +++++++++++++++ memstomp.spec | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 memstomp-rh962763.patch diff --git a/memstomp-rh962763.patch b/memstomp-rh962763.patch new file mode 100644 index 0000000..9fce643 --- /dev/null +++ b/memstomp-rh962763.patch @@ -0,0 +1,15 @@ +diff -Nrup a/configure.ac b/configure.ac +--- a/configure.ac 2013-05-14 14:27:04.316530952 -0600 ++++ b/configure.ac 2013-05-14 14:27:37.854394379 -0600 +@@ -72,8 +72,10 @@ AC_CHECK_HEADERS([sys/poll.h]) + AC_CHECK_HEADERS([sys/ioctl.h]) + AC_CHECK_HEADERS([byteswap.h]) + ++AC_SEARCH_LIBS([htab_find_slot], [iberty], [], [AC_MSG_ERROR([*** libiberty not found])]) ++AC_CHECK_HEADERS([libiberty.h], [], [AC_MSG_ERROR([*** libiberty.h header not found])]) + AC_SEARCH_LIBS([bfd_init], [bfd], [], [AC_MSG_ERROR([*** libbfd not found])]) +-AC_CHECK_HEADERS([bfd.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])]) ++AC_CHECK_HEADERS([bfd.h], [], [AC_MSG_ERROR([*** bfd.h header not found])]) + + #### Typdefs, structures, etc. #### + diff --git a/memstomp.spec b/memstomp.spec index 3f00fcc..e9b7c5b 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -21,6 +21,7 @@ BuildRequires: binutils-devel autoconf automake dejagnu Patch0: memstomp-testsuite.patch Patch1: memstomp-man.patch Patch2: memstomp-rh961495.patch +Patch3: memstomp-rh962763.patch %description @@ -36,6 +37,7 @@ overlapping memory arguments to certain library calls. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build @@ -55,6 +57,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Tue May 14 2013 Jeff Law 0.1.4-8 +- Link in libiberty too (#962763) + * Fri May 10 2013 Jeff Law 0.1.4-7 - Improve man page (#961518) From 7b972e2360bb068c16fde4eec709159410669b71 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 30 May 2013 06:09:42 -0600 Subject: [PATCH 10/56] - Add -q/--quiet options for quiet mode. --- memstomp-quietmode.patch | 83 ++++++++++++++++++++++++++++++++++++++++ memstomp.spec | 7 +++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 memstomp-quietmode.patch diff --git a/memstomp-quietmode.patch b/memstomp-quietmode.patch new file mode 100644 index 0000000..727ffed --- /dev/null +++ b/memstomp-quietmode.patch @@ -0,0 +1,83 @@ +diff -Nrup a/memstomp.c b/memstomp.c +--- a/memstomp.c 2013-05-30 06:02:56.578486389 -0600 ++++ b/memstomp.c 2013-05-30 06:06:42.648731070 -0600 +@@ -64,6 +64,8 @@ + + static bool abrt_trap = false; + ++static bool quiet_mode = false; ++ + #ifndef SCHED_RESET_ON_FORK + /* "Your libc lacks the definition of SCHED_RESET_ON_FORK. We'll now + * define it ourselves, however make sure your kernel is new +@@ -162,7 +164,10 @@ static void setup(void) { + if (LIKELY(initialized)) + return; + +- if (!dlsym(NULL, "main")) ++ if (getenv("MEMSTOMP_QUIET")) ++ quiet_mode = true; ++ ++ if (!dlsym(NULL, "main") && !quiet_mode) + fprintf(stderr, + "memstomp: Application appears to be compiled without -rdynamic. It might be a\n" + "memstomp: good idea to recompile with -rdynamic enabled since this produces more\n" +@@ -173,9 +178,11 @@ static void setup(void) { + + initialized = true; + +- char prname[17]; +- fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n", +- get_prname(prname), (unsigned long) getpid()); ++ if (!quiet_mode) { ++ char prname[17]; ++ fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n", ++ get_prname(prname), (unsigned long) getpid()); ++ } + } + + static void show_summary(void) { } +diff -Nrup a/memstomp.in b/memstomp.in +--- a/memstomp.in 2011-03-30 21:27:19.000000000 -0600 ++++ b/memstomp.in 2013-05-30 06:06:42.649731067 -0600 +@@ -18,7 +18,7 @@ + # You should have received a copy of the GNU Lesser General Public + # License along with memstomp. If not, see . + +-if ! TEMP=`getopt -o +dhk --long help,debug-info,kill -n memstomp -- "$@"` ; then ++if ! TEMP=`getopt -o +dqhk --long help,quiet,debug-info,kill -n memstomp -- "$@"` ; then + exit 1 + fi + +@@ -38,6 +38,10 @@ while : ; do + shift 1 + ;; + ++ -q|--quiet) ++ export MEMSTOMP_QUIET=1 ++ shift 1 ++ ;; + + -h|--help) + cat < 0.1.4-9 +- Add -q/--quiet options for quiet mode. + * Tue May 14 2013 Jeff Law 0.1.4-8 - Link in libiberty too (#962763) From 2c252485b9bad9d2cbb4b7fcc372ad766a0767ea Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 05:04:14 -0500 Subject: [PATCH 11/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 7ee2f87..448409d 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -59,6 +59,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Sat Aug 03 2013 Fedora Release Engineering - 0.1.4-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Thu May 30 2013 Jeff Law 0.1.4-9 - Add -q/--quiet options for quiet mode. From b1c47f3b2eafd7cd69d2800c3cbc2d17383a6009 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 29 May 2014 14:50:14 -0600 Subject: [PATCH 12/56] - Add checking of various str* and mem* for NULL arguments (#1093173) --- memstomp-rh1093173.patch | 1054 ++++++++++++++++++++++++++++++++++++++ memstomp.spec | 7 +- 2 files changed, 1060 insertions(+), 1 deletion(-) create mode 100644 memstomp-rh1093173.patch diff --git a/memstomp-rh1093173.patch b/memstomp-rh1093173.patch new file mode 100644 index 0000000..7073dbb --- /dev/null +++ b/memstomp-rh1093173.patch @@ -0,0 +1,1054 @@ +*** a/Makefile.am 2014-05-29 10:40:14.997714171 -0600 +--- b/Makefile.am 2014-05-29 12:42:18.358166208 -0600 +*************** libmemstomp_la_LIBADD = \ +*** 53,58 **** +--- 53,60 ---- + -ldl + libmemstomp_la_CFLAGS = \ + $(PTHREAD_CFLAGS) \ ++ -fno-tree-vrp \ ++ -fno-delete-null-pointer-checks \ + -DSONAME=\"libmemstomp.so\" + + libmemstomp_backtrace_symbols_la_SOURCES = \ +*************** libmemstomp_backtrace_symbols_la_LIBADD +*** 68,74 **** + -lrt \ + -ldl + libmemstomp_backtrace_symbols_la_CFLAGS = \ +! $(PTHREAD_CFLAGS) + + memstomp: memstomp.in Makefile + sed -e 's,@PACKAGE_STRING\@,$(PACKAGE_STRING),g' \ +--- 70,76 ---- + -lrt \ + -ldl + libmemstomp_backtrace_symbols_la_CFLAGS = \ +! $(PTHREAD_CFLAGS) + + memstomp: memstomp.in Makefile + sed -e 's,@PACKAGE_STRING\@,$(PACKAGE_STRING),g' \ +*** a/memstomp.c 2014-05-29 10:40:15.016714123 -0600 +--- b/memstomp.c 2014-05-29 13:59:20.314343481 -0600 +*************** +*** 62,67 **** +--- 62,79 ---- + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + ++ #undef strcmp ++ #undef strncmp ++ #undef strdup ++ #undef strndup ++ #undef strchr ++ #undef strrchr ++ #undef strcspn ++ #undef strspn ++ #undef strpbrk ++ #undef strtok_r ++ #undef memcmp ++ + static bool abrt_trap = false; + + static bool quiet_mode = false; +*************** static void warn_copylap(void * dest, co +*** 316,321 **** +--- 328,356 ---- + free(info); + } + ++ static void warn_null(char const *name) ++ { ++ char prname[17]; ++ char buf[160]; ++ ++ /* Avoid fprintf which is not async signal safe. fprintf may call malloc, ++ * which may experience trouble if the bad memcpy was called from a signal ++ * handler whose invoking signal interrupted malloc. ++ */ ++ int const j = snprintf(buf, sizeof(buf), ++ "\n\n%s NULL pointer %s(%d)\n", ++ name, get_prname(prname), getpid()); ++ write(STDERR_FILENO, buf, umin(j, sizeof(buf))); ++ ++ /* If generate_stacktrace() indirectly invokes malloc (such as via libbfd), ++ * then this is not async signal safe. But the write() above will produce ++ * some evidence before any possible trouble below. ++ */ ++ char *const info = generate_stacktrace(); ++ fprintf(stderr, "%s", info); ++ free(info); ++ } ++ + static void *copy(void *dest, void const *src, size_t count, char const *name) + { + size_t d = (char *)dest - (char *)src; +*************** static void *copy(void *dest, void const +*** 326,331 **** +--- 361,367 ---- + /* report the overlap */ + warn_copylap(dest, src, count, name); + } ++ + /* be safe use memmove */ + return memmove(dest, src, count); + } +*************** char *stpncpy(char *dst, char const *src +*** 496,498 **** +--- 532,956 ---- + + /* XXX wcstok: Ugly! */ + ++ /* All the interposition routines below are just checking for NULL ++ arguments when ISO demands they be non-null. */ ++ ++ void *memmove (void *dest, const void *src, size_t n) ++ { ++ static void * (*real_memmove)(void *, const void *, size_t) = NULL; ++ if (!real_memmove) ++ real_memmove = dlsym(RTLD_NEXT, "memmove"); ++ ++ if (unlikely (dest == NULL || src == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("memmove"); ++ return 0; ++ } ++ ++ return real_memmove (dest, src, n); ++ } ++ ++ int memcmp (const void *__s1, const void *__s2, size_t __n) ++ { ++ static int (*real_memcmp)(const void *, const void *, size_t) = NULL; ++ if (!real_memcmp) ++ real_memcmp = dlsym(RTLD_NEXT, "memcmp"); ++ ++ if (unlikely (__s1 == NULL || __s2 == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("memcmp"); ++ return 0; ++ } ++ ++ return real_memcmp (__s1, __s2, __n); ++ } ++ ++ int strcmp (const char *__s1, const char *__s2) ++ { ++ static int (*real_strcmp)(const char *, const char *) = NULL; ++ if (!real_strcmp) ++ real_strcmp = dlsym(RTLD_NEXT, "strcmp"); ++ ++ if (unlikely (__s1 == NULL || __s2 == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strcmp"); ++ return 0; ++ } ++ ++ return real_strcmp (__s1, __s2); ++ } ++ ++ int strncmp (const char *__s1, const char *__s2, size_t __n) ++ { ++ static int (*real_strncmp)(const char *, const char *, size_t) = NULL; ++ if (!real_strncmp) ++ real_strncmp = dlsym(RTLD_NEXT, "strncmp"); ++ ++ if (unlikely (__s1 == NULL || __s2 == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strncmp"); ++ return 0; ++ } ++ ++ return real_strncmp (__s1, __s2, __n); ++ } ++ ++ int strcoll (const char *__s1, const char *__s2) ++ { ++ static int (*real_strcoll)(const char *, const char *) = NULL; ++ if (!real_strcoll) ++ real_strcoll = dlsym(RTLD_NEXT, "strcoll"); ++ ++ if (unlikely (__s1 == NULL || __s2 == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strcoll"); ++ return 0; ++ } ++ ++ return real_strcoll (__s1, __s2); ++ } ++ ++ int strcoll_l (const char *__s1, const char *__s2, __locale_t __l) ++ { ++ static int (*real_strcoll_l)(const char *, const char *, __locale_t) = NULL; ++ if (!real_strcoll_l) ++ real_strcoll_l = dlsym(RTLD_NEXT, "strcoll_l"); ++ ++ if (unlikely (__s1 == NULL || __s2 == NULL || __l == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strcoll_l"); ++ return 0; ++ } ++ ++ return real_strcoll_l (__s1, __s2, __l); ++ } ++ ++ size_t strxfrm (char *__dest, const char *__src, size_t __n) ++ { ++ static size_t (*real_strxfrm)(char *, const char *, size_t) = NULL; ++ if (!real_strxfrm) ++ real_strxfrm = dlsym(RTLD_NEXT, "strxfrm"); ++ ++ if (unlikely (__src == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strxfrm"); ++ return 0; ++ } ++ ++ return real_strxfrm (__dest, __src, __n); ++ } ++ ++ size_t strxfrm_l (char *__dest, const char *__src, size_t __n, __locale_t __l) ++ { ++ static size_t (*real_strxfrm_l)(char *, const char *, size_t, __locale_t) = NULL; ++ if (!real_strxfrm_l) ++ real_strxfrm_l = dlsym(RTLD_NEXT, "strxfrm_l"); ++ ++ if (unlikely (__src == NULL || __l == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strxfrm_l"); ++ return 0; ++ } ++ ++ return real_strxfrm_l (__dest, __src, __n, __l); ++ } ++ ++ ++ void *memset (void *__s, int __c, size_t __n) ++ { ++ static void * (*real_memset)(void *, int, size_t) = NULL; ++ if (!real_memset) ++ real_memset = dlsym(RTLD_NEXT, "memset"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("memset"); ++ return 0; ++ } ++ ++ return real_memset (__s, __c, __n); ++ } ++ ++ void *memchr (const void *__s, int __c, size_t __n) ++ { ++ static void * (*real_memchr)(const void *, int, size_t) = NULL; ++ if (!real_memchr) ++ real_memchr = dlsym(RTLD_NEXT, "memchr"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("memchr"); ++ return 0; ++ } ++ ++ return real_memchr (__s, __c, __n); ++ } ++ ++ void *memrchr (const void *__s, int __c, size_t __n) ++ { ++ static void * (*real_memrchr)(const void *, int, size_t) = NULL; ++ if (!real_memrchr) ++ real_memrchr = dlsym(RTLD_NEXT, "memrchr"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("memrchr"); ++ return 0; ++ } ++ ++ return real_memrchr (__s, __c, __n); ++ } ++ ++ void *rawmemchr (const void *__s, int __c) ++ { ++ static void * (*real_rawmemchr)(const void *, int, size_t) = NULL; ++ if (!real_rawmemchr) ++ real_rawmemchr = dlsym(RTLD_NEXT, "rawmemchr"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("rawmemchr"); ++ return 0; ++ } ++ ++ return real_rawmemchr (__s, __c, __c); ++ } ++ ++ size_t strlen (const char *__s) ++ { ++ static size_t (*real_strlen)(const char *) = NULL; ++ if (!real_strlen) ++ real_strlen = dlsym(RTLD_NEXT, "strlen"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strlen"); ++ return 0; ++ } ++ ++ return real_strlen (__s); ++ } ++ ++ char *strdup (const char *__s) ++ { ++ static char *(*real_strdup)(const char *) = NULL; ++ if (!real_strdup) ++ real_strdup = dlsym(RTLD_NEXT, "strdup"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strdup"); ++ return 0; ++ } ++ ++ return real_strdup (__s); ++ } ++ ++ char *strndup (const char *__s, size_t __n) ++ { ++ static char *(*real_strndup)(const char *, size_t) = NULL; ++ if (!real_strndup) ++ real_strndup = dlsym(RTLD_NEXT, "strndup"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strndup"); ++ return 0; ++ } ++ ++ return real_strndup (__s, __n); ++ } ++ ++ char *strchr (const char *__s, int __c) ++ { ++ static char * (*real_strchr)(const void *, int) = NULL; ++ if (!real_strchr) ++ real_strchr = dlsym(RTLD_NEXT, "strchr"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strchr"); ++ return 0; ++ } ++ ++ return real_strchr (__s, __c); ++ } ++ ++ char *strrchr (const char *__s, int __c) ++ { ++ static char * (*real_strrchr)(const void *, int) = NULL; ++ if (!real_strrchr) ++ real_strrchr = dlsym(RTLD_NEXT, "strrchr"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strrchr"); ++ return 0; ++ } ++ ++ return real_strrchr (__s, __c); ++ } ++ ++ char *strchrnul (const char *__s, int __c) ++ { ++ static char * (*real_strchrnul)(const void *, int) = NULL; ++ if (!real_strchrnul) ++ real_strchrnul = dlsym(RTLD_NEXT, "strchrnul"); ++ ++ if (unlikely (__s == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strchrnul"); ++ return 0; ++ } ++ ++ return real_strchrnul (__s, __c); ++ } ++ ++ size_t strcspn (const char *__s, const char *__reject) ++ { ++ static size_t (*real_strcspn)(const void *, const char *) = NULL; ++ if (!real_strcspn) ++ real_strcspn = dlsym(RTLD_NEXT, "strcspn"); ++ ++ if (unlikely (__s == NULL || __reject == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strcspn"); ++ return 0; ++ } ++ ++ return real_strcspn (__s, __reject); ++ } ++ ++ size_t strspn (const char *__s, const char *__accept) ++ { ++ static size_t (*real_strspn)(const void *, const char *) = NULL; ++ if (!real_strspn) ++ real_strspn = dlsym(RTLD_NEXT, "strspn"); ++ ++ if (unlikely (__s == NULL || __accept == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strspn"); ++ return 0; ++ } ++ ++ return real_strspn (__s, __accept); ++ } ++ ++ char * strpbrk (const char *__s, const char *__accept) ++ { ++ static char * (*real_strpbrk)(const void *, const char *) = NULL; ++ if (!real_strpbrk) ++ real_strpbrk = dlsym(RTLD_NEXT, "strpbrk"); ++ ++ if (unlikely (__s == NULL || __accept == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strpbrk"); ++ return 0; ++ } ++ ++ return real_strpbrk (__s, __accept); ++ } ++ ++ char * strstr (const char *__haystack, const char *__needle) ++ { ++ static char * (*real_strstr)(const void *, const char *) = NULL; ++ if (!real_strstr) ++ real_strstr = dlsym(RTLD_NEXT, "strstr"); ++ ++ if (unlikely (__haystack == NULL || __needle == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strstr"); ++ return 0; ++ } ++ ++ return real_strstr (__haystack, __needle); ++ } ++ ++ char *strcasestr (const char *__haystack, const char *__needle) ++ { ++ static char * (*real_strcasestr)(const void *, const char *) = NULL; ++ if (!real_strcasestr) ++ real_strcasestr = dlsym(RTLD_NEXT, "strcasestr"); ++ ++ if (unlikely (__haystack == NULL || __needle == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strcasestr"); ++ return 0; ++ } ++ ++ return real_strcasestr (__haystack, __needle); ++ } ++ ++ void *memmem (const void *__haystack, size_t __haystacklen, ++ const void *__needle, size_t __needlelen) ++ { ++ static char * (*real_strcasestr)(const void *, size_t, const char *, size_t) = NULL; ++ if (!real_strcasestr) ++ real_strcasestr = dlsym(RTLD_NEXT, "strcasestr"); ++ ++ if (unlikely (__haystack == NULL || __needle == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strcasestr"); ++ return 0; ++ } ++ ++ return real_strcasestr (__haystack, __haystacklen, __needle, __needlelen); ++ } ++ ++ char * strtok (char *__s, const char *__delim) ++ { ++ static char * (*real_strtok)(void *, const char *) = NULL; ++ if (!real_strtok) ++ real_strtok = dlsym(RTLD_NEXT, "strtok"); ++ ++ if (unlikely (__delim == NULL)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strtok"); ++ return 0; ++ } ++ ++ return real_strtok (__s, __delim); ++ } ++ ++ ++ char * strtok_r (char *__s, const char *__delim, char **__save_ptr) ++ { ++ static char * (*real_strtok_r)(void *, const char *, char **) = NULL; ++ if (!real_strtok_r) ++ real_strtok_r = dlsym(RTLD_NEXT, "strtok_r"); ++ ++ if (unlikely (__delim == NULL || __save_ptr)) { ++ if (abrt_trap) ABRT_TRAP; ++ /* report the NULL pointer */ ++ warn_null("strtok_r"); ++ return 0; ++ } ++ ++ return real_strtok_r (__s, __delim, __save_ptr); ++ } ++ +diff -Nrup a/testsuite/memstomp.null/memccpy.c b/testsuite/memstomp.null/memccpy.c +--- a/testsuite/memstomp.null/memccpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memccpy.c 2014-05-29 12:42:18.358166208 -0600 +@@ -0,0 +1,20 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef MEMCCPY ++#define MEMCCPY memccpy ++#define TYPE char ++#endif ++ ++TYPE arr1[10] = {0}; ++TYPE arr2[10] = {0}; ++TYPE *p1 = &arr1[0]; ++TYPE *p2 = &arr2[1]; ++size_t count = 9; ++main () ++{ ++ MEMCCPY (NULL, NULL, -1, 0); ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/memchr.c b/testsuite/memstomp.null/memchr.c +--- a/testsuite/memstomp.null/memchr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memchr.c 2014-05-29 14:09:04.667841941 -0600 +@@ -0,0 +1,4 @@ ++#define MEMSET memchr ++#define TYPE char ++#include "memset.c" ++ +diff -Nrup a/testsuite/memstomp.null/memcmp.c b/testsuite/memstomp.null/memcmp.c +--- a/testsuite/memstomp.null/memcmp.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memcmp.c 2014-05-29 13:57:53.098567650 -0600 +@@ -0,0 +1,3 @@ ++#define MEMCPY memcmp ++#define TYPE char ++#include "memcpy.c" +diff -Nrup a/testsuite/memstomp.null/memcpy.c b/testsuite/memstomp.null/memcpy.c +--- a/testsuite/memstomp.null/memcpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memcpy.c 2014-05-29 14:01:34.002999896 -0600 +@@ -0,0 +1,20 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef MEMCPY ++#define MEMCPY memcpy ++#define TYPE char ++#endif ++ ++TYPE arr1[10] = {0}; ++TYPE arr2[10] = {0}; ++TYPE *p1 = &arr1[0]; ++TYPE *p2 = &arr2[1]; ++size_t count = 9; ++main () ++{ ++ return MEMCPY (NULL, NULL, 0) == 0 ; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/memmem.c b/testsuite/memstomp.null/memmem.c +--- a/testsuite/memstomp.null/memmem.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memmem.c 2014-05-29 14:18:37.569363960 -0600 +@@ -0,0 +1,20 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef MEMMEM ++#define MEMMEM memmem ++#define TYPE char ++#endif ++ ++TYPE arr1[10] = {0}; ++TYPE arr2[10] = {0}; ++TYPE *p1 = &arr1[0]; ++TYPE *p2 = &arr2[1]; ++size_t count = 9; ++main () ++{ ++ return MEMMEM (NULL, 0, NULL, 0) == 0 ; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/memmove.c b/testsuite/memstomp.null/memmove.c +--- a/testsuite/memstomp.null/memmove.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memmove.c 2014-05-29 13:57:29.563628151 -0600 +@@ -0,0 +1,3 @@ ++#define MEMCPY memmove ++#define TYPE char ++#include "memcpy.c" +diff -Nrup a/testsuite/memstomp.null/mempcpy.c b/testsuite/memstomp.null/mempcpy.c +--- a/testsuite/memstomp.null/mempcpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/mempcpy.c 2014-05-29 12:42:18.358166208 -0600 +@@ -0,0 +1,3 @@ ++#define MEMCPY mempcpy ++#define TYPE char ++#include "memcpy.c" +diff -Nrup a/testsuite/memstomp.null/memrchr.c b/testsuite/memstomp.null/memrchr.c +--- a/testsuite/memstomp.null/memrchr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memrchr.c 2014-05-29 14:09:22.122797099 -0600 +@@ -0,0 +1,4 @@ ++#define MEMSET memrchr ++#define TYPE char ++#include "memset.c" ++ +diff -Nrup a/testsuite/memstomp.null/memset.c b/testsuite/memstomp.null/memset.c +--- a/testsuite/memstomp.null/memset.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/memset.c 2014-05-29 14:08:06.411991603 -0600 +@@ -0,0 +1,20 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef MEMSET ++#define MEMSET memset ++#define TYPE char ++#endif ++ ++TYPE arr1[10] = {0}; ++TYPE arr2[10] = {0}; ++TYPE *p1 = &arr1[0]; ++TYPE *p2 = &arr2[1]; ++size_t count = 9; ++main () ++{ ++ return MEMSET (NULL, -1, 0) == 0; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/null.exp b/testsuite/memstomp.null/null.exp +--- a/testsuite/memstomp.null/null.exp 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/null.exp 2014-05-29 12:42:18.358166208 -0600 +@@ -0,0 +1,59 @@ ++# Copyright (C) 2013 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GCC; see the file COPYING3. If not see ++# . ++# ++# This was originally copied from GCC's dejagnu testing framework ++# ++ ++load_lib memstomp.exp ++set memstomp [find_memstomp] ++set libmemstomp [find_libmemstomp] ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++# ++# main test loop ++# ++ ++proc compile-and-execute { sources } { ++ global memstomp ++ global libmemstomp ++ ++ set src [lindex $sources 0] ++ ++ if {[catch {exec gcc -fno-builtin $src} results]} { ++ fail "$src compilation $results" ++ } else { ++ pass "$src compilation $results" ++ } ++ ++ catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp $memstomp ./a.out"} results ++ if {[regexp "NULL pointer" $results]} { ++ pass "$src found NULL $results" ++ } else { ++ fail "$src found NULL $results" ++ } ++} ++ ++foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { ++ # If we're only testing specific files and this isn't one of them, skip it. ++ if ![runtest_file_p $runtests $src] then { ++ continue ++ } ++ ++ compile-and-execute $src ++} +diff -Nrup a/testsuite/memstomp.null/rawmemchr.c b/testsuite/memstomp.null/rawmemchr.c +--- a/testsuite/memstomp.null/rawmemchr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/rawmemchr.c 2014-05-29 14:10:36.610605748 -0600 +@@ -0,0 +1,20 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef RAWMEMCHR ++#define RAWMEMCHR rawmemchr ++#define TYPE char ++#endif ++ ++TYPE arr1[10] = {0}; ++TYPE arr2[10] = {0}; ++TYPE *p1 = &arr1[0]; ++TYPE *p2 = &arr2[1]; ++size_t count = 9; ++main () ++{ ++ return RAWMEMCHR (NULL, 0) == 0; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/stpcpy.c b/testsuite/memstomp.null/stpcpy.c +--- a/testsuite/memstomp.null/stpcpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/stpcpy.c 2014-05-29 12:42:18.358166208 -0600 +@@ -0,0 +1,2 @@ ++#define STRCPY stpcpy ++#include "strcpy.c" +diff -Nrup a/testsuite/memstomp.null/stpncpy.c b/testsuite/memstomp.null/stpncpy.c +--- a/testsuite/memstomp.null/stpncpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/stpncpy.c 2014-05-29 12:42:18.358166208 -0600 +@@ -0,0 +1,2 @@ ++#define STRNCPY stpncpy ++#include "strncpy.c" +diff -Nrup a/testsuite/memstomp.null/strcasestr.c b/testsuite/memstomp.null/strcasestr.c +--- a/testsuite/memstomp.null/strcasestr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcasestr.c 2014-05-29 14:18:59.099308034 -0600 +@@ -0,0 +1,2 @@ ++#define STRCMP strstr ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strcat.c b/testsuite/memstomp.null/strcat.c +--- a/testsuite/memstomp.null/strcat.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcat.c 2014-05-29 12:42:18.359166205 -0600 +@@ -0,0 +1,2 @@ ++#define STRCPY strcat ++#include "strcpy.c" +diff -Nrup a/testsuite/memstomp.null/strchr.c b/testsuite/memstomp.null/strchr.c +--- a/testsuite/memstomp.null/strchr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strchr.c 2014-05-29 14:13:39.929134865 -0600 +@@ -0,0 +1,4 @@ ++#define RAWMEMCHR strchr ++#define TYPE char ++#include "rawmemchr.c" ++ +diff -Nrup a/testsuite/memstomp.null/strchrnul.c b/testsuite/memstomp.null/strchrnul.c +--- a/testsuite/memstomp.null/strchrnul.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strchrnul.c 2014-05-29 14:15:17.983882584 -0600 +@@ -0,0 +1,4 @@ ++#define RAWMEMCHR strrchr ++#define TYPE char ++#include "rawmemchr.c" ++ +diff -Nrup a/testsuite/memstomp.null/strcmp.c b/testsuite/memstomp.null/strcmp.c +--- a/testsuite/memstomp.null/strcmp.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcmp.c 2014-05-29 14:17:21.903560538 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRCMP ++#define STRCMP strcmp ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ return STRCMP (NULL, NULL) == 0; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strcoll.c b/testsuite/memstomp.null/strcoll.c +--- a/testsuite/memstomp.null/strcoll.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcoll.c 2014-05-29 14:04:39.735522619 -0600 +@@ -0,0 +1,2 @@ ++#define STRNCPY strcoll ++#include "strcmp.c" +Binary files a/testsuite/memstomp.null/.strcoll.c.swp and b/testsuite/memstomp.null/.strcoll.c.swp differ +diff -Nrup a/testsuite/memstomp.null/strcoll_l.c b/testsuite/memstomp.null/strcoll_l.c +--- a/testsuite/memstomp.null/strcoll_l.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcoll_l.c 2014-05-29 14:05:22.181413555 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRCMP ++#define STRCMP strcoll_l ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ return STRCMP (NULL, NULL, NULL); ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strcpy.c b/testsuite/memstomp.null/strcpy.c +--- a/testsuite/memstomp.null/strcpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcpy.c 2014-05-29 12:42:18.359166205 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRCPY ++#define STRCPY strcpy ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ STRCPY (NULL, NULL); ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strcspn.c b/testsuite/memstomp.null/strcspn.c +--- a/testsuite/memstomp.null/strcspn.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strcspn.c 2014-05-29 14:16:12.219741618 -0600 +@@ -0,0 +1,2 @@ ++#define STRCMP strcspn ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strdup.c b/testsuite/memstomp.null/strdup.c +--- a/testsuite/memstomp.null/strdup.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strdup.c 2014-05-29 14:12:20.521338829 -0600 +@@ -0,0 +1,3 @@ ++#define STRLEN strdup ++#define TYPE char ++#include "strlen.c" +diff -Nrup a/testsuite/memstomp.null/strlen.c b/testsuite/memstomp.null/strlen.c +--- a/testsuite/memstomp.null/strlen.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strlen.c 2014-05-29 14:12:28.969317129 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRLEN ++#define STRLEN strlen ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ return STRLEN (NULL) == 0; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strncat.c b/testsuite/memstomp.null/strncat.c +--- a/testsuite/memstomp.null/strncat.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strncat.c 2014-05-29 12:42:18.359166205 -0600 +@@ -0,0 +1,2 @@ ++#define STRNCPY strncat ++#include "strncpy.c" +diff -Nrup a/testsuite/memstomp.null/strncmp.c b/testsuite/memstomp.null/strncmp.c +--- a/testsuite/memstomp.null/strncmp.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strncmp.c 2014-05-29 14:03:31.222698668 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRNCMP ++#define STRNCMP strncmp ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ return STRNCMP (NULL, NULL, 0); ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strncpy.c b/testsuite/memstomp.null/strncpy.c +--- a/testsuite/memstomp.null/strncpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strncpy.c 2014-05-29 12:42:18.359166205 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRNCPY ++#define STRNCPY strncpy ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ STRNCPY (NULL, NULL, 0); ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strndup.c b/testsuite/memstomp.null/strndup.c +--- a/testsuite/memstomp.null/strndup.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strndup.c 2014-05-29 14:13:18.192190697 -0600 +@@ -0,0 +1,4 @@ ++#define RAWMEMCHR strndup ++#define TYPE char ++#include "rawmemchr.c" ++ +diff -Nrup a/testsuite/memstomp.null/strpbrk.c b/testsuite/memstomp.null/strpbrk.c +--- a/testsuite/memstomp.null/strpbrk.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strpbrk.c 2014-05-29 14:17:09.970591544 -0600 +@@ -0,0 +1,2 @@ ++#define STRCMP strpbrk ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strrchr.c b/testsuite/memstomp.null/strrchr.c +--- a/testsuite/memstomp.null/strrchr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strrchr.c 2014-05-29 14:15:23.466868332 -0600 +@@ -0,0 +1,4 @@ ++#define RAWMEMCHR strchrnul ++#define TYPE char ++#include "rawmemchr.c" ++ +diff -Nrup a/testsuite/memstomp.null/strspn.c b/testsuite/memstomp.null/strspn.c +--- a/testsuite/memstomp.null/strspn.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strspn.c 2014-05-29 14:16:33.880685326 -0600 +@@ -0,0 +1,2 @@ ++#define STRCMP strspn ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strstr.c b/testsuite/memstomp.null/strstr.c +--- a/testsuite/memstomp.null/strstr.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strstr.c 2014-05-29 14:16:56.195627338 -0600 +@@ -0,0 +1,2 @@ ++#define STRCMP strstr ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strtok.c b/testsuite/memstomp.null/strtok.c +--- a/testsuite/memstomp.null/strtok.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strtok.c 2014-05-29 14:19:10.868277465 -0600 +@@ -0,0 +1,2 @@ ++#define STRCMP strtok ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strtok_r.c b/testsuite/memstomp.null/strtok_r.c +--- a/testsuite/memstomp.null/strtok_r.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strtok_r.c 2014-05-29 14:19:53.089167807 -0600 +@@ -0,0 +1,20 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRTOK_R ++#define STRTOK_R strtok_r ++#define TYPE char ++#endif ++ ++TYPE arr1[10] = {0}; ++TYPE arr2[10] = {0}; ++TYPE *p1 = &arr1[0]; ++TYPE *p2 = &arr2[1]; ++size_t count = 9; ++main () ++{ ++ return STRTOK_R (NULL, NULL, NULL) == 0 ; ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/strxfrm.c b/testsuite/memstomp.null/strxfrm.c +--- a/testsuite/memstomp.null/strxfrm.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strxfrm.c 2014-05-29 14:06:23.335256429 -0600 +@@ -0,0 +1,2 @@ ++#define STRNCPY strxfrm ++#include "strcmp.c" +diff -Nrup a/testsuite/memstomp.null/strxfrm_l.c b/testsuite/memstomp.null/strxfrm_l.c +--- a/testsuite/memstomp.null/strxfrm_l.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/strxfrm_l.c 2014-05-29 14:07:10.004136524 -0600 +@@ -0,0 +1,19 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#ifndef STRCMP ++#define STRCMP strxfrm_l ++#endif ++ ++ ++char arr1[32] = "this is a test"; ++char arr2[32] = "this is a test"; ++char *p1 = &arr1[0]; ++char *p2 = &arr2[1]; ++main () ++{ ++ return STRCMP (NULL, NULL, 0, NULL); ++} ++ ++ +diff -Nrup a/testsuite/memstomp.null/wmemcpy.c b/testsuite/memstomp.null/wmemcpy.c +--- a/testsuite/memstomp.null/wmemcpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/wmemcpy.c 2014-05-29 12:42:18.359166205 -0600 +@@ -0,0 +1,3 @@ ++#define MEMCPY wmemcpy ++#define TYPE wchar_t ++#include "memcpy.c" +diff -Nrup a/testsuite/memstomp.null/wmempcpy.c b/testsuite/memstomp.null/wmempcpy.c +--- a/testsuite/memstomp.null/wmempcpy.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.null/wmempcpy.c 2014-05-29 12:42:18.359166205 -0600 +@@ -0,0 +1,3 @@ ++#define MEMCPY wmempcpy ++#define TYPE wchar_t ++#include "memcpy.c" diff --git a/memstomp.spec b/memstomp.spec index 448409d..84f74b1 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -23,6 +23,7 @@ Patch1: memstomp-man.patch Patch2: memstomp-rh961495.patch Patch3: memstomp-rh962763.patch Patch4: memstomp-quietmode.patch +Patch5: memstomp-rh1093173.patch %description @@ -40,6 +41,7 @@ overlapping memory arguments to certain library calls. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build @@ -59,6 +61,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu May 29 2014 Jeff Law 0.1.4-11 +- Add checking of various str* and mem* for NULL arguments (#1093173) + * Sat Aug 03 2013 Fedora Release Engineering - 0.1.4-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 3b1c29cac14b8f7abebc513fc031ede2435299d4 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 4 Jun 2014 02:28:19 -0600 Subject: [PATCH 13/56] - Fix cut-n-paste bug in memmem --- memstomp-rh1093173.patch | 10 +++++----- memstomp.spec | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/memstomp-rh1093173.patch b/memstomp-rh1093173.patch index 7073dbb..ee59285 100644 --- a/memstomp-rh1093173.patch +++ b/memstomp-rh1093173.patch @@ -474,18 +474,18 @@ + void *memmem (const void *__haystack, size_t __haystacklen, + const void *__needle, size_t __needlelen) + { -+ static char * (*real_strcasestr)(const void *, size_t, const char *, size_t) = NULL; -+ if (!real_strcasestr) -+ real_strcasestr = dlsym(RTLD_NEXT, "strcasestr"); ++ static char * (*real_memmem)(const void *, size_t, const char *, size_t) = NULL; ++ if (!real_memmem) ++ real_memmem = dlsym(RTLD_NEXT, "memmem"); + + if (unlikely (__haystack == NULL || __needle == NULL)) { + if (abrt_trap) ABRT_TRAP; + /* report the NULL pointer */ -+ warn_null("strcasestr"); ++ warn_null("memmem"); + return 0; + } + -+ return real_strcasestr (__haystack, __haystacklen, __needle, __needlelen); ++ return real_memmem (__haystack, __haystacklen, __needle, __needlelen); + } + + char * strtok (char *__s, const char *__delim) diff --git a/memstomp.spec b/memstomp.spec index 84f74b1..b5bccd3 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -61,6 +61,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Wed Jun 4 2014 Jeff Law 0.1.4-12 +- Fix cut-n-paste bug in memmem + * Thu May 29 2014 Jeff Law 0.1.4-11 - Add checking of various str* and mem* for NULL arguments (#1093173) From 8d24519558aded448faf99d027f2433bf966efb3 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 04:01:02 -0500 Subject: [PATCH 14/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index b5bccd3..0fa7d87 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -61,6 +61,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 0.1.4-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Wed Jun 4 2014 Jeff Law 0.1.4-12 - Fix cut-n-paste bug in memmem From d59300426b10ec79f0423f6521c5f663b3915628 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 17 Aug 2014 09:12:17 +0000 Subject: [PATCH 15/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 0fa7d87..fbc62c0 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -61,6 +61,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Sun Aug 17 2014 Fedora Release Engineering - 0.1.4-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sat Jun 07 2014 Fedora Release Engineering - 0.1.4-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 32da7d176252406beed8bd9a02be044a54f48f11 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 26 Aug 2014 13:26:32 -0600 Subject: [PATCH 16/56] +* Tue Aug 26 2014 Jeff Law 0.1.4-15 +- Adjust PC values in saved frame addresses to get line number + associations correct (#1133815). --- memstomp-rh1133815.patch | 141 +++++++++++++++++++++++++++++++++++++++ memstomp.spec | 8 ++- 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 memstomp-rh1133815.patch diff --git a/memstomp-rh1133815.patch b/memstomp-rh1133815.patch new file mode 100644 index 0000000..0f378a7 --- /dev/null +++ b/memstomp-rh1133815.patch @@ -0,0 +1,141 @@ +diff -Nrup a/memstomp.c b/memstomp.c +--- a/memstomp.c 2014-08-26 13:13:30.004485804 -0600 ++++ b/memstomp.c 2014-08-26 13:17:00.450138891 -0600 +@@ -241,6 +241,16 @@ static char* generate_stacktrace(void) + int const n = real_backtrace(retaddr, frames_max); + assert(n >= 0); + ++ /* Adjust the frame addresses since they point to the next ++ instruction to execute, not the call site which may be ++ associated with different line numbers. ++ ++ For the cases we care about in memstomp, just subtracting ++ 1 works the vast majority of the time. It may not work for ++ a tail-call into an intercepted routine though. */ ++ for (int i = 0; i < n; i++) ++ retaddr[i]--; ++ + char **const strings = real_backtrace_symbols(retaddr, n); + assert(strings); + +diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.c b/testsuite/memstomp.lineinfo/linenumber.c +--- a/testsuite/memstomp.lineinfo/linenumber.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.lineinfo/linenumber.c 2014-08-26 13:23:12.535518727 -0600 +@@ -0,0 +1,23 @@ ++#define __NO_STRING_INLINES ++#include ++ ++void ++something (void) ++{ ++ char a[20] = " hello"; ++ memcpy (a, a + 5, 6); ++} ++ ++void ++nothing (void) ++{ ++ something (); ++} ++ ++int ++main (void) ++{ ++ nothing (); ++ return 0; ++} ++ +diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lineinfo/linenumber.exp +--- a/testsuite/memstomp.lineinfo/linenumber.exp 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.lineinfo/linenumber.exp 2014-08-26 13:23:12.535518727 -0600 +@@ -0,0 +1,63 @@ ++# Copyright (C) 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GCC; see the file COPYING3. If not see ++# . ++# ++# This was originally copied from GCC's dejagnu testing framework ++# ++# This is a hack. If we need more of these tests we'll want to use ++# something like dj's framework so that we can mark the lines where ++# we want errors/warnings. ++# ++ ++load_lib memstomp.exp ++set memstomp [find_memstomp] ++set libmemstomp [find_libmemstomp] ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++# ++# main test loop ++# ++ ++proc compile-and-execute { sources } { ++ global memstomp ++ global libmemstomp ++ ++ set src [lindex $sources 0] ++ ++ if {[catch {exec gcc -g -fno-builtin $src} results]} { ++ fail "$src compilation $results" ++ } else { ++ pass "$src compilation $results" ++ } ++ ++ catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp $memstomp -d ./a.out"} results ++ if {[regexp "linenumber.c:8" $results]} { ++ pass "$src found overlap on right line $results" ++ } else { ++ fail "$src found overlap on right line $results" ++ } ++} ++ ++foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { ++ # If we're only testing specific files and this isn't one of them, skip it. ++ if ![runtest_file_p $runtests $src] then { ++ continue ++ } ++ ++ compile-and-execute $src ++} +diff -Nrup a/testsuite/memstomp.overlap/linenumber.c b/testsuite/memstomp.overlap/linenumber.c +--- a/testsuite/memstomp.overlap/linenumber.c 1969-12-31 17:00:00.000000000 -0700 ++++ b/testsuite/memstomp.overlap/linenumber.c 2014-08-26 13:17:30.057090085 -0600 +@@ -0,0 +1,23 @@ ++#define __NO_STRING_INLINES ++#include ++ ++void ++something (void) ++{ ++ char a[20] = " hello"; ++ memcpy (a, a + 5, 6); ++} ++ ++void ++nothing (void) ++{ ++ something (); ++} ++ ++int ++main (void) ++{ ++ nothing (); ++ return 0; ++} ++ diff --git a/memstomp.spec b/memstomp.spec index fbc62c0..ed4a77a 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -24,6 +24,7 @@ Patch2: memstomp-rh961495.patch Patch3: memstomp-rh962763.patch Patch4: memstomp-quietmode.patch Patch5: memstomp-rh1093173.patch +Patch6: memstomp-rh1133815.patch %description @@ -42,6 +43,7 @@ overlapping memory arguments to certain library calls. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build @@ -61,6 +63,10 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Tue Aug 26 2014 Jeff Law 0.1.4-15 +- Adjust PC values in saved frame addresses to get line number + associations correct (#1133815). + * Sun Aug 17 2014 Fedora Release Engineering - 0.1.4-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From 2a17819221c81d867f62c21311d80cbd3be94492 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 26 Aug 2014 14:32:01 -0600 Subject: [PATCH 17/56] Load libmemstomp-backtrace-symbols too --- memstomp-rh1133815.patch | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/memstomp-rh1133815.patch b/memstomp-rh1133815.patch index 0f378a7..9e9514d 100644 --- a/memstomp-rh1133815.patch +++ b/memstomp-rh1133815.patch @@ -18,6 +18,21 @@ diff -Nrup a/memstomp.c b/memstomp.c char **const strings = real_backtrace_symbols(retaddr, n); assert(strings); +diff -Nrup a/testsuite/lib/memstomp.exp b/testsuite/lib/memstomp.exp +--- a/testsuite/lib/memstomp.exp 2014-08-26 13:13:29.964485869 -0600 ++++ b/testsuite/lib/memstomp.exp 2014-08-26 14:29:37.334241044 -0600 +@@ -13,3 +13,11 @@ proc find_libmemstomp {} { + set file [findfile $base_dir/../.libs/libmemstomp.so $base_dir/../.libs/libmemstomp.so libmemstomp.so] + return $file + } ++ ++proc find_libmemstomp_backtrace_symbols {} { ++ global tool_root_dir ++ global base_dir ++ ++ set file [findfile $base_dir/../.libs/libmemstomp-backtrace-symbols.so $base_dir/../.libs/libmemstomp-backtrace-symbols.so libmemstomp-backtrace-symbols.so] ++ return $file ++} diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.c b/testsuite/memstomp.lineinfo/linenumber.c --- a/testsuite/memstomp.lineinfo/linenumber.c 1969-12-31 17:00:00.000000000 -0700 +++ b/testsuite/memstomp.lineinfo/linenumber.c 2014-08-26 13:23:12.535518727 -0600 @@ -47,7 +62,7 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.c b/testsuite/memstomp.linei + diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lineinfo/linenumber.exp --- a/testsuite/memstomp.lineinfo/linenumber.exp 1969-12-31 17:00:00.000000000 -0700 -+++ b/testsuite/memstomp.lineinfo/linenumber.exp 2014-08-26 13:23:12.535518727 -0600 ++++ b/testsuite/memstomp.lineinfo/linenumber.exp 2014-08-26 14:30:19.094163290 -0600 @@ -0,0 +1,63 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -73,8 +88,8 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lin +# + +load_lib memstomp.exp -+set memstomp [find_memstomp] +set libmemstomp [find_libmemstomp] ++set libmemstomp_backtrace_symbols [find_libmemstomp_backtrace_symbols] + +if $tracelevel then { + strace $tracelevel @@ -85,8 +100,8 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lin +# + +proc compile-and-execute { sources } { -+ global memstomp + global libmemstomp ++ global libmemstomp_backtrace_symbols + + set src [lindex $sources 0] + @@ -96,7 +111,7 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lin + pass "$src compilation $results" + } + -+ catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp $memstomp -d ./a.out"} results ++ catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp:$libmemstomp_backtrace_symbols ./a.out"} results + if {[regexp "linenumber.c:8" $results]} { + pass "$src found overlap on right line $results" + } else { From d5b6902930384112cbe3458576635e8a8cc0ece3 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 26 Aug 2014 17:50:18 -0600 Subject: [PATCH 18/56] xfail linenumber test for aarch64 and arm --- memstomp-rh1133815.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/memstomp-rh1133815.patch b/memstomp-rh1133815.patch index 9e9514d..47b8e8c 100644 --- a/memstomp-rh1133815.patch +++ b/memstomp-rh1133815.patch @@ -62,8 +62,8 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.c b/testsuite/memstomp.linei + diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lineinfo/linenumber.exp --- a/testsuite/memstomp.lineinfo/linenumber.exp 1969-12-31 17:00:00.000000000 -0700 -+++ b/testsuite/memstomp.lineinfo/linenumber.exp 2014-08-26 14:30:19.094163290 -0600 -@@ -0,0 +1,63 @@ ++++ b/testsuite/memstomp.lineinfo/linenumber.exp 2014-08-26 17:49:55.493353200 -0600 +@@ -0,0 +1,65 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -111,6 +111,8 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lin + pass "$src compilation $results" + } + ++ # ARM's unwinder seems broken, assuming aarch64 is broken as well ++ setup_xfail arm*-*-* aarch64-*-* + catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp:$libmemstomp_backtrace_symbols ./a.out"} results + if {[regexp "linenumber.c:8" $results]} { + pass "$src found overlap on right line $results" From 94e9b0fbdae766e873081c3b10431d0909d8263a Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 26 May 2015 19:26:14 -0600 Subject: [PATCH 19/56] - Fixup implicit return types in testsuite. --- memstomp-implicit-int.patch | 372 ++++++++++++++++++++++++++++++++++++ memstomp.spec | 7 +- 2 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 memstomp-implicit-int.patch diff --git a/memstomp-implicit-int.patch b/memstomp-implicit-int.patch new file mode 100644 index 0000000..340a75a --- /dev/null +++ b/memstomp-implicit-int.patch @@ -0,0 +1,372 @@ +diff -Nrup a/testsuite/memstomp.nooverlap/memccpy.c b/testsuite/memstomp.nooverlap/memccpy.c +--- a/testsuite/memstomp.nooverlap/memccpy.c 2015-05-26 19:20:36.001837645 -0600 ++++ b/testsuite/memstomp.nooverlap/memccpy.c 2015-05-26 19:21:12.500043292 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + MEMCCPY (p1, p2, -1, count); +diff -Nrup a/testsuite/memstomp.nooverlap/memcpy.c b/testsuite/memstomp.nooverlap/memcpy.c +--- a/testsuite/memstomp.nooverlap/memcpy.c 2015-05-26 19:20:36.001837645 -0600 ++++ b/testsuite/memstomp.nooverlap/memcpy.c 2015-05-26 19:21:19.082900022 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + MEMCPY (p1, p2, count); +diff -Nrup a/testsuite/memstomp.nooverlap/strcpy.c b/testsuite/memstomp.nooverlap/strcpy.c +--- a/testsuite/memstomp.nooverlap/strcpy.c 2015-05-26 19:20:36.001837645 -0600 ++++ b/testsuite/memstomp.nooverlap/strcpy.c 2015-05-26 19:21:50.617213704 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + STRCPY (p2, p1); +diff -Nrup a/testsuite/memstomp.nooverlap/strncpy.c b/testsuite/memstomp.nooverlap/strncpy.c +--- a/testsuite/memstomp.nooverlap/strncpy.c 2015-05-26 19:20:36.001837645 -0600 ++++ b/testsuite/memstomp.nooverlap/strncpy.c 2015-05-26 19:21:54.929119859 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + STRNCPY (p1, p2, strlen (p2)); +diff -Nrup a/testsuite/memstomp.nooverlap/wcscpy.c b/testsuite/memstomp.nooverlap/wcscpy.c +--- a/testsuite/memstomp.nooverlap/wcscpy.c 2015-05-26 19:20:36.002837623 -0600 ++++ b/testsuite/memstomp.nooverlap/wcscpy.c 2015-05-26 19:21:58.928032826 -0600 +@@ -11,6 +11,8 @@ wchar_t arr1[32] = L"this is a test"; + wchar_t arr2[32] = L"this is a test"; + wchar_t *p1 = &arr1[0]; + wchar_t *p2 = &arr2[1]; ++ ++int + main () + { + WCSCPY (p1, p2); +diff -Nrup a/testsuite/memstomp.nooverlap/wcsncpy.c b/testsuite/memstomp.nooverlap/wcsncpy.c +--- a/testsuite/memstomp.nooverlap/wcsncpy.c 2015-05-26 19:20:36.002837623 -0600 ++++ b/testsuite/memstomp.nooverlap/wcsncpy.c 2015-05-26 19:22:03.184940178 -0600 +@@ -11,6 +11,8 @@ wchar_t arr1[32] = L"this is a test"; + wchar_t arr2[32] = L"this is a test"; + wchar_t *p1 = &arr1[0]; + wchar_t *p2 = &arr2[1]; ++ ++int + main () + { + WCSNCPY (p1, p2, wcslen (p2)); +diff -Nrup a/testsuite/memstomp.null/memccpy.c b/testsuite/memstomp.null/memccpy.c +--- a/testsuite/memstomp.null/memccpy.c 2015-05-26 19:20:36.010837449 -0600 ++++ b/testsuite/memstomp.null/memccpy.c 2015-05-26 19:22:08.530823830 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + MEMCCPY (NULL, NULL, -1, 0); +diff -Nrup a/testsuite/memstomp.null/memcpy.c b/testsuite/memstomp.null/memcpy.c +--- a/testsuite/memstomp.null/memcpy.c 2015-05-26 19:20:36.011837427 -0600 ++++ b/testsuite/memstomp.null/memcpy.c 2015-05-26 19:22:13.504715577 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + return MEMCPY (NULL, NULL, 0) == 0 ; +diff -Nrup a/testsuite/memstomp.null/memmem.c b/testsuite/memstomp.null/memmem.c +--- a/testsuite/memstomp.null/memmem.c 2015-05-26 19:20:36.011837427 -0600 ++++ b/testsuite/memstomp.null/memmem.c 2015-05-26 19:22:16.232656205 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + return MEMMEM (NULL, 0, NULL, 0) == 0 ; +diff -Nrup a/testsuite/memstomp.null/memset.c b/testsuite/memstomp.null/memset.c +--- a/testsuite/memstomp.null/memset.c 2015-05-26 19:20:36.011837427 -0600 ++++ b/testsuite/memstomp.null/memset.c 2015-05-26 19:22:22.800513262 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + return MEMSET (NULL, -1, 0) == 0; +diff -Nrup a/testsuite/memstomp.null/rawmemchr.c b/testsuite/memstomp.null/rawmemchr.c +--- a/testsuite/memstomp.null/rawmemchr.c 2015-05-26 19:20:36.011837427 -0600 ++++ b/testsuite/memstomp.null/rawmemchr.c 2015-05-26 19:22:25.857446730 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + return RAWMEMCHR (NULL, 0) == 0; +diff -Nrup a/testsuite/memstomp.null/strcmp.c b/testsuite/memstomp.null/strcmp.c +--- a/testsuite/memstomp.null/strcmp.c 2015-05-26 19:20:36.012837405 -0600 ++++ b/testsuite/memstomp.null/strcmp.c 2015-05-26 19:22:37.049203151 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + return STRCMP (NULL, NULL) == 0; +diff -Nrup a/testsuite/memstomp.null/strcoll_l.c b/testsuite/memstomp.null/strcoll_l.c +--- a/testsuite/memstomp.null/strcoll_l.c 2015-05-26 19:20:36.012837405 -0600 ++++ b/testsuite/memstomp.null/strcoll_l.c 2015-05-26 19:22:41.097115051 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + return STRCMP (NULL, NULL, NULL); +diff -Nrup a/testsuite/memstomp.null/strcpy.c b/testsuite/memstomp.null/strcpy.c +--- a/testsuite/memstomp.null/strcpy.c 2015-05-26 19:20:36.012837405 -0600 ++++ b/testsuite/memstomp.null/strcpy.c 2015-05-26 19:22:44.695036746 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + STRCPY (NULL, NULL); +diff -Nrup a/testsuite/memstomp.null/strlen.c b/testsuite/memstomp.null/strlen.c +--- a/testsuite/memstomp.null/strlen.c 2015-05-26 19:20:36.012837405 -0600 ++++ b/testsuite/memstomp.null/strlen.c 2015-05-26 19:22:49.456933107 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + return STRLEN (NULL) == 0; +diff -Nrup a/testsuite/memstomp.null/strncmp.c b/testsuite/memstomp.null/strncmp.c +--- a/testsuite/memstomp.null/strncmp.c 2015-05-26 19:20:36.012837405 -0600 ++++ b/testsuite/memstomp.null/strncmp.c 2015-05-26 19:22:53.383847641 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + return STRNCMP (NULL, NULL, 0); +diff -Nrup a/testsuite/memstomp.null/strncpy.c b/testsuite/memstomp.null/strncpy.c +--- a/testsuite/memstomp.null/strncpy.c 2015-05-26 19:20:36.012837405 -0600 ++++ b/testsuite/memstomp.null/strncpy.c 2015-05-26 19:22:56.135787748 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + STRNCPY (NULL, NULL, 0); +diff -Nrup a/testsuite/memstomp.null/strtok_r.c b/testsuite/memstomp.null/strtok_r.c +--- a/testsuite/memstomp.null/strtok_r.c 2015-05-26 19:20:36.013837384 -0600 ++++ b/testsuite/memstomp.null/strtok_r.c 2015-05-26 19:23:04.464606478 -0600 +@@ -12,6 +12,8 @@ TYPE arr2[10] = {0}; + TYPE *p1 = &arr1[0]; + TYPE *p2 = &arr2[1]; + size_t count = 9; ++ ++int + main () + { + return STRTOK_R (NULL, NULL, NULL) == 0 ; +diff -Nrup a/testsuite/memstomp.null/strxfrm_l.c b/testsuite/memstomp.null/strxfrm_l.c +--- a/testsuite/memstomp.null/strxfrm_l.c 2015-05-26 19:20:36.013837384 -0600 ++++ b/testsuite/memstomp.null/strxfrm_l.c 2015-05-26 19:23:10.319479051 -0600 +@@ -11,6 +11,8 @@ char arr1[32] = "this is a test"; + char arr2[32] = "this is a test"; + char *p1 = &arr1[0]; + char *p2 = &arr2[1]; ++ ++int + main () + { + return STRCMP (NULL, NULL, 0, NULL); +diff -Nrup a/testsuite/memstomp.overlap/memccpy-2.c b/testsuite/memstomp.overlap/memccpy-2.c +--- a/testsuite/memstomp.overlap/memccpy-2.c 2015-05-26 19:20:36.002837623 -0600 ++++ b/testsuite/memstomp.overlap/memccpy-2.c 2015-05-26 19:23:17.583320672 -0600 +@@ -11,6 +11,8 @@ TYPE arr[10] = {0}; + TYPE *p1 = &arr[0]; + TYPE *p2 = &arr[1]; + size_t count = 9; ++ ++int + main () + { + MEMCCPY (p2, p1, -1, count); +diff -Nrup a/testsuite/memstomp.overlap/memccpy.c b/testsuite/memstomp.overlap/memccpy.c +--- a/testsuite/memstomp.overlap/memccpy.c 2015-05-26 19:20:36.002837623 -0600 ++++ b/testsuite/memstomp.overlap/memccpy.c 2015-05-26 19:23:20.623254323 -0600 +@@ -11,6 +11,8 @@ TYPE arr[10] = {0}; + TYPE *p1 = &arr[0]; + TYPE *p2 = &arr[1]; + size_t count = 9; ++ ++int + main () + { + MEMCCPY (p1, p2, -1, count); +diff -Nrup a/testsuite/memstomp.overlap/memcpy-2.c b/testsuite/memstomp.overlap/memcpy-2.c +--- a/testsuite/memstomp.overlap/memcpy-2.c 2015-05-26 19:20:36.002837623 -0600 ++++ b/testsuite/memstomp.overlap/memcpy-2.c 2015-05-26 19:23:23.823184481 -0600 +@@ -11,6 +11,8 @@ TYPE arr[10] = {0}; + TYPE *p1 = &arr[0]; + TYPE *p2 = &arr[1]; + size_t count = 9; ++ ++int + main () + { + MEMCPY (p2, p1, count); +diff -Nrup a/testsuite/memstomp.overlap/memcpy.c b/testsuite/memstomp.overlap/memcpy.c +--- a/testsuite/memstomp.overlap/memcpy.c 2015-05-26 19:20:36.002837623 -0600 ++++ b/testsuite/memstomp.overlap/memcpy.c 2015-05-26 19:23:26.559124767 -0600 +@@ -11,6 +11,8 @@ TYPE arr[10] = {0}; + TYPE *p1 = &arr[0]; + TYPE *p2 = &arr[1]; + size_t count = 9; ++ ++int + main () + { + MEMCPY (p1, p2, count); +diff -Nrup a/testsuite/memstomp.overlap/strcpy-2.c b/testsuite/memstomp.overlap/strcpy-2.c +--- a/testsuite/memstomp.overlap/strcpy-2.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/strcpy-2.c 2015-05-26 19:23:37.055895666 -0600 +@@ -10,6 +10,8 @@ + char arr[32] = "this is a test"; + char *p1 = &arr[0]; + char *p2 = &arr[1]; ++ ++int + main () + { + STRCPY (p1, p2); +diff -Nrup a/testsuite/memstomp.overlap/strcpy.c b/testsuite/memstomp.overlap/strcpy.c +--- a/testsuite/memstomp.overlap/strcpy.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/strcpy.c 2015-05-26 19:23:40.231826349 -0600 +@@ -10,6 +10,8 @@ + char arr[32] = "this is a test"; + char *p1 = &arr[0]; + char *p2 = &arr[1]; ++ ++int + main () + { + STRCPY (p2, p1); +diff -Nrup a/testsuite/memstomp.overlap/strncpy-2.c b/testsuite/memstomp.overlap/strncpy-2.c +--- a/testsuite/memstomp.overlap/strncpy-2.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/strncpy-2.c 2015-05-26 19:23:45.158718815 -0600 +@@ -10,6 +10,8 @@ + char arr[32] = "this is a test"; + char *p1 = &arr[0]; + char *p2 = &arr[1]; ++ ++int + main () + { + STRNCPY (p2, p1, strlen (p1)); +diff -Nrup a/testsuite/memstomp.overlap/strncpy.c b/testsuite/memstomp.overlap/strncpy.c +--- a/testsuite/memstomp.overlap/strncpy.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/strncpy.c 2015-05-26 19:23:48.311650000 -0600 +@@ -10,6 +10,8 @@ + char arr[32] = "this is a test"; + char *p1 = &arr[0]; + char *p2 = &arr[1]; ++ ++int + main () + { + STRNCPY (p1, p2, strlen (p2)); +diff -Nrup a/testsuite/memstomp.overlap/wcscpy-2.c b/testsuite/memstomp.overlap/wcscpy-2.c +--- a/testsuite/memstomp.overlap/wcscpy-2.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/wcscpy-2.c 2015-05-26 19:23:53.167544016 -0600 +@@ -10,6 +10,8 @@ + wchar_t arr[32] = L"this is a test"; + wchar_t *p1 = &arr[0]; + wchar_t *p2 = &arr[1]; ++ ++int + main () + { + WCSCPY (p2, p1); +diff -Nrup a/testsuite/memstomp.overlap/wcscpy.c b/testsuite/memstomp.overlap/wcscpy.c +--- a/testsuite/memstomp.overlap/wcscpy.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/wcscpy.c 2015-05-26 19:23:56.070480657 -0600 +@@ -10,6 +10,8 @@ + wchar_t arr[32] = L"this is a test"; + wchar_t *p1 = &arr[0]; + wchar_t *p2 = &arr[1]; ++ ++int + main () + { + WCSCPY (p1, p2); +diff -Nrup a/testsuite/memstomp.overlap/wcsncpy-2.c b/testsuite/memstomp.overlap/wcsncpy-2.c +--- a/testsuite/memstomp.overlap/wcsncpy-2.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/wcsncpy-2.c 2015-05-26 19:24:00.279388794 -0600 +@@ -10,6 +10,8 @@ + wchar_t arr[32] = L"this is a test"; + wchar_t *p1 = &arr[0]; + wchar_t *p2 = &arr[1]; ++ ++int + main () + { + WCSNCPY (p2, p1, wcslen (p2)); +diff -Nrup a/testsuite/memstomp.overlap/wcsncpy.c b/testsuite/memstomp.overlap/wcsncpy.c +--- a/testsuite/memstomp.overlap/wcsncpy.c 2015-05-26 19:20:36.003837601 -0600 ++++ b/testsuite/memstomp.overlap/wcsncpy.c 2015-05-26 19:24:03.222324562 -0600 +@@ -10,6 +10,8 @@ + wchar_t arr[32] = L"this is a test"; + wchar_t *p1 = &arr[0]; + wchar_t *p2 = &arr[1]; ++ ++int + main () + { + WCSNCPY (p1, p2, wcslen (p2)); diff --git a/memstomp.spec b/memstomp.spec index ed4a77a..c2f0a03 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -25,6 +25,7 @@ Patch3: memstomp-rh962763.patch Patch4: memstomp-quietmode.patch Patch5: memstomp-rh1093173.patch Patch6: memstomp-rh1133815.patch +Patch7: memstomp-implicit-int.patch %description @@ -44,6 +45,7 @@ overlapping memory arguments to certain library calls. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build @@ -63,6 +65,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Tue May 26 2015 Jeff Law 0.1.4-16 +- Fixup implicit return types in testsuite. + * Tue Aug 26 2014 Jeff Law 0.1.4-15 - Adjust PC values in saved frame addresses to get line number associations correct (#1133815). From 19b9f732961f7f7543142614f2ab9143905dec54 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 19:59:37 +0000 Subject: [PATCH 20/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index c2f0a03..4ebb801 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -65,6 +65,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 0.1.4-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Tue May 26 2015 Jeff Law 0.1.4-16 - Fixup implicit return types in testsuite. From 9d4d80efcb051ec2dfad0a5c4c2110dc0177a4df Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 4 Feb 2016 05:16:22 +0000 Subject: [PATCH 21/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 4ebb801..fa1bc55 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 17%{?dist} +Release: 18%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -65,6 +65,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 0.1.4-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Wed Jun 17 2015 Fedora Release Engineering - 0.1.4-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From 2b6daae499e58559a69b8e98c4a92cb3d86d5e67 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 17 Feb 2016 17:59:13 -0700 Subject: [PATCH 22/56] * Wed Feb 17 2016 Jeff Law - 0.1.4-19 - Build with -O0 to avoid GCC optimizing away checks we want to keep. (#1307767) --- memstomp.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/memstomp.spec b/memstomp.spec index fa1bc55..e9170af 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 18%{?dist} +Release: 19%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -51,7 +51,12 @@ overlapping memory arguments to certain library calls. %build autoreconf %configure -make %{?_smp_mflags} CFLAGS+="-fno-strict-aliasing" +# We force -O0 here because memstomp essentially relies on GCC +# not removing any of its checks. GCC continues to get better +# and twarting its optimizer isn't something I have any interest +# in maintaining over time. So just force -O0 for stupid code +# generation. +make %{?_smp_mflags} CFLAGS+="-O0 -fno-strict-aliasing" make -k check %install @@ -65,6 +70,10 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Wed Feb 17 2016 Jeff Law - 0.1.4-19 +- Build with -O0 to avoid GCC optimizing away checks we want to keep. + (#1307767) + * Thu Feb 04 2016 Fedora Release Engineering - 0.1.4-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From a39e66d3b52a6b0a7369864d390647f5e037938f Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 9 May 2016 11:16:43 -0600 Subject: [PATCH 23/56] +- Remove xfail for aarch64 in testsuite (#1334124) --- memstomp-rh1133815.patch | 4 ++-- memstomp.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/memstomp-rh1133815.patch b/memstomp-rh1133815.patch index 47b8e8c..5f05de9 100644 --- a/memstomp-rh1133815.patch +++ b/memstomp-rh1133815.patch @@ -111,8 +111,8 @@ diff -Nrup a/testsuite/memstomp.lineinfo/linenumber.exp b/testsuite/memstomp.lin + pass "$src compilation $results" + } + -+ # ARM's unwinder seems broken, assuming aarch64 is broken as well -+ setup_xfail arm*-*-* aarch64-*-* ++ # ARM's unwinder seems broken ++ setup_xfail arm*-*-* + catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp:$libmemstomp_backtrace_symbols ./a.out"} results + if {[regexp "linenumber.c:8" $results]} { + pass "$src found overlap on right line $results" diff --git a/memstomp.spec b/memstomp.spec index e9170af..c0127d7 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 19%{?dist} +Release: 20%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -70,6 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Mon 9 2016 Jeff Law - 0.1.4-20 +- Remove xfail for aarch64 in testsuite (#1334124) + * Wed Feb 17 2016 Jeff Law - 0.1.4-19 - Build with -O0 to avoid GCC optimizing away checks we want to keep. (#1307767) From 8a76f28680863802a167586f38fe58e5bf3c79b9 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 9 May 2016 11:17:19 -0600 Subject: [PATCH 24/56] Fix typo in ChangeLog --- memstomp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index c0127d7..ac5ce1f 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -70,7 +70,7 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog -* Mon 9 2016 Jeff Law - 0.1.4-20 +* Mon May 9 2016 Jeff Law - 0.1.4-20 - Remove xfail for aarch64 in testsuite (#1334124) * Wed Feb 17 2016 Jeff Law - 0.1.4-19 From 31aaeb83c3add3ecb610bc922be81ab7d6f05b42 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 20:50:52 +0000 Subject: [PATCH 25/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index ac5ce1f..1477642 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 20%{?dist} +Release: 21%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -70,6 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri Feb 10 2017 Fedora Release Engineering - 0.1.4-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Mon May 9 2016 Jeff Law - 0.1.4-20 - Remove xfail for aarch64 in testsuite (#1334124) From 62aa0927ba536d4418520e4cd5e5baecc15d9f83 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 21:17:33 +0000 Subject: [PATCH 26/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 1477642..247fa39 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 21%{?dist} +Release: 22%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -70,6 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Wed Jul 26 2017 Fedora Release Engineering - 0.1.4-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Fri Feb 10 2017 Fedora Release Engineering - 0.1.4-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From a7c38c2d2c83639f14ad65f850b5c262cedc06f2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 03:13:58 +0000 Subject: [PATCH 27/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 247fa39..0537a4b 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 22%{?dist} +Release: 23%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -70,6 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 0.1.4-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 0.1.4-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 24d34972bc7302e0cd84ed5d8f94620ac6ee3deb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 8 Feb 2018 01:38:45 +0000 Subject: [PATCH 28/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 0537a4b..5c6e13a 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 23%{?dist} +Release: 24%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -70,6 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Feb 08 2018 Fedora Release Engineering - 0.1.4-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Aug 03 2017 Fedora Release Engineering - 0.1.4-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 56df70e78d8524a7a71c9fea67cbac706d3a0968 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 9 Jul 2018 19:06:49 +0200 Subject: [PATCH 29/56] add BuildRequires: gcc Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot --- memstomp.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/memstomp.spec b/memstomp.spec index 5c6e13a..5375a22 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -16,6 +16,7 @@ URL: git://fedorapeople.org/home/fedora/wcohen/public_git/memstomp # git archive --prefix memstomp-0.1.4-38573e7d/ master | gzip > memstomp-0.1.4-3867e37d.tar.gz Source0: %{name}-%{version}-%{githash}.tar.gz Requires: util-linux +BuildRequires: gcc BuildRequires: binutils-devel autoconf automake dejagnu Patch0: memstomp-testsuite.patch From cd12a3c9a60241ea6118f31ae0d78974ead651cb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 10:08:01 +0000 Subject: [PATCH 30/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 5375a22..7d811c5 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 24%{?dist} +Release: 25%{?dist} Summary: Warns of memory argument overlaps to various functions Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which @@ -71,6 +71,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 0.1.4-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Thu Feb 08 2018 Fedora Release Engineering - 0.1.4-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From f2b8c98d419aa309ec5359f0318026517ec8388c Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 22 Jan 2019 18:40:24 +0100 Subject: [PATCH 31/56] Remove obsolete ldconfig scriptlets References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets Signed-off-by: Igor Gnatenko --- memstomp.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/memstomp.spec b/memstomp.spec index 7d811c5..cf4d4fb 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -34,8 +34,7 @@ memstomp is a simple program that can be used to identify places in code which trigger undefined behavior due to overlapping memory arguments to certain library calls. -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%ldconfig_scriptlets %prep %setup -q -n %{name}-%{version}-%{githash} From c82beeee3c888ae753a7c51be33452d816f16b6d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:53 +0100 Subject: [PATCH 32/56] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- memstomp.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index cf4d4fb..49862a8 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -3,7 +3,6 @@ Name: memstomp Version: 0.1.4 Release: 25%{?dist} Summary: Warns of memory argument overlaps to various functions -Group: Development/Debuggers # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. # backtrace-symbols.c is built into an independent .so to avoid license contamination From c18deb2ed1cd9004bdf12b751eab7a6824846ecd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 10:10:32 +0000 Subject: [PATCH 33/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 49862a8..4a0ca2b 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 25%{?dist} +Release: 26%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -69,6 +69,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 0.1.4-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Fri Jul 13 2018 Fedora Release Engineering - 0.1.4-25 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From b84669732dda785f8f1338124de68233eada85c7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 16:21:53 +0000 Subject: [PATCH 34/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 4a0ca2b..2ee6dff 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,7 +1,7 @@ %global githash 38573e7d Name: memstomp Version: 0.1.4 -Release: 26%{?dist} +Release: 27%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -69,6 +69,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 0.1.4-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Feb 01 2019 Fedora Release Engineering - 0.1.4-26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From b3b790f09095db361fc6bd18a79496a7391b2507 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 13 Dec 2019 22:09:16 -0700 Subject: [PATCH 35/56] Dummy commit for testing purposes --- memstomp.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/memstomp.spec b/memstomp.spec index 2ee6dff..9060dfb 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -1,4 +1,5 @@ %global githash 38573e7d + Name: memstomp Version: 0.1.4 Release: 27%{?dist} From a40459e334144430e1c45cb98245053c0a149c7c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jan 2020 12:34:00 +0000 Subject: [PATCH 36/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 9060dfb..fbdb11e 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 27%{?dist} +Release: 28%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -70,6 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Wed Jan 29 2020 Fedora Release Engineering - 0.1.4-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Thu Jul 25 2019 Fedora Release Engineering - 0.1.4-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 4ddb0fa90bf8b10f195ef5fefeae26ff32790144 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 18 May 2020 16:26:31 -0600 Subject: [PATCH 37/56] - Various fixes for API changes in bfd --- bfd-api-change.patch | 22 ++++++++++++++++++++++ memstomp.spec | 7 ++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 bfd-api-change.patch diff --git a/bfd-api-change.patch b/bfd-api-change.patch new file mode 100644 index 0000000..7503183 --- /dev/null +++ b/bfd-api-change.patch @@ -0,0 +1,22 @@ +diff --git a/backtrace-symbols.c b/backtrace-symbols.c +index 0176e3f..5384e2e 100644 +--- a/backtrace-symbols.c ++++ b/backtrace-symbols.c +@@ -124,14 +124,14 @@ static void find_address_in_section( + if (arg->found) + return; + +- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) ++ if ((bfd_section_flags(section) & SEC_ALLOC) == 0) + return; + +- bfd_vma const vma = bfd_get_section_vma(abfd, section); ++ bfd_vma const vma = bfd_section_vma(section); + if (arg->pc < vma) + return; + +- bfd_size_type const size = bfd_section_size(abfd, section); ++ bfd_size_type const size = bfd_section_size(section); + if (arg->pc >= vma + size) + return; + diff --git a/memstomp.spec b/memstomp.spec index fbdb11e..41309b9 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 28%{?dist} +Release: 29%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -27,6 +27,7 @@ Patch4: memstomp-quietmode.patch Patch5: memstomp-rh1093173.patch Patch6: memstomp-rh1133815.patch Patch7: memstomp-implicit-int.patch +Patch8: bfd-api-change.patch %description @@ -46,6 +47,7 @@ overlapping memory arguments to certain library calls. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 %build @@ -70,6 +72,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Mon May 18 2020 Jeff Law - 0.1.4-29 +- Various fixes for API changes in bfd + * Wed Jan 29 2020 Fedora Release Engineering - 0.1.4-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 6deda540a001c05a7092b92ce5cf6f83578fa096 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 07:15:36 +0000 Subject: [PATCH 38/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 41309b9..fae5584 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 29%{?dist} +Release: 30%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -72,6 +72,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 0.1.4-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon May 18 2020 Jeff Law - 0.1.4-29 - Various fixes for API changes in bfd From 151f387a716b0d70277e3c04066f53c1b1e4c181 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 6 Jan 2021 21:40:29 +0000 Subject: [PATCH 39/56] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- memstomp.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/memstomp.spec b/memstomp.spec index fae5584..763535f 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -16,6 +16,7 @@ URL: git://fedorapeople.org/home/fedora/wcohen/public_git/memstomp # git archive --prefix memstomp-0.1.4-38573e7d/ master | gzip > memstomp-0.1.4-3867e37d.tar.gz Source0: %{name}-%{version}-%{githash}.tar.gz Requires: util-linux +BuildRequires: make BuildRequires: gcc BuildRequires: binutils-devel autoconf automake dejagnu From 524108f91f29b6fe12de72e45ab81e8063331c24 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 19:37:52 +0000 Subject: [PATCH 40/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 763535f..ec823ce 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 30%{?dist} +Release: 31%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -73,6 +73,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 0.1.4-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Jul 28 2020 Fedora Release Engineering - 0.1.4-30 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 190d2b9ae6adfc3585b4ce08d3334c7ec38312c6 Mon Sep 17 00:00:00 2001 From: Sergey Kolosov Date: Tue, 30 Mar 2021 17:21:39 +0200 Subject: [PATCH 41/56] Introduce CI gating --- .fmf/version | 1 + gating.yaml | 20 +++++ plans/ci.fmf | 6 ++ tests/Sanity/memstomp-testsuite/Makefile | 64 ++++++++++++++++ tests/Sanity/memstomp-testsuite/PURPOSE | 3 + tests/Sanity/memstomp-testsuite/main.fmf | 20 +++++ tests/Sanity/memstomp-testsuite/runtest.sh | 87 ++++++++++++++++++++++ 7 files changed, 201 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/ci.fmf create mode 100644 tests/Sanity/memstomp-testsuite/Makefile create mode 100644 tests/Sanity/memstomp-testsuite/PURPOSE create mode 100644 tests/Sanity/memstomp-testsuite/main.fmf create mode 100755 tests/Sanity/memstomp-testsuite/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..84b7773 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,20 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..1ad2c12 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: beakerlib diff --git a/tests/Sanity/memstomp-testsuite/Makefile b/tests/Sanity/memstomp-testsuite/Makefile new file mode 100644 index 0000000..189fbe8 --- /dev/null +++ b/tests/Sanity/memstomp-testsuite/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/memstomp/Sanity/memstomp-testsuite +# Description: Runs memstomp testsuite on installed packages +# Author: Miroslav Franc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/memstomp/Sanity/memstomp-testsuite +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Miroslav Franc " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Runs memstomp testsuite on installed packages" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: memstomp" >> $(METADATA) + @echo "Requires: autoconf automake binutils-devel dejagnu gcc gcc-c++ glibc-devel memstomp rpm-build" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL8 -RHEL9" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/memstomp-testsuite/PURPOSE b/tests/Sanity/memstomp-testsuite/PURPOSE new file mode 100644 index 0000000..8be9f56 --- /dev/null +++ b/tests/Sanity/memstomp-testsuite/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/memstomp/Sanity/memstomp-testsuite +Description: Runs memstomp testsuite on installed packages +Author: Miroslav Franc diff --git a/tests/Sanity/memstomp-testsuite/main.fmf b/tests/Sanity/memstomp-testsuite/main.fmf new file mode 100644 index 0000000..6388c8a --- /dev/null +++ b/tests/Sanity/memstomp-testsuite/main.fmf @@ -0,0 +1,20 @@ +summary: Runs memstomp testsuite on installed packages +description: '' +contact: Miroslav Franc +component: +- memstomp +test: ./runtest.sh +framework: beakerlib +recommend: +- autoconf +- automake +- binutils-devel +- dejagnu +- gcc +- gcc-c++ +- glibc-devel +- memstomp +- rpm-build +duration: 15m +extra-summary: /tools/memstomp/Sanity/memstomp-testsuite +extra-task: /tools/memstomp/Sanity/memstomp-testsuite diff --git a/tests/Sanity/memstomp-testsuite/runtest.sh b/tests/Sanity/memstomp-testsuite/runtest.sh new file mode 100755 index 0000000..ad1a6d6 --- /dev/null +++ b/tests/Sanity/memstomp-testsuite/runtest.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/memstomp/Sanity/memstomp-testsuite +# Description: Runs memstomp testsuite on installed packages +# Author: Miroslav Franc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES=(binutils-devel autoconf automake dejagnu) + +if [[ $(arch) == i686 ]] +then + ourlibdir=lib +else + ourlibdir=lib64 +fi + +PACKAGE=memstomp + +if scl_enabled +then + for p in ${X_SCLS} + do + [[ $p == devtoolset* ]] && PACKAGE=${p}-${PACKAGE} + done; unset p +fi + +rlJournalStart + rlPhaseStartSetup "testing $PACKAGE" + for p in "${PACKAGES[@]}"; do + rpm -q "$p" || yum -y install "$p" + rlAssertRpm "$p" + done; unset p + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "echo '%_topdir /root/memstomp-rebuild' > ~/.rpmmacros" + rlRun "mkdir -p /root/memstomp-rebuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}" + rlFetchSrcForInstalled $PACKAGE + rlRun "rpm -Uvh *.src.rpm" + export CC=/usr/bin/gcc + rlRun "rpmbuild -bi /root/memstomp-rebuild/SPECS/memstomp.spec &> build_log" + rlFileSubmit build_log + rlRun "pushd /root/memstomp-rebuild/BUILD/memstomp-*/testsuite" + rlLog "We should run this on installed packages..." + rlRun "find /root/memstomp-rebuild/ -name libmemstomp.so -delete" + rlRun "find /root/memstomp-rebuild/ -name libmemstomp-backtrace-symbols.so -delete" + rlPhaseEnd + + rlPhaseStartTest + rlRun "runtest -v --tool memstomp --srcdir `pwd` > $TmpDir/log 2>&1" + rlAssertNotGrep 'unexpected failures' $TmpDir/log + rlLog "No testcases should disappear..." + rlRun "[[ $(grep '# of expected passes' $TmpDir/log | awk '{print $5}') -ge 88 ]]" + rlLog "$(sed -n '/=== memstomp Summary ===/,$p' $TmpDir/log)" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd"; rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlRun "rm -r /root/memstomp-rebuild" + rlRun "rm -r ~/.rpmmacros" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd From 8a53feacf43a484b1ed32f3927be44c62ebcfe37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kadl=C4=8D=C3=ADk?= Date: Thu, 10 Jun 2021 08:49:51 +0200 Subject: [PATCH 42/56] Do not use a kernel rebuild as a gating test baseos-qe.koji-build.scratch-build.validation is a scratch kernel build test. While it is important for components like gcc, it's probably an overkill for memstomp, not to mention the testing time. --- gating.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/gating.yaml b/gating.yaml index 84b7773..ce3cdc1 100644 --- a/gating.yaml +++ b/gating.yaml @@ -5,7 +5,6 @@ decision_context: bodhi_update_push_stable subject_type: koji_build rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} - - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} --- !Policy product_versions: - rhel-8 From b0d752f9c87843754a128b3c5658f18bb322df1a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 14:07:44 +0000 Subject: [PATCH 43/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index ec823ce..bdf1e61 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 31%{?dist} +Release: 32%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -73,6 +73,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 0.1.4-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jan 26 2021 Fedora Release Engineering - 0.1.4-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 9940f5ee4b39e57956017dade7cf08677d0ba7e6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 19:04:50 +0000 Subject: [PATCH 44/56] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index bdf1e61..8d41c8f 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 32%{?dist} +Release: 33%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -73,6 +73,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 0.1.4-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Thu Jul 22 2021 Fedora Release Engineering - 0.1.4-32 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 8469af446bdda8c70962c67e3ed09f36d2fa72be Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 20:55:50 +0000 Subject: [PATCH 45/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 8d41c8f..751f06a 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 33%{?dist} +Release: 34%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -73,6 +73,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jul 21 2022 Fedora Release Engineering - 0.1.4-34 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Thu Jan 20 2022 Fedora Release Engineering - 0.1.4-33 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 4b106f22211308ba2387f983edf6ca199b570a97 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 19:21:35 +0000 Subject: [PATCH 46/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 751f06a..9df1c3c 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 34%{?dist} +Release: 35%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -73,6 +73,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 0.1.4-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Thu Jul 21 2022 Fedora Release Engineering - 0.1.4-34 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 064ab9b3dae6b5ed4c35f72f0cd1309577ad0fbd Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 20 Feb 2023 11:44:22 -0700 Subject: [PATCH 47/56] - Fix for libibery no longer providing PTR (#2171607) --- memstomp-PTR.patch | 17 +++++++++++++++++ memstomp.spec | 8 +++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 memstomp-PTR.patch diff --git a/memstomp-PTR.patch b/memstomp-PTR.patch new file mode 100644 index 0000000..0afb7d8 --- /dev/null +++ b/memstomp-PTR.patch @@ -0,0 +1,17 @@ +diff --git a/backtrace-symbols.c b/backtrace-symbols.c +index 5384e2e..9fc464a 100644 +--- a/backtrace-symbols.c ++++ b/backtrace-symbols.c +@@ -90,10 +90,10 @@ static asymbol **slurp_symtab(bfd *const abfd) + return syms; + + unsigned int size; +- long symcount = bfd_read_minisymbols(abfd, false, (PTR) & syms, &size); ++ long symcount = bfd_read_minisymbols(abfd, false, (void *) & syms, &size); + if (symcount == 0) + symcount = bfd_read_minisymbols(abfd, true /* dynamic */ , +- (PTR) & syms, &size); ++ (void *) & syms, &size); + + if (symcount < 0) + bfd_fatal(bfd_get_filename(abfd)); diff --git a/memstomp.spec b/memstomp.spec index 9df1c3c..a6efae3 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 35%{?dist} +Release: 36%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -29,6 +29,7 @@ Patch5: memstomp-rh1093173.patch Patch6: memstomp-rh1133815.patch Patch7: memstomp-implicit-int.patch Patch8: bfd-api-change.patch +Patch9: memstomp-PTR.patch %description @@ -49,6 +50,7 @@ overlapping memory arguments to certain library calls. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %build @@ -73,6 +75,10 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Mon Feb 20 2023 Jeff Law - 0.1.4-36 +- Fix for libibery no longer providing PTR + (#2171607) + * Thu Jan 19 2023 Fedora Release Engineering - 0.1.4-35 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From c819fe3502441bfbafd586cbc02300a1b00ff015 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 6 Mar 2023 14:38:05 -0500 Subject: [PATCH 48/56] Link in binutils sframe library when available to fix FTBFS. (rhbz#2171607) --- memstomp-sframe.patch | 12 ++++++++++++ memstomp.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 memstomp-sframe.patch diff --git a/memstomp-sframe.patch b/memstomp-sframe.patch new file mode 100644 index 0000000..b0091eb --- /dev/null +++ b/memstomp-sframe.patch @@ -0,0 +1,12 @@ +diff -up memstomp-0.1.4-38573e7d/configure.ac.orig memstomp-0.1.4-38573e7d/configure.ac +--- memstomp-0.1.4-38573e7d/configure.ac.orig 2023-03-06 14:07:57.086183046 -0500 ++++ memstomp-0.1.4-38573e7d/configure.ac 2023-03-06 14:16:31.513215306 -0500 +@@ -76,6 +76,8 @@ AC_SEARCH_LIBS([htab_find_slot], [iberty + AC_CHECK_HEADERS([libiberty.h], [], [AC_MSG_ERROR([*** libiberty.h header not found])]) + AC_SEARCH_LIBS([bfd_init], [bfd], [], [AC_MSG_ERROR([*** libbfd not found])]) + AC_CHECK_HEADERS([bfd.h], [], [AC_MSG_ERROR([*** bfd.h header not found])]) ++# Newer binutils-2.40 also need to link with sframe library ++AC_SEARCH_LIBS(sframe_decode, sframe) + + #### Typdefs, structures, etc. #### + diff --git a/memstomp.spec b/memstomp.spec index a6efae3..b485af9 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 36%{?dist} +Release: 37%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -30,6 +30,7 @@ Patch6: memstomp-rh1133815.patch Patch7: memstomp-implicit-int.patch Patch8: bfd-api-change.patch Patch9: memstomp-PTR.patch +Patch10: memstomp-sframe.patch %description @@ -51,6 +52,7 @@ overlapping memory arguments to certain library calls. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 %build @@ -75,6 +77,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Mon Mar 6 2023 William Cohen - 0.1.4-37 +- Link in binutils sframe library when available to fix FTBFS. (rhbz#2171607) + * Mon Feb 20 2023 Jeff Law - 0.1.4-36 - Fix for libibery no longer providing PTR (#2171607) From c1803184754e58e3ea461d0bf4b969ce93514306 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 14:13:53 +0000 Subject: [PATCH 49/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index b485af9..4493170 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 37%{?dist} +Release: 38%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -77,6 +77,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 0.1.4-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Mon Mar 6 2023 William Cohen - 0.1.4-37 - Link in binutils sframe library when available to fix FTBFS. (rhbz#2171607) From b0677f3155f18b2f5a3048230b910124bca17a84 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 07:19:15 +0000 Subject: [PATCH 50/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 4493170..cd0fdf3 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 38%{?dist} +Release: 39%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -77,6 +77,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 0.1.4-39 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Thu Jul 20 2023 Fedora Release Engineering - 0.1.4-38 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 56ef5c32cd82f04ccf1c97505b21592bfcad342a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 06:11:31 +0000 Subject: [PATCH 51/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index cd0fdf3..646fbc8 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 39%{?dist} +Release: 40%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -77,6 +77,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 0.1.4-40 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 0.1.4-39 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From b20ae3eaefc76a6dfd414ae577e38dcb2429abfc Mon Sep 17 00:00:00 2001 From: Software Management Team Date: Thu, 30 May 2024 12:46:47 +0200 Subject: [PATCH 52/56] Eliminate use of obsolete %patchN syntax (#2283636) --- memstomp.spec | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/memstomp.spec b/memstomp.spec index 646fbc8..e120acb 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -42,17 +42,17 @@ overlapping memory arguments to certain library calls. %prep %setup -q -n %{name}-%{version}-%{githash} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 +%patch -P0 -p1 +%patch -P1 -p1 +%patch -P2 -p1 +%patch -P3 -p1 +%patch -P4 -p1 +%patch -P5 -p1 +%patch -P6 -p1 +%patch -P7 -p1 +%patch -P8 -p1 +%patch -P9 -p1 +%patch -P10 -p1 %build From 74ac3959bd505dab78eb64d95392fbd299306419 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 17:11:09 +0000 Subject: [PATCH 53/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index e120acb..6aae5c1 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 40%{?dist} +Release: 41%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -77,6 +77,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 0.1.4-41 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Thu Jan 25 2024 Fedora Release Engineering - 0.1.4-40 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From b6467618ccbd3ac7ea218e8fa0f0fabf5f9fab34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 7 Aug 2024 09:46:41 +0200 Subject: [PATCH 54/56] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- memstomp.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/memstomp.spec b/memstomp.spec index 6aae5c1..5aeb574 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,12 +2,13 @@ Name: memstomp Version: 0.1.4 -Release: 41%{?dist} +Release: 42%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. # backtrace-symbols.c is built into an independent .so to avoid license contamination -License: LGPLv3+ and GPLv2+ +# Automatically converted from old format: LGPLv3+ and GPLv2+ - review is highly recommended. +License: LGPL-3.0-or-later AND GPL-2.0-or-later URL: git://fedorapeople.org/home/fedora/wcohen/public_git/memstomp # The source for this package was pulled from upstream's vcs. Use the # following commands to generate the tarball: @@ -77,6 +78,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Wed Aug 07 2024 Miroslav Suchý - 0.1.4-42 +- convert license to SPDX + * Thu Jul 18 2024 Fedora Release Engineering - 0.1.4-41 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From e01abe70697af9ccc7e7d92211e6d516fe9c7cc7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 17:25:58 +0000 Subject: [PATCH 55/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index 5aeb574..a0cd7ff 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 42%{?dist} +Release: 43%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -78,6 +78,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 0.1.4-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Wed Aug 07 2024 Miroslav Suchý - 0.1.4-42 - convert license to SPDX From f8e1e2710624f9cb09dac13b1eba35282743eaff Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 21:32:07 +0000 Subject: [PATCH 56/56] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- memstomp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memstomp.spec b/memstomp.spec index a0cd7ff..9f47afa 100644 --- a/memstomp.spec +++ b/memstomp.spec @@ -2,7 +2,7 @@ Name: memstomp Version: 0.1.4 -Release: 43%{?dist} +Release: 44%{?dist} Summary: Warns of memory argument overlaps to various functions # The entire source code is LGPLV3+ with the exception of backtrace-symbols.c which # is GPLv2+ by way of being a hacked up old version of binutils's addr2line. @@ -78,6 +78,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man1/memstomp.1.gz %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 0.1.4-44 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Fri Jan 17 2025 Fedora Release Engineering - 0.1.4-43 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild