Comment 2 for bug 2059078

Revision history for this message
Simon Chopin (schopin) wrote :

The failure is because bash, for some reason, still links against gettimeofday rather than __gettimeofday64, and calls that to seed its internal random number generator. I still can't figure out why it's using the old version, though.

ubuntu@noble-armhf:~$ readelf -W -s a.out | grep timeof # a simple test program that just calls gettimeofday()
     9: 00000000 0 FUNC GLOBAL DEFAULT UND __gettimeofday64@GLIBC_2.34 (2)
    98: 00000000 0 FUNC GLOBAL DEFAULT UND __gettimeofday64@GLIBC_2.34
ubuntu@noble-armhf:~$ readelf -W -s /bin/bash | grep timeof
   105: 00000000 0 FUNC GLOBAL DEFAULT UND gettimeofday@GLIBC_2.4 (2)

faketime redefines gettimeofday, except that it uses the timeval definition from glibc which is of course using 64bit time_t. Mayhem ensues.