Package: rr
Version: 5.3.0-2
Severity: normal
Tags: upstream fixed-upstream


Dear Maintainer,
while investigating a different bug I found rr failed for
me inside a current testing VM inside a call to clock_getres,
while inside a similar stable VM it succeeds.

I think this got reported and fixed upstream already in [1].
There it was explained by newer libc versions now
using VDSO for clock_getres.

A build from rr git head yesterday was working in testing.
Unfortunately there was not yet a new release containing that fix.

Kind regards,
Bernhard

[1] https://github.com/mozilla/rr/issues/2428
# Bullseye/testing amd64 qemu VM 2020-08-19


apt update
apt dist-upgrade


apt install systemd-coredump gdb rr coreutils-dbgsym


echo 1 > /proc/sys/kernel/perf_event_paranoid


cat <<EOF > /tmp/test.py
import time
clk_id1 = time.CLOCK_REALTIME
precision1 = time.clock_getres(clk_id1)
print("Precision of system-wide real-time clock:", precision1)
EOF

/usr/bin/rr /usr/bin/python3.8 /tmp/test.py

/usr/bin/rr replay /root/.local/share/rr/python3.8-1



root@debian:~# /usr/bin/rr /usr/bin/python3.8 /tmp/test.py
rr: Saving execution to trace directory `/root/.local/share/rr/python3.8-1'.
Speicherzugriffsfehler
root@debian:~# /usr/bin/rr replay /root/.local/share/rr/python3.8-1
GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 
/root/.local/share/rr/python3.8-1/mmap_hardlink_3_python3.8...
(No debugging symbols found in 
/root/.local/share/rr/python3.8-1/mmap_hardlink_3_python3.8)
Really redefine built-in command "restart"? (y or n) [answered Y; input not 
from terminal]
Remote debugging using 127.0.0.1:991
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from 
/usr/lib/debug/.build-id/63/7706dbbbd112d03fbad61ca30125b48e60aa92.debug...
0x00007fbd57400090 in _start () from /lib64/ld-linux-x86-64.so.2
(rr) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffeb81f9d25 in clock_getres ()
(rr) bt
#0  0x00007ffeb81f9d25 in clock_getres ()
#1  0x00007fbd5710bb91 in __clock_getres (clock_id=0, res=0x7ffeb81f3760) at 
../sysdeps/unix/sysv/linux/clock_getres.c:37
#2  0x00000000004c1c72 in ?? ()
#3  0x0000000000520ed6 in PyCFunction_Call ()
#4  0x0000000000510243 in _PyObject_MakeTpCall ()
#5  0x000000000050a847 in _PyEval_EvalFrameDefault ()
#6  0x0000000000503b25 in _PyEval_EvalCodeWithName ()
#7  0x00000000005ce503 in PyEval_EvalCode ()
#8  0x00000000005ec461 in ?? ()
#9  0x00000000005e7a5f in ?? ()
#10 0x00000000005f0377 in PyRun_FileExFlags ()
#11 0x00000000005efdb0 in PyRun_SimpleFileExFlags ()
#12 0x00000000005e4f45 in Py_RunMain ()
#13 0x00000000005c3899 in Py_BytesMain ()
#14 0x00007fbd5706ccca in __libc_start_main (main=0x5c3860 <main>, argc=2, 
argv=0x7ffeb81f3d28, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>, stack_end=0x7ffeb81f3d18)
    at ../csu/libc-start.c:308
#15 0x00000000005c379a in _start ()
(rr) disassemble
Dump of assembler code for function clock_getres:
   0x00007ffeb81f9d10 <+0>:     cmp    $0xf,%edi
   0x00007ffeb81f9d13 <+3>:     ja     0x7ffeb81f9d65 <clock_getres+85>
   0x00007ffeb81f9d15 <+5>:     lea    -0x4c9c(%rip),%rax        # 
0x7ffeb81f5080
   0x00007ffeb81f9d1c <+12>:    lea    -0x1ca3(%rip),%rdx        # 
0x7ffeb81f8080
   0x00007ffeb81f9d23 <+19>:    mov    %edi,%ecx
=> 0x00007ffeb81f9d25 <+21>:    cmpl   $0x7fffffff,-0x4cab(%rip)        # 
0x7ffeb81f5084
   0x00007ffeb81f9d2f <+31>:    cmovne %rax,%rdx
   0x00007ffeb81f9d33 <+35>:    mov    $0x1,%eax
   0x00007ffeb81f9d38 <+40>:    shl    %cl,%eax
   0x00007ffeb81f9d3a <+42>:    test   $0x893,%eax
   0x00007ffeb81f9d3f <+47>:    jne    0x7ffeb81f9d5d <clock_getres+77>
   0x00007ffeb81f9d41 <+49>:    test   $0x60,%al
   0x00007ffeb81f9d43 <+51>:    je     0x7ffeb81f9d65 <clock_getres+85>
   0x00007ffeb81f9d45 <+53>:    mov    $0x3d0900,%eax
   0x00007ffeb81f9d4a <+58>:    test   %rsi,%rsi
   0x00007ffeb81f9d4d <+61>:    je     0x7ffeb81f9d6d <clock_getres+93>
   0x00007ffeb81f9d4f <+63>:    mov    %rax,0x8(%rsi)
   0x00007ffeb81f9d53 <+67>:    xor    %eax,%eax
   0x00007ffeb81f9d55 <+69>:    movq   $0x0,(%rsi)
   0x00007ffeb81f9d5c <+76>:    retq   
   0x00007ffeb81f9d5d <+77>:    mov    0xe8(%rdx),%eax
   0x00007ffeb81f9d63 <+83>:    jmp    0x7ffeb81f9d4a <clock_getres+58>
   0x00007ffeb81f9d65 <+85>:    mov    $0xe5,%eax
   0x00007ffeb81f9d6a <+90>:    syscall 
   0x00007ffeb81f9d6c <+92>:    retq   
   0x00007ffeb81f9d6d <+93>:    xor    %eax,%eax
   0x00007ffeb81f9d6f <+95>:    retq   
End of assembler dump.
(rr) kill
Kill the program being debugged? (y or n) y
[Inferior 1 (process 980) killed]
(rr) q

Reply via email to