Compare commits

...
Sign in to create a new pull request.

51 commits

Author SHA1 Message Date
Fedora Release Engineering
f8e1e27106 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 21:32:07 +00:00
Fedora Release Engineering
e01abe7069 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 17:25:58 +00:00
Miroslav Suchý
b6467618cc convert license to SPDX
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4
2024-08-07 09:46:41 +02:00
Fedora Release Engineering
74ac3959bd Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 17:11:09 +00:00
Software Management Team
b20ae3eaef Eliminate use of obsolete %patchN syntax (#2283636) 2024-05-30 12:46:47 +02:00
Fedora Release Engineering
56ef5c32cd Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 06:11:31 +00:00
Fedora Release Engineering
b0677f3155 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 07:19:15 +00:00
Fedora Release Engineering
c180318475 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 14:13:53 +00:00
William Cohen
c819fe3502 Link in binutils sframe library when available to fix FTBFS. (rhbz#2171607) 2023-03-06 14:38:05 -05:00
Jeff Law
064ab9b3da - Fix for libibery no longer providing PTR
(#2171607)
2023-02-20 11:45:06 -07:00
Fedora Release Engineering
4b106f2221 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 19:21:35 +00:00
Fedora Release Engineering
8469af446b Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 20:55:50 +00:00
Fedora Release Engineering
9940f5ee4b - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 19:04:50 +00:00
Fedora Release Engineering
b0d752f9c8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 14:07:44 +00:00
Václav Kadlčík
8a53feacf4 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.
2021-06-10 08:49:51 +02:00
Sergey Kolosov
190d2b9ae6 Introduce CI gating 2021-03-30 17:21:39 +02:00
Fedora Release Engineering
524108f91f - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 19:37:52 +00:00
Tom Stellard
151f387a71 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-06 21:40:29 +00:00
Fedora Release Engineering
6deda540a0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 07:15:36 +00:00
Jeff Law
4ddb0fa90b - Various fixes for API changes in bfd 2020-05-18 16:26:31 -06:00
Fedora Release Engineering
a40459e334 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 12:34:00 +00:00
Jeff Law
b3b790f090 Dummy commit for testing purposes 2019-12-13 22:09:16 -07:00
Fedora Release Engineering
b84669732d - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 16:21:53 +00:00
Fedora Release Engineering
c18deb2ed1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 10:10:32 +00:00
Igor Gnatenko
c82beeee3c Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:15 +01:00
Igor Gnatenko
f2b8c98d41
Remove obsolete ldconfig scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-22 18:40:24 +01:00
Fedora Release Engineering
cd12a3c9a6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 10:08:01 +00:00
Igor Gnatenko
56df70e78d add BuildRequires: gcc
Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-09 19:06:49 +02:00
Fedora Release Engineering
24d34972bc - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-08 01:38:45 +00:00
Fedora Release Engineering
a7c38c2d2c - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 03:13:58 +00:00
Fedora Release Engineering
62aa0927ba - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 21:17:33 +00:00
Fedora Release Engineering
31aaeb83c3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 20:50:52 +00:00
Jeff Law
8a76f28680 Fix typo in ChangeLog 2016-05-09 11:17:19 -06:00
Jeff Law
a39e66d3b5 +- Remove xfail for aarch64 in testsuite (#1334124) 2016-05-09 11:16:43 -06:00
Jeff Law
2b6daae499 * Wed Feb 17 2016 Jeff Law <law@redhat.com> - 0.1.4-19
- Build with -O0 to avoid GCC optimizing away checks we want to keep.
  (#1307767)
2016-02-17 17:59:13 -07:00
Dennis Gilmore
9d4d80efcb - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 05:16:22 +00:00
Dennis Gilmore
19b9f73296 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 19:59:37 +00:00
Jeff Law
94e9b0fbda - Fixup implicit return types in testsuite. 2015-05-26 19:26:14 -06:00
Jeff Law
d5b6902930 xfail linenumber test for aarch64 and arm 2014-08-26 17:50:18 -06:00
Jeff Law
2a17819221 Load libmemstomp-backtrace-symbols too 2014-08-26 14:32:01 -06:00
Jeff Law
32da7d1762 +* Tue Aug 26 2014 Jeff Law <law@redhat.com> 0.1.4-15
+- Adjust PC values in saved frame addresses to get line number
+  associations correct (#1133815).
2014-08-26 13:26:32 -06:00
Peter Robinson
d59300426b - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-17 09:12:17 +00:00
Dennis Gilmore
8d24519558 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 04:01:02 -05:00
Jeff Law
3b1c29cac1 - Fix cut-n-paste bug in memmem 2014-06-04 02:28:19 -06:00
Jeff Law
b1c47f3b2e - Add checking of various str* and mem* for NULL arguments (#1093173) 2014-05-29 14:50:14 -06:00
Dennis Gilmore
2c252485b9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-03 05:04:14 -05:00
Jeff Law
004e6f1135 - Add -q/--quiet options for quiet mode. 2013-05-30 06:09:42 -06:00
Jeff Law
e1d8a81460 Link in libiberty (#962763) 2013-05-14 15:36:43 -06:00
Jeff Law
6cf5cbd198 Improve man page (#961518) 2013-05-10 17:58:32 -06:00
Jeff Law
02e6265335 Fix typo in initialization message (#961495) 2013-05-09 22:27:34 -06:00
Jeff Law
7a34fe2e0f - Build tests with -fno-builtin 2013-03-15 10:55:36 -06:00
19 changed files with 2169 additions and 25 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

22
bfd-api-change.patch Normal file
View file

@ -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;

19
gating.yaml Normal file
View file

@ -0,0 +1,19 @@
--- !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}
--- !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}

17
memstomp-PTR.patch Normal file
View file

@ -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));

372
memstomp-implicit-int.patch Normal file
View file

@ -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));

View file

@ -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 <lennart@poettering.net>
+.br
+William Cohen <wcohen@redhat.com>

83
memstomp-quietmode.patch Normal file
View file

@ -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 <http://www.gnu.org/licenses/>.
-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 <<EOF
@@ -51,6 +55,7 @@ COMMANDS:
OPTIONS:
-d, --debug-info Make use of debug information in stack traces
-k, --kill Kill application when problem memcpy occurs
+ -q, --quiet Be less verbose
EOF
exit 0
;;
diff -Nrup a/memstomp.man b/memstomp.man
--- a/memstomp.man 2013-05-30 06:02:56.577486392 -0600
+++ b/memstomp.man 2013-05-30 06:06:18.531812637 -0600
@@ -47,6 +47,9 @@ Kill the analyzed application when a pro
.TP
.BR \-h ", " \-\-help
Display usage information and exit.
+.TP
+.BR \-q ", " \-\-quiet
+Be less verbose
.SH SEE ALSO
.BR memcpy (3),
.BR memccpy (3),

1054
memstomp-rh1093173.patch Normal file

File diff suppressed because it is too large Load diff

158
memstomp-rh1133815.patch Normal file
View file

@ -0,0 +1,158 @@
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/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
@@ -0,0 +1,23 @@
+#define __NO_STRING_INLINES
+#include <string.h>
+
+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 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
+# 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
+# <http://www.gnu.org/licenses/>.
+#
+# 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 libmemstomp [find_libmemstomp]
+set libmemstomp_backtrace_symbols [find_libmemstomp_backtrace_symbols]
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# main test loop
+#
+
+proc compile-and-execute { sources } {
+ global libmemstomp
+ global libmemstomp_backtrace_symbols
+
+ set src [lindex $sources 0]
+
+ if {[catch {exec gcc -g -fno-builtin $src} results]} {
+ fail "$src compilation $results"
+ } else {
+ pass "$src compilation $results"
+ }
+
+ # 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"
+ } 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 <string.h>
+
+void
+something (void)
+{
+ char a[20] = " hello";
+ memcpy (a, a + 5, 6);
+}
+
+void
+nothing (void)
+{
+ something ();
+}
+
+int
+main (void)
+{
+ nothing ();
+ return 0;
+}
+

12
memstomp-rh961495.patch Normal file
View file

@ -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());
}

15
memstomp-rh962763.patch Normal file
View file

@ -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. ####

12
memstomp-sframe.patch Normal file
View file

@ -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. ####

View file

@ -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"

View file

@ -1,13 +1,14 @@
%global githash 38573e7d
Name: memstomp
Version: 0.1.4
Release: 4%{?dist}
Release: 44%{?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
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:
@ -16,10 +17,21 @@ 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
Patch0: memstomp-testsuite.patch
Patch1: memstomp-man.patch
Patch2: memstomp-rh961495.patch
Patch3: memstomp-rh962763.patch
Patch4: memstomp-quietmode.patch
Patch5: memstomp-rh1093173.patch
Patch6: memstomp-rh1133815.patch
Patch7: memstomp-implicit-int.patch
Patch8: bfd-api-change.patch
Patch9: memstomp-PTR.patch
Patch10: memstomp-sframe.patch
%description
@ -27,19 +39,32 @@ 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}
%patch0 -p1
%patch1 -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
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
@ -53,6 +78,129 @@ make install DESTDIR=$RPM_BUILD_ROOT
%{_mandir}/man1/memstomp.1.gz
%changelog
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Aug 07 2024 Miroslav Suchý <msuchy@redhat.com> - 0.1.4-42
- convert license to SPDX
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-39
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Mar 6 2023 William Cohen <wcohen@redhat.com> - 0.1.4-37
- Link in binutils sframe library when available to fix FTBFS. (rhbz#2171607)
* Mon Feb 20 2023 Jeff Law <law@redhat.com> - 0.1.4-36
- Fix for libibery no longer providing PTR
(#2171607)
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon May 18 2020 Jeff Law <law@redhat.com> - 0.1.4-29
- Various fixes for API changes in bfd
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon May 9 2016 Jeff Law <law@redhat.com> - 0.1.4-20
- Remove xfail for aarch64 in testsuite (#1334124)
* Wed Feb 17 2016 Jeff Law <law@redhat.com> - 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 <releng@fedoraproject.org> - 0.1.4-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue May 26 2015 Jeff Law <law@redhat.com> 0.1.4-16
- Fixup implicit return types in testsuite.
* Tue Aug 26 2014 Jeff Law <law@redhat.com> 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 <rel-eng@lists.fedoraproject.org> - 0.1.4-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Jun 4 2014 Jeff Law <law@redhat.com> 0.1.4-12
- Fix cut-n-paste bug in memmem
* Thu May 29 2014 Jeff Law <law@redhat.com> 0.1.4-11
- Add checking of various str* and mem* for NULL arguments (#1093173)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu May 30 2013 Jeff Law <law@redhat.com> 0.1.4-9
- Add -q/--quiet options for quiet mode.
* Tue May 14 2013 Jeff Law <law@redhat.com> 0.1.4-8
- Link in libiberty too (#962763)
* Fri May 10 2013 Jeff Law <law@redhat.com> 0.1.4-7
- Improve man page (#961518)
* Thu May 09 2013 Jeff Law <law@redhat.com> 0.1.4-5
- Fix typo in initialization message (#961495)
* Fri Mar 15 2013 Jeff Law <law@redhat.com> 0.1.4-4
- Build tests with -fno-builtin
* Mon Mar 11 2013 Jeff Law <law@redhat.com> 0.1.4-4
- Add manpage
- Add initial testsuite

6
plans/ci.fmf Normal file
View file

@ -0,0 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View file

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/memstomp/Sanity/memstomp-testsuite
# Description: Runs memstomp testsuite on installed packages
# Author: Miroslav Franc <mfranc@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <mfranc@redhat.com>" > $(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)

View file

@ -0,0 +1,3 @@
PURPOSE of /tools/memstomp/Sanity/memstomp-testsuite
Description: Runs memstomp testsuite on installed packages
Author: Miroslav Franc <mfranc@redhat.com>

View file

@ -0,0 +1,20 @@
summary: Runs memstomp testsuite on installed packages
description: ''
contact: Miroslav Franc <mfranc@redhat.com>
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

View file

@ -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 <mfranc@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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