Source: subversion
Version: 1.9.4-1
Severity: important
Justification: fails to build from source (but built in the past)
Tags: patch
User: debian-al...@lists.debian.org
Usertags: alpha

subversion FTBFS on Alpha due to a test suite failure [1]:

START: utf-test
PASS:  lt-utf-test 1: test is_valid/last_valid
PASS:  lt-utf-test 2: test last_valid/last_valid2
PASS:  lt-utf-test 3: test svn_utf_cstring_to_utf8_ex2
PASS:  lt-utf-test 4: test svn_utf_cstring_from_utf8_ex2
PASS:  lt-utf-test 5: test svn_utf__normcmp
PASS:  lt-utf-test 6: test svn_utf__glob
PASS:  lt-utf-test 7: test svn_utf__fuzzy_escape
PASS:  lt-utf-test 8: test svn_utf__is_normalized
svn_tests: E235000: In file 
'/«PKGBUILDDIR»/subversion/tests/libsvn_subr/utf-test.c' line 807: assertion 
failed (0 == strcmp(result->data, tc->result))
FAIL:  lt-utf-test 9: test svn_utf__utf{16,32}_to_utf8
END: utf-test
ELAPSED: utf-test 0:00:00.603655

This failure occurs because the test suite allocates char aligned
strings in function test_utf_conversions() of file
subversion/tests/libsvn_subr/utf-test.c and passes those strings
to functions svn_utf__utf16_to_utf8() and svn_utf__utf32_to_utf8()
which are defined (in file subversion/libsvn_subr/utf.c) to take
apr_uint32_t * and apr_uint16_t * args respectively.  On
architectures with strict alignment requirements this is undefined
behaviour.  On Alpha, gcc likes to add bugs..., I mean, _optimise_
code, when the args are declared to be aligned by using a particular
CPU load instruction that neither traps nor gives correct results
if the args are not actually aligned.

I attach a patch that aligns the test strings in utf-test.c to be
aligned to apr_uint32_t (i.e. 32-bit alignment).  With that patch
subversion builds successfully to completion on Alpha.

Cheers
Michael.

[1] 
https://buildd.debian.org/status/fetch.php?pkg=subversion&arch=alpha&ver=1.9.4-1&stamp=1461928473
Index: subversion-1.9.4/subversion/tests/libsvn_subr/utf-test.c
===================================================================
--- subversion-1.9.4.orig/subversion/tests/libsvn_subr/utf-test.c       
2016-05-01 21:05:58.763536825 +1200
+++ subversion-1.9.4/subversion/tests/libsvn_subr/utf-test.c    2016-05-01 
21:05:58.755722518 +1200
@@ -745,7 +745,7 @@
   {
     svn_boolean_t sixteenbit;
     svn_boolean_t bigendian;
-    const char *source;
+    const _Alignas(apr_int32_t) char *source;
     const char *result;
   } tests[] = {
 

Reply via email to