fix FTBFS on 32-bit arches (#1800120)

Resolves: rhbz#1800120
This commit is contained in:
Joe Orton 2020-02-12 12:48:53 +00:00
parent e210879fdd
commit 0e0c958468
3 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,26 @@
get_rev_contents() has signed integer overflow with "long int" rev
and behaves unpredictably.
--- subversion-1.12.2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c.fsfspacktest
+++ subversion-1.12.2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
@@ -59,7 +59,8 @@
get_rev_contents(svn_revnum_t rev, apr_pool_t *pool)
{
/* Toss in a bunch of magic numbers for spice. */
- apr_int64_t num = ((rev * 1234353 + 4358) * 4583 + ((rev % 4) << 1)) / 42;
+ apr_int64_t rev64 = rev;
+ apr_int64_t num = ((rev64 * 1234353 + 4358) * 4583 + ((rev64 % 4) << 1)) / 42;
return apr_psprintf(pool, "%" APR_INT64_T_FMT "\n", num);
}
@@ -407,7 +408,8 @@
if (! svn_stringbuf_compare(rstring, sb))
return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
- "Bad data in revision %ld.", i);
+ "Bad data in revision %ld - [%s] not [%s].",
+ i, rstring->data, sb->data);
}
return SVN_NO_ERROR;

View File

@ -0,0 +1,35 @@
# ./pullrev.sh 1865987 1866588
http://svn.apache.org/viewvc?view=revision&revision=1865987
http://svn.apache.org/viewvc?view=revision&revision=1866588
--- subversion-1.12.2/subversion/libsvn_fs_fs/verify.c
+++ subversion-1.12.2/subversion/libsvn_fs_fs/verify.c
@@ -681,10 +681,10 @@
NULL,
_("p2l index entry for revision r%ld"
" at offset %s contains invalid item"
- " type %d"),
+ " type %u"),
start,
apr_off_t_toa(pool, offset),
- entry->type);
+ (unsigned int)entry->type);
/* There can be only one changes entry and that has a fixed type
* and item number. Its presence and parse-ability will be checked
@@ -694,11 +694,12 @@
return svn_error_createf(SVN_ERR_FS_INDEX_CORRUPTION,
NULL,
_("p2l index entry for changes in"
- " revision r%ld is item %ld of type"
- " %d at offset %s"),
+ " revision r%ld is item"
+ " %"APR_UINT64_T_FMT
+ " of type %u at offset %s"),
entry->item.revision,
entry->item.number,
- entry->type,
+ (unsigned int)entry->type,
apr_off_t_toa(pool, offset));
/* Check contents. */

View File

@ -45,7 +45,7 @@
Summary: A Modern Concurrent Version Control System
Name: subversion
Version: 1.12.2
Release: 6%{?dist}
Release: 7%{?dist}
License: ASL 2.0
URL: https://subversion.apache.org/
@ -61,6 +61,8 @@ Patch1: subversion-1.12.0-linking.patch
Patch2: subversion-1.12.2-py3tests.patch
Patch4: subversion-1.8.0-rubybind.patch
Patch5: subversion-1.8.5-swigplWall.patch
Patch6: subversion-1.12.2-r1865987+.patch
Patch7: subversion-1.12.2-fsfspacktest.patch
BuildRequires: autoconf, libtool, texinfo, which
BuildRequires: swig >= 1.3.24, gettext
%if %{with bdb}
@ -219,6 +221,8 @@ This package includes supplementary tools for use with Subversion.
%endif
%patch4 -p1 -b .rubybind
%patch5 -p1 -b .swigplWall
%patch6 -p1 -b .r1865987+
%patch7 -p1 -b .fsfspacktest
%build
# Regenerate the buildsystem, so that:
@ -540,6 +544,9 @@ make check-javahl
%endif
%changelog
* Wed Feb 12 2020 Joe Orton <jorton@redhat.com> - 1.12.2-7
- fix FTBFS on 32-bit arches (#1800120)
* Wed Feb 12 2020 Joe Orton <jorton@redhat.com> - 1.12.2-6
- conditionally package bdb tools in -tools