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

2010-08-08 Thread brian m. carlson
On Sun, Aug 08, 2010 at 10:27:05AM +1000, Mark Purcell wrote:
 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.

No, it most likely is the code.  On sparc, a bus error almost always
means an unaligned memory access.  Accessing an n-byte quantity must
happen at a memory address that is a multiple of n.  You may want to use
a sparc porter machine to see where the fault occurs and fix it.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature
___
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras

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

2010-08-08 Thread Jurij Smakov
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   ju...@wooyd.org
Key: http://www.wooyd.org/pgpkey/  KeyID: C99E03CC
diff -aur a/src/template_dictionary.cc b/src/template_dictionary.cc
--- a/src/template_dictionary.cc	2010-04-08 20:42:46.0 +0100
+++ b/src/template_dictionary.cc	2010-08-08 20:27:55.0 +0100
@@ -87,9 +87,8 @@
   arena_-Free(p, n * sizeof(T));
 }
 
-// TODO(csilvers): sizeof(void*) may be too big.  But is probably ok.
 /*static*/ templateclass T const int ArenaAllocatorT::kAlignment =
-(1 == sizeof(T) ? 1 : sizeof(void*));
+(1 == sizeof(T) ? 1 : BaseArena::kDefaultAlignment);
 
 // --
 // TemplateDictionary::map_arena_init
@@ -123,7 +122,7 @@
   if (*dict != NULL)
 return;
   // Placement new: construct the map in the memory used by *dict.
-  void* buffer = arena_-AllocAligned(sizeof(**dict), sizeof(void*));
+  void* buffer = arena_-AllocAligned(sizeof(**dict), BaseArena::kDefaultAlignment);
   new (buffer) T(arena_);
   *dict = reinterpret_castT*(buffer);
 }
@@ -138,7 +137,7 @@
 }
 
 inline TemplateDictionary::DictVector* TemplateDictionary::CreateDictVector() {
-  void* buffer = arena_-AllocAligned(sizeof(DictVector), sizeof(void*));
+  void* buffer = arena_-AllocAligned(sizeof(DictVector), BaseArena::kDefaultAlignment);
   // Placement new: construct the vector in the memory used by buffer.
   new (buffer) DictVector(arena_);
   return reinterpret_castDictVector*(buffer);
@@ -149,7 +148,7 @@
 UnsafeArena* arena,
 TemplateDictionary* parent_dict,
 TemplateDictionary* template_global_dict_owner) {
-  void* buffer = arena-AllocAligned(sizeof(TemplateDictionary), sizeof(void*));
+  void* buffer = arena-AllocAligned(sizeof(TemplateDictionary), BaseArena::kDefaultAlignment);
   // Placement new: construct the sub-tpl in the memory used by tplbuf.
   new (buffer) TemplateDictionary(name, arena, parent_dict,
   template_global_dict_owner);
___
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras

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

2010-08-07 Thread Cyril Brulebois
Source: ctemplate
Version: 0.97-2
Severity: serious
Justification: FTBFS
User: debian-sp...@lists.debian.org
Usertags: sparc

Hi,

your package FTBFS this way on sparc:
| make  check-TESTS
| make[3]: Entering directory 
`/build/buildd-ctemplate_0.97-2-sparc-OpT11k/ctemplate-0.97'
| PASS.
| PASS: compile_test
| PASS.
| PASS: compile_nothreads_test
| /bin/bash: line 4: 16189 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_test_util_test
| /bin/bash: line 4: 16194 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_test_util_nothreads_test
| /bin/bash: line 4: 16199 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_dictionary_unittest
| /bin/bash: line 4: 16204 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_dictionary_nothreads_unittest
| /bin/bash: line 4: 16209 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_modifiers_unittest
| /bin/bash: line 4: 16214 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_modifiers_nothreads_unittest
| PASS
| PASS: template_setglobals_unittest
| PASS
| PASS: template_setglobals_nothreads_unittest
| WARNING: Unable to locate file /yakakak
| WARNING: Unable to locate file /yakakak
| ERROR: Failed to load included template: 
/tmp/template_unittest_dir/template.005
| ERROR: Failed to load included template: 
/tmp/template_unittest_dir/template.005
| WARNING: Unable to locate file template_foo
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file /tmp/template_unittest_dir/b/template.010
| WARNING: Unable to stat file 
| WARNING: Unable to stat file /tmp/template_unittest_dir/b/template.010
| WARNING: Unable to locate file /tmp/template_unittest_dir/b/template.010
| WARNING: Unable to stat file 
| WARNING: Unable to locate file MY_KEY
| WARNING: Unable to locate file MY_KEY
| ERROR: Failed to load included template: 
/tmp/template_unittest_dir/a/template.022
| DONE
| PASS: template_cache_test
| WARNING: Unable to locate file /yakakak
| WARNING: Unable to locate file /yakakak
| ERROR: Failed to load included template: 
/tmp/template_unittest_dir/template.005
| ERROR: Failed to load included template: 
/tmp/template_unittest_dir/template.005
| WARNING: Unable to locate file template_foo
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file TestRemoveStringFromTemplateCache
| WARNING: Unable to locate file /tmp/template_unittest_dir/b/template.010
| WARNING: Unable to stat file 
| WARNING: Unable to stat file /tmp/template_unittest_dir/b/template.010
| WARNING: Unable to locate file /tmp/template_unittest_dir/b/template.010
| WARNING: Unable to stat file 
| WARNING: Unable to locate file MY_KEY
| WARNING: Unable to locate file MY_KEY
| ERROR: Failed to load included template: 
/tmp/template_unittest_dir/a/template.022
| DONE
| PASS: template_cache_nothreads_test
| /bin/bash: line 4: 16231 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_unittest
| /bin/bash: line 4: 16236 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_nothreads_unittest
| /bin/bash: line 4: 16241 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_regtest
| /bin/bash: line 4: 16246 Bus error   TEMPLATE_ROOTDIR=. ${dir}$tst
| FAIL: template_nothreads_regtest
| DONE.
| PASS: htmlparser_test
| DONE.
| PASS: htmlparser_nothreads_test
| DONE.
| PASS: statemachine_test
| DONE.
| PASS: generate_fsm_c_test
| ==
| 10 of 20 tests failed
| Please report to opensou...@google.com
| ==
| make[3]: *** [check-TESTS] Error 1

Full build logs:
  https://buildd.debian.org/status/package.php?p=ctemplate

Mraw,
KiBi.



___
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras


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

2010-08-07 Thread Mark Purcell
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


signature.asc
Description: This is a digitally signed message part.
___
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras