[CELT-dev] ectest failed with gcc-4.2.4

Timothy B. Terriberry tterribe at email.unc.edu
Sat Dec 20 19:00:12 PST 2008


Rob Til Freedmen wrote:
> cut after some 'Decoded 0 instead of 1 with ft of 2. ' lines

I mostly wanted to see if it got any errors after "Testing random
streams...", but my compilation of gcc 4.2.4 has finished and I can now
reproduce the problem, and it's our fault. This would have been a nasty
one to find ourselves, since it's caused by undeterministic behavior of
an x86 instruction, so thank you very much for the report.

The test case is covering more cases than libcelt actually uses, so the
problem is not a real problem (i.e., your build of libcelt should still
be okay). However, try applying the following patch in libcelt and let
me know if it fixes the problem:

--- entdec.c.orig       2008-12-20 21:52:22.000000000 -0500
+++ entdec.c    2008-12-20 21:52:42.000000000 -0500
@@ -107,7 +107,7 @@
   int       ftb;
   t=0;
   _ft--;
-  ftb=EC_ILOG(_ft);
+  ftb=EC_ILOG(_ft)&-!!_ft;
   if(ftb>EC_UNIT_BITS){
     ftb-=EC_UNIT_BITS;
     ft=(unsigned)(_ft>>ftb)+1;

In a future release, we will instead change the test case and add the
appropriate celt_assert() checks to ensure our assumptions are not
violated here.



More information about the celt-dev mailing list