Apple Quietly Fixes DTrace
In January we discussed a blog entry revealing that Apple had "crippled" its DTrace port. As the author notes in a followup post, to say that DTrace had been "crippled" was at least overstated: "Unfortunately, most reactions seized on a headline paraphrasing a line of the post — albeit with the critical negation omitted." In an updated entry, the poster notes that Apple has made good (so we have too): "One issue was that timer based probes wouldn't fire if certain applications were actively executing (e.g. iTunes). This was evident both by counting periodic probe firings, and by the absence of certain applications when profiling. The good news is that Apple has (quietly) fixed the problem in Mac OS X 10.5.3."
These sort of concurrency issues are bad enough when they're bug in your *own* code. When it's stuff in other apps producing what appears to be strange behaviour in your own (perfectly fine) code, that's a BIG problem.
This sort of issue wouldn't survive for a week on Linux.
It's not exactly rocket surgery.
This was blogged about some days ago, but I'm glad that the news is out.
DTrace is used in all sorts of interesting ways. On the Belenix project, for e.g., we've sped up the LiveCD boot enormously, and this innovative use of DTrace is now part of the Distro Constructor Toolkit at opensolaris.org.
On my Dell D620, Belenix boots in about 3 and a half minutes (with KDE), while Ubuntu 7.10 boots up in about 8 minutes.
-- Sriram
http://www.belenix.org/
http://dynamicproxy.livejournal.com/
Your evilness index has just dropped from 45.8 to 45.3
Keep up the good work!
---
"The chances of a demonic possession spreading are remote -- relax."
Are you really going to sit there and tell me that there are no bugs in Windows (or Linux) more than five months old? Don't be ridiculous.
how long was that Vista service pack? A year and a half? Yeah I thought so.
"Slashdot, where telling the truth is overrated but lying is insightful."
...and slashdot bends over backwards to apologise for ever doubting them.
You'd never see that happening if the same thing applied to Microsoft.
What is the connotation of "quietly" supposed to be in stories like this? (Not just with Apple.) It seems like a weasel word. Is the intention to give the impression that Apple embarrassedly corrected themselves, or that they were forced to give into pressure from the developer community, but don't have the cojones to admit it, or what? Because, anyone honestly expecting something other than a "quiet" fix is deluded. Is a bug fix in DTrace supposed to get a slide at a Stevenote or something?
What did you want, a friggin' parade?
Jeez, give a fruit a break.
No, but I did throw granola at a deaf person once
Don't use xcode?
Seriously, unless you are developing Cocoa(or Carbon) apps, there is very little reason to use XCode. There are better free software programs out there for writing c++ code, not to mention you could always just call good ol' gcc on the command line....
Monstar L
Lifted from http://developer.apple.com/qa/qa2001/qa1118.html because I know no one will RTFA
Q: I'm trying to link my binary statically, but it's failing to link because it can't find 'crt0.o.' Why?
A: Static linking of user binaries is not supported on Mac OS X. Tying user binaries to the internal implementation of Mac OS X libraries and interfaces would limit our ability to update and enhance Mac OS X. Instead, dynamic linking is supported (linking against crt1.o automatically instead of looking for crt0.o, for example).
We strongly recommend that you consider the limitations of statically linking very carefully, and consider your customer and their needs, plus the long-term support you will need to provide. Apple provides support and attempts to insure complete compatibility through the published APIs, but cannot insure that compatibility in a statically linked project. Any change to Mac OS X, in a system update, security update, or major revision, may break statically linked code.
If your project absolutely must link statically and need crt0.o, you can get the Csu module from Darwin and try building crt0.o statically. Please bear in mind that you must then clearly specify to your customers the compatibility risks involved in installing a product that relies on statically linked code.
No, but I did throw granola at a deaf person once
There are of course system calls (both BSD-style and Mach-style ones), but they are undocumented and can change from one Mac OS X version to another (even between minor system updates). The reason is that Apple wants to have and keep full freedom in changing the systemuser space interface at any time it wants whenever that's convenient for whatever reason (performance, security, getting rid of legacy cruft,
So if you'd statically link a program, it would be linked to a particular libc version which in turn would use the system calls as they work on the particular version of Mac OS X this libc version was compiled for. The end result would be that your program would only be guaranteed to function correctly on that particular OS revision.
libc's interface on the other hand is kept backwards compatible between OS revisions, so as long as you dynamically link against it, your program will work fine on pretty much any OS version out there (except if you use APIs which didn't exist yet in older versions).
This is more or less the opposite case as on e.g. Linux, where glibc breaks binary compatibility every other full moon (so you need to distribute different binaries for different glibc versions if you want to link dynamically to it), but the kernel's system call interface is pretty much guaranteed to remain backwards compatible for a very long time (so statically linked binaries are generally much more portable across distributions â" the downside is that you then should link everything statically because installed dynamic libraries may rely on features provided by a newer glibc than the one you statically linked, and in case of e.g. a KDE or GNOME app you'd end up with immense binaries).
Donate free food here
I'm sick of boot times measured in minutes.
What is this, 1980?
So.... I guess this won't be the Year of the Linux Desktop?
Towards the Singularity.
True, if not for the fact that it's not a bug but rather the intentional behaviour of Apple's version of DTrace. What other reasons do you have? I'm very happy with OSX for home use. Issues like this don't bother me because I'm not trying to reverse engineer the DRM in iTunes - in fact I don't even use iTunes, I use VLC.
which is totally what she said
I still contend that ld is fucked-up... they have changed it.
How many people here where actually affected by the D-Trace bug in OS X. I'd be willing to lay down 100 bucks that say 90% of the people that complained had no idea the bug was there until the story was posted ... including you. So why get so high and mighty about something doesn't even change your day to day activities. Seriously I own a Mac and I write software on it from time to time but does some missing functionality in D-Trace make a difference NO!
Its just another reason for D-Bags like you to make a stink.
No they haven't. They just didn't provide the static libc. If you install the static libc, you can compile static binaries. What does that have to do with ld?
Isn't Windows one big bug? :P
Apple designed their port of DTrace so that any program could "opt-out" of profiling if the developers are concerned about reverse-engineering. An unintended consequence of this was that it sometimes broke profiling of other apps while those apps were running. They've fixed that bug in their implementation of crippling, but that doesn't mean they've un-crippled it.
It's a big step forward, because now at least developers can properly profile their own code. However, one of the purposes of DTrace is to profile _anybody's_ code, in order for example to diagnose performance problems on your computer perhaps caused by those programs. Apple has intentionally left that feature out. So it's arguably still pretty crippled.
There are still several apps to which you can not attach DTrace, such as iTunes. The issue described in the first blog post hasn't been corrected, you can still set NOATTACH and your process is then untraceable. (Not that shitty movie, but you know what I mean.)
The issue isn't (really) that timer counts are wrong, but instead, the far more interesting thing is that there are "special" processes that you can't touch and everyone is now suddenly OK with that because the timers count correctly.
They should still be able to beat 1980 floppy boot times using a CD-ROM.
Yes, I know they're doing a lot more than in 1980.
That's the problem. How much of what they're doing is necessary?
$ make
JOIN US FOR PONG!
The previous discussion generated hundreds of posts within a few hours, and topped out at 476. This one is at 60 comments after 3 hours and will be lucky to break 100. If you've ever wondered why Slashdot posts flamebait stories, there's your answer. "If it bleeds it leads."
Build a man a fire, he's warm for one night. Set him on fire, and he's warm for the rest of his life.
Any idea when they'll fully implement ptrace() or is that not on the table?
...for those fanbois who still feel the need to personally thank Uncle Steve, he is currently bent over in reception with his trousers round his ankles waiting for you.
Gentoo Linux - another day, another USE flag.
The the gp was a troll. For what he/she wants to do you can just copy the archive you need and then do cc foo.a bar.o and then ./a.out and it runs fine. I do it all the time to make big static binaries that run on vanilla OS X.
So just as a tought experiment, what's to keep me from compiling code that sets this flag and then
using oh I dunno any hex dump program to see what the system call and parameters looks like?
Once I know that pattern I can easily patch any binary in the system with perl and remove the offending
system call by instead setting the syscall parameter to a safe value, substituting in NOPs, etc.
I guess what Apple is saying is they don't want casual dtracing of their binaries because anyone
savvy enough can remove the system call, as of course they still have root.
Unless OS X supports hardware-enforced signed binaries, of course. Which it doesn't.
That's not really a static binary. It's statically linked to one library, and not the system library. The system library can't be statically linked in Mac OS X for reasons given in another branch of this thread.
God save our Queen, and Heaven bless The Maple Leaf Forever!
So I should write a program that knows how to compile my program then? This is an improvement over Xcode how?
Culture is more than commerce
If you like XCode, and don't see the need to ever not use it, then it's probably not an improvement. And the people using MSVS probably aren't building makefiles, either. So what? But it's an improvement over "manually invoking" gcc, which is what the AC was talking about. It's also not tied into a specific IDE, which may or may not be important to you.
In any case, it has nothing to do with the OP's issue...
JOIN US FOR PONG!
Have you ever seen the linux kernel sources? Many, many files. Or the emacs sources, or the gcc sources? Many people working/leading these projects use vi/emacs and make. They are not dumb. Many of them have tried the alternatives and gone back to tools that do what they want. I can honestly not believe that any one development tool can be optimal for all programmers simultaneously. So if you dig Xcode, that's fine -- many people do. Many people like a good text editor and a Makefile and really don't suffer for it.
Languages aren't inherently fast -- implementations are efficient
Agreed - linux binary compatibility - now theres an oxymoron.
using reason and facts will just confuse them. Macs suck this week, please read the memo.
--
$tar -xvf
I work with hundred thousand files and compile from the command line (a single command even):
$ make
does the trick at the top directory. Yes, that means you have to maintain the makefile but that's not that hard to do and is not done daily or even weekly.
As the island of our knowledge grows, so does the shore of our ignorance.
Write a simple c or c++ hello_word program
On the other hand, try this. Create a new project in Xcode. Open mainmenu.nib in Interface Builder. Drag an NSTextView to a window, save, compile, run. Result - a complete functional word processor. You can even type "hello world" into it if you want.
Fuckwit.
And, to the extent that it's supported on Solaris, there's no guarantee that a binary statically linked in Solaris N will run correctly in Solaris N+1.
OS X's and Solaris's ABI's are defined in terms of calls to routines in dynamically-linked libraries, not in terms of system calls.
There may well be other UN*Xes that work the same way. I have the impression that's how Windows works, as well. This allows the implementation of routines in those dynamically-linked libraries to change, as long as the binary interface remains the same.