[Pkg-heka-maint] Bug#856177: lua-sandbox FTBFS on alpha (and hppa) due to test suite failure.

Michael Cree mcree at orcon.net.nz
Sun Feb 26 00:54:52 UTC 2017


Source: lua-sandbox
Version: 1.2.1-4
Severity: wishlist
User: debian-alpha at lists.debian.org
Usertags: alpha

lua-sandbox FTBFS on alpha due to a test-suite failure [1]

The following tests FAILED:
         11 - test_heka_sandbox (Failed)

Running that test manually reveals the failure occurs randomly at
line 376 and sometimes at line 464, both of which are asserts that
the mean or standard deviation in time incurred during running tests
is not zero.

The test suite uses the posix clock (clock_gettime()) but on Alpha
that clock has a resolution of the timer interrupt which is at best
about 1ms.  Since the test runs much faster than this a zero time
delta is often measured which the test suite detects and considers
to be a reason for failure.  On hppa the build fails at the same
test [2] and I presume it is probably for similar reasons.

Upstream is aware that there is an issue [3] however it seems one
cannot comment further there without obtaining a github login.

As an experiment I modified the code in src/util/util.c, function
lsb_get_time(), to be:

unsigned long long lsb_get_time()
{
#if defined(__alpha__) && defined(__linux__)
  return __builtin_alpha_rpcc() & 0xffffffffULL;
#elif defined(HAVE_CLOCK_GETTIME)
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
#elif ...

to use the processor cycle counter on Alpha which is a 32 bit register
that is incremented every CPU clock cycle.  With the above the test
suite passes on Alpha when run on a UP system.  However I am not
comfortable to recommend the above as a fix because:

1) It might break on an SMP system where every CPU has its own
cycle counter and there is no guarantee they are in sync, and no
guarantee that the start time is read on the same CPU as the stop
time.

2) The counter wraps back to zero after the 32 bits are exhuasted,
a period of about 7 to 8s on the system I tested, and only 3 to 4s
on the buildds.  If the above is used in any timing test longer than
that it could break.

3) The function might be exported from the library and the above might
break intended uses of the function.

Cheers
Michael.

[1] https://buildd.debian.org/status/fetch.php?pkg=lua-sandbox&arch=alpha&ver=1.2.1-4&stamp=1487927865&raw=0
[2] https://buildd.debian.org/status/fetch.php?pkg=lua-sandbox&arch=hppa&ver=1.2.1-4&stamp=1483652248&raw=0
[3] https://github.com/mozilla-services/lua_sandbox/issues/185



More information about the Pkg-heka-maint mailing list