rr-debugger / rr

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

Audit signal safety for vsyscall hooks #730

Closed joneschrisg closed 10 years ago

joneschrisg commented 10 years ago

Back when we were wrapping libc functions, we only had to worry about POSIX safety requirements. But now we're interposing on raw syscalls. Seen while debugging #217.

This gets a bit tricky because we can't make all the syscalls require async-signal-safety, or else we'll never be able to initialize syscallbuf. The solution might be to somehow detect a safe init point from the tracer and do the work there.

Need a workable solution for 0.4.

joneschrisg commented 10 years ago

So I think making all the hooks async-signal-safe is the only sane way to maintain this code. Here's how I see this working

In that scheme, initialization is only done from no-signal-safety contexts. All of the hooks themselves are already async-signal-safe (except for implicit init, which dies here).

The two downsides/TODOs are

joneschrisg commented 10 years ago

Now that task cleanup is done in rr, we don't need to load the preload lib in the child. So we can go back to the clearer name and simplify the impl a bit.