On Fri, Mar 04, 2016 at 02:39:38AM +0300, Dmitry V. Levin wrote:
> On Wed, Mar 02, 2016 at 09:29:24PM -0500, Rich Felker wrote:
> > On Thu, Mar 03, 2016 at 05:16:18AM +0300, Dmitry V. Levin wrote:
> > > On Wed, Mar 02, 2016 at 08:28:30PM -0500, Rich Felker wrote:
> [...]
> > > > What should be done about daemonized tracer mode?
> > > 
> > > If we could switch stack before clone and then switch stack back in the
> > > child process, it would be a relatively simple change.
> > > Otherwise I don't see any simple options.
> > 
> > I think it's possible to switch stack in the parent via sigaltstack
> > and raise, after which the cloned child can longjmp back to the stack
> > that was the parent's.
> 
> This might work.  Whatever signal is chosen, its handler and mask would
> have to be restored before the final execve call.

The handler and mask could be restored before even calling clone;
actually, the whole machinery could be implemented as a wrapper for
clone that lets you pick whether the child runs a new function on a
new stack with the parent returning (like normal clone) or the parent
runs a new function on a new stack (with the child returning).

> > Alternatively the child could just re-enter
> > main() on a new stack with a global var set to indicate that it's the
> > tracer child.
> 
> I think it would be too risky to let the main bulk of strace code run
> on the new stack.

Just in terms of stack size available? Or something else?

Rich

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to