New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse step over time(NULL) enters rr/src/preload/syscall_hook.S and leads to "Cannot find bounds of current function" #2088

Closed
cirosantilli opened this Issue Sep 8, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@cirosantilli

cirosantilli commented Sep 8, 2017

Program:

#include <time.h>

int main(void) {
    int i;
    i = 0;
    time(NULL);
    i = 1;
}

compile and run:

saii rr linux-tools-common linux-tools-generic linux-cloud-tools-generic
sudo cpupower frequency-set -g performance
sudo sysctl kernel.perf_event_paranoid=1
gcc -O'0' -g'gdb3' -o 'reverse.out' -pedantic-errors -std=c89 -Wextra 'reverse.c'
rr record reverse.out
rr replay

Then step up to i = 1, and then reverse step:

b main
c
n
n
rn

rr 5.0.0 and master @ 2c0c834 , Ubuntu 17.04 64bit kernel 4.10.0 behaviour: jumps to:

468 SYSCALLHOOK_START(_syscall_hook_trampoline_90_90_90)
469         call __morestack
470 SYSCALLHOOK_END(_syscall_hook_trampoline_90_90_90)

in rr/src/preload/syscall_hook.S and if I move around with n / rn I soon reach "Cannot find bounds of current function".

rr 4.1.0, Ubuntu 16.04 64bit kernel 4.4.0 behaviour:

0x00007f99c03bc671 in ?? () from /usr/bin/../lib/rr/librrpreload.so
─── Source ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─── Stack ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[0] from 0x00007f99c03bc671
(no arguments)
[1] from 0x00007ffc099d4eaa
(no arguments)
[2] from 0x00000000004004ef in main+25 at reverse.c:6
(no arguments)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>>> n
Cannot find bounds of current function
>>> 

I can still do rsi. A workaround is to manually put a breakpoint on the previous line and rc but it is inconvenient.

@rocallahan

This comment has been minimized.

Member

rocallahan commented Sep 8, 2017

rr 4.1.0 is incredibly old. Download a new release or build master. In particular, rr 5.0 makes sure to include symbols for /usr/bin/../lib/rr/librrpreload.so which should prevent this issue.

@rocallahan rocallahan closed this Sep 8, 2017

@cirosantilli

This comment has been minimized.

cirosantilli commented Sep 9, 2017

@rocallahan it still failed on master with a slightly different behaviour. Updated the description.

@cirosantilli cirosantilli changed the title from Reverse step over time(NULL) leads to Cannot find bounds of current function to Reverse step over time(NULL) enters rr/src/preload/syscall_hook.S and leads to "Cannot find bounds of current function" Sep 9, 2017

@rocallahan

This comment has been minimized.

Member

rocallahan commented Sep 9, 2017

Hmm yes, this is an interesting bug.

@rocallahan rocallahan reopened this Sep 10, 2017

@rocallahan

This comment has been minimized.

Member

rocallahan commented Sep 10, 2017

For some reason gdb with rr isn't picking up symbols for the VDSO.

@rocallahan

This comment has been minimized.

Member

rocallahan commented Sep 10, 2017

And that's because gdb is trying to get that info using /proc/.../maps and that isn't present, of course. gdb does try to get that file using the "target file reading" feature of the remote protocol, but we don't support that. We should.

@cirosantilli

This comment has been minimized.

cirosantilli commented Sep 11, 2017

Thanks, fix confirmed. 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment