rr-debugger / rr

Record and Replay Framework
http://rr-project.org/
Other
9.18k stars 585 forks source link

Syscallbuf doesn't correctly handle arg pointer to inaccessible memory #143

Open joneschrisg opened 11 years ago

joneschrisg commented 11 years ago

If any memory we try to record happens to be inaccessible, then the tracee will crash. Usually bad memory results in EFAULT or EINVAL being spit out. We can probably avoid changing semantics in most cases by being more careful, but it might be preferable to just defer to the --sound (i.e. slow) mode that's been proposed before.

rocallahan commented 11 years ago

The ultimate solution is probably to have the supervisor process catch the signal, see that it was triggered by the syscall-buffers code, and fix everything up.

This bug can be deferred of course.

joneschrisg commented 11 years ago

I just came across a cute trick: apparently msync()ing a (page-aligned) pointer can incidentally be used to tell if that page is mapped, whether or not it's backed by a file. I agree that it would still be better (i.e. faster in the common case) to handle bad pointers by trapping to rr.

joneschrisg commented 10 years ago

This doesn't appear to be much of a problem in practice.