Crash when recording clock_gettime

Benjamin King benjaminking at
Mon Aug 28 11:29:03 UTC 2017


using rr from git (c774fc19) to record the following program.

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

int main()
  struct timeval tv;
  gettimeofday( &tv, NULL ); // <-- ok

  struct timespec ts;
  clock_gettime( CLOCK_REALTIME, &ts ); // <-- Crashes in libc

The call to clock_gettime crashes in libc, but only when recording *and* linking libc dynamically.
Running without rr or linking libc statically avoids the crash.

GDB says the crash occurs on a RIP-relative mov with a largish offset within libc:
  0x7ff76285ff00 <clock_gettime>          mov    0x2b3f11(%rip),%rax        # 0x7ff762b13e18

My libc is custom built with frame pointers but without further modifications.

I have not seen this with an earlier release of rr yet. Any ideas?

  Benjamin King

More information about the rr-dev mailing list