[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: random-test failure on powerpc64le and x86_64

From: Branko Čibej <brane_at_wandisco.com>
Date: Sat, 09 Aug 2014 20:08:21 +0200

On 09.08.2014 15:55, Alan Modra wrote:
> Using current git sources compiled with gcc-4.9.1 or mainline gcc at
> -O3 results in failure of random-test.
> On powerpc64le we see
> PASS: random-test 1: random delta test
> svn_tests: E200006: mismatch at position xxxxx
> FAIL: random-test 2: random combine delta test
> x86_64 gives
> PASS: random-test 1: random delta test
> svn_tests: E200006: Test crashed (run in debugger with '--allow-segfaults')
> FAIL: random-test 2: random combine delta test
> After some digging, I narrowed the failure down to
> subversion/libsvn_delta/text_delta.c, and the specific -O3 options
> causing the failure to -ftree-loop-vectorize -fvect-cost-model=dynamic.
> At first I thought I'd found a vectorizer bug, but the real problem is
> a bug in the source, specifically this line in patterning_copy:
> *(apr_uint32_t *)(target) = *(apr_uint32_t *)(source);
> Quoting from ISO/IEC 9899:1999
> Pointers
> ...
> 7 A pointer to an object or incomplete type may be converted to a
> pointer to a different object or incomplete type. If the resulting
> pointer is not correctly aligned for the pointed-to type, the behavior
> is undefined.
> So here we have undefined behaviour if "source" and "target" are not
> 4-byte aligned.. Fixed as follows.

Nope. This code won't fly because it's not portable across compilers and

The way to fix this is to make sure that the macro
SVN_UNALIGNED_ACCESS_IS_OK gives the correct answer; and it's OK if that
answer compiler-specific, not just platform-specific. In other words,
it's fine if the macro gives a different answer depending on GCC
vectorizer options.

-- Brane

Branko Čibej | Director of Subversion
WANdisco | Realising the impossibilities of Big Data
e. brane_at_wandisco.com
Received on 2014-08-09 20:08:41 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.