[Pkg-kde-extras] Bug#592142: ctemplate: FTBFS on sparc: 10 of 20 tests failed

Jurij Smakov jurij at wooyd.org
Sun Aug 8 19:54:52 UTC 2010


On Sun, Aug 08, 2010 at 10:27:05AM +1000, Mark Purcell wrote:
> On Sunday 08 August 2010 04:42:21 Cyril Brulebois wrote:
> > | 10 of 20 tests failed
> 
> KiBi,
> 
> Thanks for the report.
> 
> This is a pain as we have turned on the check tests target in -2, and it is only failing on sparc with a bus error, so I suspect it isn't the code, but rather the stress of the tests. I have forwarded to google to see if they have a view.
> 
> Should I disable tests for sparc only?
> 
> Mark

This turned out to be fairly easy to track down. The memory for 
TemplateDictionary class is allocated in src/template_dictionary.cc 
using AllocAlign, with the alignment set to sizeof(void *). In this 
case it is not sufficient, because, for example, TemplateDictionary 
has a name_ field, which is a TemplateString, which, in turn has an 
id_ field, which is u_int64_t. The 8-byte size of id_ imposes 8-byte 
alignment requirement on objects of all parent classes, including 
TemplateDictionary, and in this case it's not happening, as 
sizeof(void *) is 4 on sparc. So, when id_ needs to be zeroed out 
(which happens when it's set to kIllegalId), compiler uses clrx (clear 
extended word) instructions, which operates on an 8-byte memory 
region, which it expects to be 8-byte aligned.

I've noticed that arena.h already has a kDefaultAlignment variable 
which is set correctly depending on the architecture, so I've cooked 
up a simple patch (attached) to use it instead of hardcoded 
sizeof(void *) for allocations in template_dictionary.cc. With this 
patch the package builds fine in up-to-date sid.

By the way, according to http://code.google.com/p/google-ctemplate/ 
the upstream address is google-ctemplate at googlegroups dot com.

Best regards,  
-- 
Jurij Smakov                                           jurij at wooyd.org
Key: http://www.wooyd.org/pgpkey/                      KeyID: C99E03CC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctemplate.patch
Type: text/x-diff
Size: 1918 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-kde-extras/attachments/20100808/fe25885a/attachment-0001.patch>


More information about the pkg-kde-extras mailing list