Crash when recording clock_gettime

Robert O'Callahan robert at
Mon Aug 28 12:03:12 UTC 2017

On Mon, Aug 28, 2017 at 11:29 PM, Benjamin King <benjaminking at> wrote:

> Hi,
> 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.

Works for me here...

> 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.

Can you try it with system libc?

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

If it works in rr 4.5.0 you could bisect to find the regression.

Try recording with -n to see if this is related to syscall buffering.

Nothing else springs to mind immediately.

lbir ye,ea yer.tnietoehr  rdn rdsme,anea lurpr  edna e hnysnenh hhe uresyf
selthor  stor  edna  siewaoeodm  or v sstvr  esBa  kbvted,t
o l euetiuruewFa  kbn e hnystoivateweh uresyf tulsa rehr  rdm  or rnea
.a war hsrer holsa rodvted,t  nenh hneireseoouot.tniesiewaoeivatewt sstvr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rr-dev mailing list