1.21.2008

apple and dtrace: move along, nothing to see here

adam leventhal discovered that apple broke dtrace while trying to prevent some applications from being traced.
The notion of true systemic tracing was a bit too egalitarian for their classist sensibilities so they added this glob of lard into dtrace_probe() -- the heart of DTrace:
#if defined(__APPLE__)
/*
* If the thread on which this probe has fired belongs to a process marked P_LNOATTACH
* then this enabling is not permitted to observe it. Move along, nothing to see here.
*/
if (ISSET(current_proc()->p_lflag, P_LNOATTACH)) {
continue;
}
#endif /* __APPLE__ */
[i was tempted to say but at least they have dtrace, while linux developers are still scratching their heads and armpits but i won't. i just realized that they are now even at being differently clued.]

[update: landon fuller's fix]

1 comment:

Anonymous said...

Cry me a river :'(

It takes me 5 lines of GDB instructions to circumvent that. You want to step through iTunes in GDB or run DTrace on it, nothing could be simpler.

How it works? Won't tell you. A real developer knows how this works and who doesn't know should not play around with stuff like that.