Your message dated Mon, 19 Feb 2018 22:23:59 +0000
with message-id <>
and subject line Bug#890813: fixed in faketime 0.9.7-2
has caused the Debian Bug report #890813,
regarding faketime does not work correctly on Alpha
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact

Debian Bug Tracking System
Contact with problems
--- Begin Message ---
Package: faketime
Version: 0.9.7-1
Severity: important
Tags: patch

The faketime package fails to work correctly on the Alpha
architecture. This failure of faketime to work correctly is the
reason for the mbedtls FTBFS, which uses faketime in its test
suite [1].

Consider the following test program (which I call "time-test"):

#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>

int main(void)
    struct timeval tv;

    for (int j=0; j<5; j++) {
        gettimeofday(&tv, NULL);
        printf("s=%ld    us=%ld\n", tv.tv_sec, tv.tv_usec);
    return 0;

When run it produces output like:

s=1519025990    us=838219
s=1519025990    us=848965
s=1519025990    us=859711
s=1519025990    us=870456
s=1519025990    us=881202

But when run as (with faketime built in its source directory):

LD_PRELOAD=faketime-0.9.7/src/ FAKETIME="-1d" ./time-test

the output is:

s=2199023743604    us=0
s=2199023657204    us=0
s=2199023570804    us=0
s=2199023484404    us=0
s=2199023398004    us=0

which is definitely not correct.

The reason for the incorrect behaviour is that there are two
gettimeofday symbols in libc on Alpha and the dlsym() call to link
to the gettimeofday() is picking up the function with the wrong ABI.
I attach a patch to fix that.  Faketime built with the attached
patch works correctly and with a fixed faketime the mbedtls source
package builds to completion on Alpha.



-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: alpha

Kernel: Linux 4.14.10-titan-p1+ (SMP w/3 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: faketime-0.9.7/src/libfaketime.c
--- faketime-0.9.7.orig/src/libfaketime.c       2018-02-19 07:57:52.000000000 
+++ faketime-0.9.7/src/libfaketime.c    2018-02-19 08:23:51.592643229 +1300
@@ -1658,7 +1658,11 @@
   real_lstat64 =            dlsym(RTLD_NEXT, "__lxstat64");
   real_time =               dlsym(RTLD_NEXT, "time");
   real_ftime =              dlsym(RTLD_NEXT, "ftime");
+#if defined(__alpha__) && defined(__GLIBC__)
+  real_gettimeofday =       dlvsym(RTLD_NEXT, "gettimeofday", "GLIBC_2.1");
   real_gettimeofday =       dlsym(RTLD_NEXT, "gettimeofday");
 #ifdef FAKE_SLEEP
   real_nanosleep =          dlsym(RTLD_NEXT, "nanosleep");
   real_usleep =             dlsym(RTLD_NEXT, "usleep");
@@ -1671,7 +1675,11 @@
   real___ftime =              dlsym(RTLD_NEXT, "__ftime");
+#  if defined(__alpha__) && defined(__GLIBC__)
+  real___gettimeofday =       dlvsym(RTLD_NEXT, "__gettimeofday", "GLIBC_2.1");
+#  else
   real___gettimeofday =       dlsym(RTLD_NEXT, "__gettimeofday");
+#  endif
   real___clock_gettime  =     dlsym(RTLD_NEXT, "__clock_gettime");
 #ifdef __APPLEOSX__

--- End Message ---
--- Begin Message ---
Source: faketime
Source-Version: 0.9.7-2

We believe that the bug you reported is fixed in the latest version of
faketime, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Daniel Kahn Gillmor <> (supplier of updated faketime 

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing

Hash: SHA512

Format: 1.8
Date: Mon, 19 Feb 2018 14:07:10 -0800
Source: faketime
Binary: faketime libfaketime
Architecture: source
Version: 0.9.7-2
Distribution: unstable
Urgency: medium
Maintainer: Daniel Kahn Gillmor <>
Changed-By: Daniel Kahn Gillmor <>
 faketime   - Report faked system time to programs (command-line tool)
 libfaketime - Report faked system time to programs (preload library)
Closes: 890813
 faketime (0.9.7-2) unstable; urgency=medium
   * git: convert branch naming to DEP-14
   * use correct gettimeofday() on alpha (Closes: #890813)
   * d/control: use Rules-Requires-Root: no
   * d/rules: enable hardening flags
   * use CPPFLAGS to fix hardening-no-fortify-functions
 b14be474d73c08ae339cd94fd4180f690ad53015 1317 faketime_0.9.7-2.dsc
 74c6875e51f8cb780746bbc5c780016720d6b99d 6132 faketime_0.9.7-2.debian.tar.xz
 bf84493a20624bb29bdc3927a30d039ced21adcf 6179 faketime_0.9.7-2_amd64.buildinfo
 933bd5a5c6c9959edb208e1d380bbb6b0b872a34e3df1538be614c9a54be1322 1317 
 b507f546cb1a096c6814d769cf0cf48bcbb579fd137120794eaa996c96931be8 6132 
 e8fd95ab1dc389939db7fc1b5d1c08c133c36d750b5bb1f40e3de66cdc94e387 6179 
 17fd5b75d259ab663fc891398fcf98de 1317 utils optional faketime_0.9.7-2.dsc
 b0a3fcc0aa459be6adf3ebb7cf706f33 6132 utils optional 
 811cc12ac95c9b7cf594487e48a046a3 6179 utils optional 



--- End Message ---

Reply via email to