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

Re: Crashes in 1.8.0 test suite on Solaris Sparc (wrong alignment in cache_lookup())

From: Ben Reser <ben_at_reser.org>
Date: Thu, 20 Jun 2013 17:16:19 +0200

Adding some missing details from IRC:
08:12 < rjung> breser: just for clarity: I'm building 32 Bit binaries.
08:12 < rjung> And I'm using gcc 4.7.2.
08:12 < rjung> The OS is 64 bit, just the svn binary is 32 Bits.

On Thu, Jun 20, 2013 at 4:43 PM, Rainer Jung <rainer.jung_at_kippdata.de>wrote:

> Hi there,
>
> I built and tested svn 1.8.0 today on Solaris 0 Sparc and got lots of
> test failures due to core dumps.
>
> The first few dumps I inspected all showed a bus error in
>
> #0 0xfe660760 in cache_lookup (path=0x10fce06 "/A/D/H/pi3", revision=3,
> cache=0x17c1820) at subversion/libsvn_fs_fs/tree.c:357
>
> The code is:
>
> for (i = 0; i + 4 <= path_len; i += 4)
> hash_value = hash_value * 0xd1f3da69 + *(const apr_uint32_t*)(path + i);
>
> >From similar problems with other software I expect this to be an
> alignment issue: the cast to apr_uint32_t* expects the pointer to point
> to an address divisible by four, but the string path can be located at
> any address in memory. In fact the cores show, that the address is not
> divisible by four.
>
> Sparc is especially picky about correct alignment, other platforms might
> have more relaxed rules.
>
> I guess you need to replace path by the next address divisible by 4 (and
> decrement path_len) accordingly) before running that loop.
>
> Regards,
>
> Rainer
>
Received on 2013-06-20 17:16:57 CEST

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