From 03f62250684110ac238305b640dd6a3196e686687000350473e2110f3c9069ec Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 1 Sep 2020 05:29:41 +0000 Subject: [PATCH] Accepting request 830725 from home:berny:branches:Base:System - gnulib-test-avoid-FP-perror-strerror.patch: Add patch to avoid false-positive error in gnulib tests 'test-perror2' and 'test-strerror_r', visible on armv7l. - diffutils.spec: Reference the patch. - Do not recommend lang package. The lang package already has a supplements. - ignore make check error for diff --color as tracked by https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36488 - Update to version 3.7: * bugfix - diff --strip-trailing-cr with a single CR byte in one input file would provoke an uninitialized memory read * diff --color now produces output compatible with less -R. - Small packaging cleanups: * PIE is now default for whole distribution * xz is not needed as build dependency anymore - Use %license (boo#1082318) - Update to version 3.6: * When one file is a prefix of the other, cmp now appends the shorter file's size to the EOF diagnostic. * diff's default algorithm has been tweaked to deal better with larger files, reversing some of the changes made in diffutils-3.4. - Define packager and bug reporting url - Update to a pre-release version (3.5.15): * remove big-file-performance.patch and gnulib-diffseq.patch * comment signature source as the release is not officially signed yet - gnulib-diffseq.patch, big-file-performance.patch: Avoid performance regression on big files (bsc#1004991) - Diffutils 3.5: * diff3 no longer malfunctions due to use-after-free [bug introduced in 3.4] * diff --color no longer colorizes when TERM=dumb - Update to version 3.4 * diff accepts two new options --color and --palette to generate and configure colored output. --color takes an optional argument specifying when to colorize a line: --color=always, --color=auto, --color=never. --palette is used to configure which colors are used. * many bugfixes - New -lang subpackage - Drop no longer needed gnulib-perl522.patch - Make building more verbose - Move info page removal to preun - Cleanup spec file with spec-cleaner - Update provides/obsoletes - add gnulib-perl522.patch from gnulib upstream - build with PIE - Diffutils has a testsuite so run it. - disable gpg key checking to avoid build cycles. will be done by source service - add gpg key checking, keyring from savannah - Update to 3.3: * add --no-dereference * -N works with - (stdin) as input * many fixes * many cleanups (in docco too) - remove: config-guess-sub-update.patch - remove: diffutils-stdio.in.patch - Added url as source. Please see http://en.opensuse.org/SourceUrls - Update config.guess/sub for aarch64 - Fix build with missing gets declaration (glibc 2.16) - Update to 3.2: * diff: --ignore-file-name-case now applies at top level too * diff, sdiff: new option --ignore-trailing-space * maint: avoid new "make sytnax-check" failure - Remove redundant tags/sections from specfile (cf. packaging guidelines) - Update to 3.1: + Bug fixes - diff no longer reports spurious differences merely because two entries in the same directory have names that compare equal in the current locale, or compare equal because --ignore-file-name-case was given. - Update to version 3.0: + Bug fixes - diff once again prints the required "\ No newline at end of file" line when at least one input lacks a newline-at-EOF and the final hunk plus context-length aligns exactly with the end of the newline-lacking file. [bug introduced between 2.8.7 and 2.9] + Changes in behavior - In context-style diffs, diff prints a portion of a preceding "function" line for each hunk, with --show-function-line=RE (-F) or --show-c-function (-p). Now, it trims leading blanks from such lines before extracting a prefix. This is useful especially when a function line is so far indented that the name itself would be truncated or not included in the limited-width substring that diff appends. - diff once again reports a difference with the diagnostic "Binary files A and B differ" when at least one of the files appears to be binary. From 2.8.4 through diffutils-2.9, it printed "Files A and B differ". - Changes from version 2.9: + New features - New diff option --suppress-blank-empty. - Bring back support for `diff -NUM', where NUM is a number, even when conforming to POSIX 1003.1-2001. This change reverts to the behavior of GNU diff 2.7 and earlier. This is a change only when conforming to POSIX 1003.1-2001; there is no effect when conforming to older POSIX versions. - sdiff now understands '1' and '2' as synonyms for 'l' and 'r'. + Changes in behavior - sdiff and diff3 now invoke diff, not $(bindir)/diff + Administrivia - updated gnulib support - Drop diffutils-no_binary_mode.patch: fixed upstream. - Drop diffutils-2.8.1-i18n-0.2.patch: this doesn't apply anymore, the only reference I can guess about it goes back to 2004, and commit 8983b8d9 upstream is about handling multibyte characters in side-by-side format. So I'm assuming it's fixed. This also means we can drop the call to autoreconf. - Drop diffutils-2.8.7-autoconf.patch: this is not needed anymore. - Remove AutoReqProv: it's default now. - Stop touching the main pages in %build. - Use %configure and %makeinstall macros. - Only do freopen if O_BINARY is true. - use %_smp_mflags - fix stack limit autoconf check - enable parallel building - Update to head of trunk. * New diff option --suppress-blank-empty. * Bring back support for `diff -NUM', where NUM is a number, even when conforming to POSIX 1003.1-2001. This change reverts to the behavior of GNU diff 2.7 and earlier. This is a change only when conforming to POSIX 1003.1-2001; there is no effect when conforming to older POSIX versions. This change is in response to decisions taken in the January 2005 Austin Group standardization meeting. For more details, please see "Utility Syntax Guidelines" in the Minutes of the January 2005 Meeting . * sdiff now understands '1' and '2' as synonyms for 'l' and 'r'. - removed help2man BuildRequires again. Instead prevent patches from invalidating the shipped manpages. - readd help2man to BuildRequires (needed to build manpages) - Update cmp patch [#198332]. - diffutils does not need help2man. - Fix output of EOF message when stdout is redirected to /dev/null. - converted neededforbuild to BuildRequires - Readd mbrtowc check [#45308]. - Update to diffutils 2.8.7. - Update to diffutils 2.8.6. - build as user - Update to diffutils 2.8.4. - Add %defattr. - fix install_info --delete call and move from preun to postun - Only delete info entries when removing last version. - Use %install_info. - Avoid rebuilding manpage [#18930]. - Add i18n patches. - Update to diffutils 2.8.1. * Documentation fixes. - Update to diffutils 2.8. - Update to diffutils 2.7.2. - Fix last change to close resource leaks. - tmpfile security problem fixed using mkstemp(). - diff: Fix a corner case in handling of directories. - sdiff: Fix reading of split lines. - Renamed from diff. - Switch to BuildRoot. - Add group tag. - Use %{_infodir}. - /usr/info -> /usr/share/info - ran old prepare_spec on spec file to switch to new prepare_spec. - specfile cleanup - dont use m486 on alpha :-) --- bug-fix for sdiff OBS-URL: https://build.opensuse.org/request/show/830725 OBS-URL: https://build.opensuse.org/package/show/Base:System/diffutils?expand=0&rev=59 --- diffutils.changes | 8 ++ diffutils.spec | 7 +- gnulib-test-avoid-FP-perror-strerror.patch | 101 +++++++++++++++++++++ 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 gnulib-test-avoid-FP-perror-strerror.patch diff --git a/diffutils.changes b/diffutils.changes index f78d899..7cbf5c0 100644 --- a/diffutils.changes +++ b/diffutils.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Aug 31 10:02:12 UTC 2020 - Bernhard Voelker + +- gnulib-test-avoid-FP-perror-strerror.patch: Add patch to +avoid false-positive error in gnulib tests 'test-perror2' and +'test-strerror_r', visible on armv7l. +- diffutils.spec: Reference the patch. + ------------------------------------------------------------------- Thu Sep 19 11:51:54 UTC 2019 - Ludwig Nussel diff --git a/diffutils.spec b/diffutils.spec index ed1e9d9..d6ec3f6 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,7 +1,7 @@ # # spec file for package diffutils # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,10 @@ URL: https://www.gnu.org/software/diffutils/ Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig Source2: %{name}.keyring + +# Avoid FP error in gnulib tests 'test-perror2' and 'test-strerror_r'. +Patch1: gnulib-test-avoid-FP-perror-strerror.patch + Requires(pre): %{install_info_prereq} Requires(preun): %{install_info_prereq} Provides: diff = %{version} @@ -39,6 +43,7 @@ make source code patches, for instance. %prep %setup -q +%patch1 %build %configure \ diff --git a/gnulib-test-avoid-FP-perror-strerror.patch b/gnulib-test-avoid-FP-perror-strerror.patch new file mode 100644 index 0000000..482a45d --- /dev/null +++ b/gnulib-test-avoid-FP-perror-strerror.patch @@ -0,0 +1,101 @@ +Avoid false-positive error in gnulib tests 'test-perror2' and 'test-strerror_r'. + +On openSUSE OBS, the above gnulib tests fail on armv7l. + +Corresponding report on the gnulib mailing list: + + https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html + + From: Florian Weimer + Date: Thu, 27 Aug 2020 09:41:34 +0200 + Subject: Use-after-free in test-perror2, test-strerror_r + + The problem is visible with glibc 2.32 under valgrind: + + ==20== Invalid read of size 1 + ==20== at 0x483DAB4: strcmp (vg_replace_strmem.c:847) + ==20== by 0x109414: main (test-perror2.c:84) + ==20== Address 0x4a1a3d0 is 0 bytes inside a block of size 17 free'd + ==20== at 0x483A9F5: free (vg_replace_malloc.c:538) + ==20== by 0x48E2134: strerror_l (in /usr/lib64/libc-2.32.so) + ==20== by 0x109328: main (test-perror2.c:72) + ==20== Block was alloc'd at + ==20== at 0x4839809: malloc (vg_replace_malloc.c:307) + ==20== by 0x48CA03F: __vasprintf_internal (in /usr/lib64/libc-2.32.so) + ==20== by 0x48A46F9: asprintf (in /usr/lib64/libc-2.32.so) + ==20== by 0x48E2184: strerror_l (in /usr/lib64/libc-2.32.so) + ==20== by 0x1092E2: main (test-perror2.c:67) + ==20== + ==20== Invalid read of size 1 + ==20== at 0x483DAC8: strcmp (vg_replace_strmem.c:847) + ==20== by 0x109414: main (test-perror2.c:84) + ==20== Address 0x4a1a3d1 is 1 bytes inside a block of size 17 free'd + ==20== at 0x483A9F5: free (vg_replace_malloc.c:538) + ==20== by 0x48E2134: strerror_l (in /usr/lib64/libc-2.32.so) + ==20== by 0x109328: main (test-perror2.c:72) + ==20== Block was alloc'd at + ==20== at 0x4839809: malloc (vg_replace_malloc.c:307) + ==20== by 0x48CA03F: __vasprintf_internal (in /usr/lib64/libc-2.32.so) + ==20== by 0x48A46F9: asprintf (in /usr/lib64/libc-2.32.so) + ==20== by 0x48E2184: strerror_l (in /usr/lib64/libc-2.32.so) + ==20== by 0x1092E2: main (test-perror2.c:67) + + I think it's the test that's invalid. + + This was reported as an actual grep test failure (without valgrind) on + 32-bit Arm, where glibc malloc happens to return a different buffer + address for the internal allocation (so that msg3 != msg4). + + test-strerror_r has the same issue. + + Thanks, + Florian + +Upstream patch: + + https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=175e0bc72808 + + From 175e0bc72808d564074c4adcc72aeadb74adfcc6 Mon Sep 17 00:00:00 2001 + From: Paul Eggert + Date: Thu, 27 Aug 2020 17:52:58 -0700 + Subject: [PATCH] perror, strerror_r: remove unportable tests + + Problem reported by Florian Weimer in: + https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html + * tests/test-perror2.c (main): + * tests/test-strerror_r.c (main): Omit unportable tests. + +This downstream patch is identical to upstream one modulo the ChangeLog entry. +--- + gnulib-tests/test-perror2.c | 3 --- + gnulib-tests/test-strerror_r.c | 3 --- + 2 files changed, 6 deletions(-) + +Index: gnulib-tests/test-perror2.c +=================================================================== +--- gnulib-tests/test-perror2.c.orig ++++ gnulib-tests/test-perror2.c +@@ -79,9 +79,6 @@ main (void) + errno = -5; + perror (""); + ASSERT (!ferror (stderr)); +- ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); +- ASSERT (msg2 == msg4 || STREQ (msg2, str2)); +- ASSERT (msg3 == msg4 || STREQ (msg3, str3)); + ASSERT (STREQ (msg4, str4)); + + free (str1); +Index: gnulib-tests/test-strerror_r.c +=================================================================== +--- gnulib-tests/test-strerror_r.c.orig ++++ gnulib-tests/test-strerror_r.c +@@ -165,9 +165,6 @@ main (void) + + strerror_r (EACCES, buf, sizeof buf); + strerror_r (-5, buf, sizeof buf); +- ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); +- ASSERT (msg2 == msg4 || STREQ (msg2, str2)); +- ASSERT (msg3 == msg4 || STREQ (msg3, str3)); + ASSERT (STREQ (msg4, str4)); + + free (str1);