Re: ptrace / task_for_pid / pid_suspend
Re: ptrace / task_for_pid / pid_suspend
- Subject: Re: ptrace / task_for_pid / pid_suspend
- From: Wade Tregaskis <email@hidden>
- Date: Wed, 30 Jun 2010 11:07:33 -0700
> Now to avoid this problem, we've taken step to disable ptrace(PT_DENY_ATTACH), task_for_pid for our daemon, and while we're at it, also pid_suspend introduced in 10.6.4.
If you subvert these mechanisms you will almost certainly break profiling tools and may cause other panics.
In future your process may be suspended by other means anyway, so your solution isn't future-proof.
> - what is Instruments (or DTTSecD ?) doing exactly ?
Whatever it wants. You should consider that any old DTrace script could also do all sorts of things with your app which would similarly run afoul of it. The bottom line is that you can't prevent a userspace thread from being interrupted, suspended or otherwise manipulated.
> - is there a better way to make sure the daemon is never suspended in any way ? (or know it in advance ?)
Don't rely on userspace being available. Use an appropriate timeout or other failsafes that will prevent deadlock.
If you'd like to detail how exactly you're deadlocking, I may be able to find you a better alternative.
Wade
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden