Silly Kernel Panic in Mac OS X 10.2.2
shibby tells us that it is easy to cause a kernel panic in Mac OS X 10.2.2, by attempting to move a directory into the same location as another one of the same name, using Terminal: mkdir ~/mydir; cd ~/mydir; mkdir mydir; mv mydir ... Kernel panic is instant. Save all your documents and quit your open apps if you feel the need to see it for yourself. Happy Thanksgiving!
Apple has a bug. This is amazing news. FP
Reliable, Great Value Hosting: $7.95/mo 2.4G/120G
Please tell me that shibbey or pudge...or someone... actually submitted this bug to Apple before posting it here.
It'll be interesting, though, to see how long we wait for a fix. If this is a legit thing. I haven't tested it and don't plan to.
You like your Macintosh better than me, don't you Dave? Dave? Can you hear me Dave?
This is as dumb as the windows file/run/file://C|/CON/CON doohickey.
Can this be exploited by a rouge shell script? "Funny_Picture.png.sh" wouldnt be fun, given the average mac user is
1) As guilable as windows users
2) Not as savvy to the ways of trick emails as windows users.
At least it wouldnt propergate - I assume theres a undered different mail clients on OSX. (I'm not a millionaire and cant afford my own mac you insensitive clod!)
Not only does it cause a kernal panic, but it slaps the user on the head and asks them, "Why the heck did you create a directory with the same name as the current directory????"
:-)
Those crazy kernal programmers
Found the offending piece of code in Darwin ...
...
BOOL HFSPLUS_Directory_Move( const char *src, const char *dest ) {
if ( !strcmp( src, dest ) ) {
__kernelPanic( KP_IMMEDIATE );
}
}
codegolf.com - smaller *is* better.
Then there was Colonel Panic, who wouldn't work if you added two folders with the same name to the same in box on his desk.
What's next? Private Keychain will forget where he stored my passwords and x.509 certificates?
Oh wait... you were talking about kernels...
Sorry!
-wjc.
"I figure you're here 'cause you need some whacko who's willing to stick his finger in the fan. So who are we helping?
Be very careful with this - If you are testing, or accidentally gonna do this, you will lose both directories and all data in them.
codegolf.com - smaller *is* better.
I was able to create a directory and move a directory of the same name into it. Bash is my default shell. Try the same thing in Bash. exx@eddy:~/mydir/mydir$
Edmund White
http://flickr.com/ewwhite
Try explaining to mom why she can't have two directories named letters without crashing the machine
The GUI (gracefully) prevents you from doing this, so if Mom can understand the sequence of terminal commands that triggers the panic, she'll have no trouble understanding why...
/sw/bin/mv: cannot overwrite directory `../mydir'
Edmund White
http://flickr.com/ewwhite
Still, in Linux it just gives you an error message, or does what you would expect. I'm still curious about the origins of this bug, and where it is. I would look at the 'mv' command code first.
Here's the message (login: archives, pass: archives)
This list is teeming with Apple folks, so I'm sure someone's posted a RADAR bug already.
This problem also came up on MacNN and is discussed in detail here
Now here's the kicker - as the kernel is open-source (APSL - don't complain), someone's already traced the problem back to a recursive lock in the HFS+ subsystem (hfs_vnops.c). Kewl or wha'?
Alison
"It is a miracle that curiosity survives formal education." - Albert Einstein
- You have the correct permissions to the folder, and
- You are running 10.2.2?
Missing either of these might make the bug not work (oh no!).Alcohol and Calculus don't mix. Don't drink and derive.
.. have a thread going on this, too. Link here
Alison
"It is a miracle that curiosity survives formal education." - Albert Einstein
Funny you mention video editing. Even on the low end, your $1,200 PC is never going to run iMovie.
t icle2.h tml
;)
On the high end, your cost comparison is a joke, because the cost of the computer is the least of your expenses. A high end PC based (with Avid or the like) system is going to set you back $100,000 or more.
The cost for a similarly featured Apple video editing system with Final Cut Pro? Less than $10,000.
Read it and weep:
http://www.filmandvideo.com/New%20Pages/ar
Worried about this kernel panic ruining your video editing? Don't. You are not likely to be in your Terminal making two directories of the same name and moving them about in the course of your video editing. Even if you were, this is happening in the Unix part of OS X, which is open source, and it is being announced on Slashdot. Someone will probably fix it for fun over the weekend and email Apple a patch by Monday. We'll probably see an official, tested, security update from Apple next week. That is the beauty of open source.
If this were Microsoft and a "blue screen of death", well, don't hold your breath. Their response would be the same as seven years ago: "There are no significant bugs in Windows XP. Trust us.". Yeah, right! That's what PC Magazine said about Windows 95, when I spent 11 months trying to get a stable install of the original version.
Windows: "Go talk to my friend, an 800 pound monopoly-abusing gorilla!"
Mac: "And here's my good buddy, the 66,000 ton Godzilla!"
Godzilla: Stomp!
pathetic preemptive multitasking
More like non-existant. The way I understand it, the low level code was non-reentrant, so it was inherently impossible without a total rewrite.
Why does that make this story a troll though? Is it so amazing that a relatively new OS has a bug, whereas an older and heavily tested one would not?
I've had enough abrasive sigs. Kittens are cute and fuzzy.
krel wrote:
;)
> os9 would never, despite its shabby memory
> protection, and pathetic preemptive multitasking,
> do that.
Nope, because OS 9 wasn't Unix, and so didn't use Unix terminology for operating system failures. OS 9 bombed, OS X panics (very rarely). BTW, any kernel hacker can, if they choose, get the source code and fix this bug. OS 9 couldn't do that either.
I'm glad, though, that I switched early enought that I got a chance to know OS 9. It really was amazing, despite it being basically a microcomputer OS, all the things Apple got it to do.
OS 9 is the blue-eyed caterpillar, small and awkward, but courageous and friendly.
OS X is the blue-eyed adult Moth, awesomely beautiful, supremely powerful. She soars above all, the peerless Queen of Monsters.
And Apple is, as always, Mothra Leo's Forever Friend.
Isn't "mydir" a Microsoft innovation? Could explain why it crashes ;p
More like non-existant
I believe that classic MacOS could do preemptive threading of some sort, but only with 680x0 code, not PPC.
I got interested in writing threaded stuff under the MacOS at one point, so this is out of hazy memory here.
May we never see th
Apple has a bug. This is amazing news.
/me thinks Apple would have been better using someone else's kernel -- like the FreeBSD one -- verbatim instead of trying to hack up that Mach POS (which I've heard nothing but bad things about from OS people up at Carnegie Mellon, where Mach was developed). They could still have plopped Carbon and Quartz and all their other goodies on top.
I'd say it's pretty notable. Apple's never been noted for particularly buggy code, though OS X has had a fairly nasty number of things like kernel oopses since its introduction. So while it's not *that* out of line for issues to pop up in a youthful OS, the amazing thing is that this didn't show up before.
Of course, I certainly could be missing something -- could be that the FBSD kernel just didn't do something that Apple had to have it do, and that the FBSD people wouldn't have accepted. Could be SMP issues, I suppose...
May we never see th
perhaps off topic, but it will also cause kernel panic (at least in my network without fail).
try to mount a share from an local smb server that does not exist. cancel it, then try to mount one that DOES exist.
ie. from the finder command-k
smb://10.0.1.3 #does not exist
cancel it,
smb://10.0.1.4 #does exist
the second attempt will time out and the machine will have to be hard reset.
maybe this is just me, but this has been happening to me since 10.1.5
Sure enough using /bin/mv it crashed as advertised.
/sw/bin/mv, which is the GNU version of mv from the fileutils package, just gives a "cannot overwrite directory" error.
But
This is (one of the many reasons) why the GNU versions of everything should be standard on all systems in the universe. So go fetch and install a copy of fink and (optionally) FinkCommander.
Also, "alias mv mv -i" is a Very Good Idea(tm).
"The cost of freedom is eternal vigilance." -Thomas Jefferson
I run bash and the bug works beautifully well, I even gathered a crowd to witness it. Its immediateness is really amazing, a worthy watch. Maybe if you call Apple support they can help you to crash just like the rest of us.
'hmmmph, this sounds like troll/flamebait' is referring to my rampant post
karma: ouch!
I understand the commands. I don't understand for the life of me why this warrants a PANIC!!!! ok a "denied" error response is UNDERSTANDABLE (well to me) this is just sloppy...
--
"we live in a post-ideological world..." - Billy Bragg.
You should see the death screen. Very slick. I'd post a screen grab, but well you know. :)
I know I'm going to hell, I'm just trying to get good seats.
Better yet... If samba has shared user directories try this: Mount username's samba share (ie home directory) in ~/mnt/username/ Now try to cd ~/mnt/username/mnt/username/mnt/username Make sure you use some tab completions as well. At some point you will no longer be able to continue typing the command. ^C wont stop it either. Ok, so you now want to unmount it to try and stop it from happening again. Good luck. umount ~/mnt/username will end up locking up as well. Yet again ^C wont stop it.
I understand the commands. I don't understand for the life of me why this warrants a PANIC!
Agreed. I was just responding to the troll about how this would ruin the lives of non-power users.
I bulit and installed GNU fileutils 4.1 on my Mac OS X system some time ago (I wanted my Linux flavored fileutils!) and it turns out that they (mv) don't have this ...mv dirname .. problem. Try it!
Rise above your name, then maybe your criticizms will bite a little harder.
You like your Macintosh better than me, don't you Dave? Dave? Can you hear me Dave?
try it and see. the result is the OS X equivalent to a BSOD in windows or the bomb icon in OS 9. the desktop will gray and a dialogue will appear (in a number of languages) telling you to hard reset.
Why isn't Premiere in your cost when the 'equivalent' Mac has bundled iMovie and iDVD?
My $1500 933MHz G4 comes with iMovie, iDVD, and DVD-R. I don't have a DV-Analog converter in the system, but I do use my camcorder for that purpose.
For the 'average' joe who wants to buy a computer, buy a camcorder, make a movie, then burn a DVD, the iMac/eMac/PowerMac is still a great deal, in terms of learning curve, cost, effort, and ease of use.
GPL Deconstructed
What's missing that you want HFS+ to go away or something?
It's got metadata, which Microsoft only *added* with NTFS
It finally got journaling with 10.2.2
It spans, quite comfortably, 180GB hard drives
File sizes can be larger than 2gb, and I believe up to 2TB (2^63 bytes per file)
Is there something missing? Perhaps encryption? Apple already has support for encrypted volumes...
GPL Deconstructed
It would be smart to enable journalling before doing this: /
sudo diskutil enablejournal
Overall, I've found OS X to be a wonderfully stable product, and have never seen a kernel panic.
"A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
I must admit to being somewhat taken aback by the comments here . . .
While this bug appears trivial it is not.
Consider: An entire apple server can be totally killed requiring a human to reboot it just by getting a totally unpriveleged shell access.
EVEN A GUEST can kill the system using this simple simple set of commands. That's not good. Of course it's not the end of the world either.
anyone know of a way to get unprivileged access on an apple server of your choice?!
Later . . . . . . WebBug
Try changing an Ethernet interface's MAC address using ifconfig. Whoops.
A troll feeding we will go, a troll feeding we will go, hi ho the derio (WTF is that anyways?) a troll feeding we will go.
What's also amusing is, children have no problem using dos, linux, windows, MacOS or OSX. They have no preference to OS as long as it can play sound, let them personalise their desktop etc. what they favour is SOFTWARE
Yet for some unknown reason, if you put an average highschool computer user who's grown up on a windows PC all his life in front of a mac, and open up netscape, they can't seem to figure out how to make it work, despite it having an identical interface to the PC version. The reason I was given was becasue "It's a mac, I don't know how to use a mac"
T Money
World Domination with a plastic spoon since 1984
"DAMN, sticking that fork in my eye really hurt!"
"Oooh, I WANT TO TRY!"
-braxton
I finally feel better about formatting my disk UFS rather than HFS+. Now if they would just improve the performance...
OS 9 didn't have memory protection. Memory was a flat 32-bit address space, shared by all processes.
There was preemptive multitasking, and asymetric multiprocessing. Essentially, all the normal applications ran in a single task and you could write preemptive services. I never saw this feature used for anything productive. Since QuickDraw was only available to the main task, you'd probably have to use IPC to have your services do their output.
OS 9 would never do that because its filesystem code was highly refined, after all, it was the 7th or 8th major revision of the OS. (I'm pretty sure we jumped from either System 1 or 2 to System 4. I don't remember System 5, so maybe it was only the 6th.) However, I do recall that the PC Exchange software was pretty flaky and some bad DOS floppies could crash your Mac.
Also, there was a horrible Quicktime Autoplay feature that was designed for CD-ROMs. Some people used it to put viruses on Zip disks that would activate merely by inserting the Zip.
All in all, OS X is, so far, doing a good bit better than its predecessors.
My question, then, is... where are the little twin Japanese girls?!?!?
They've been called the Cosmos lately and stuff since the kiddy-Mothra movies came out, but really!
THEY would guarantee complete and utter platform dominance if they were included as a feature!
(insert your own puns here, people...)
But, hell, I'm content with my 110 days of uptime since my last rebootable update.
[OT]
Not sure why anyone complains about the restarts required of their Macs these days. After that long, I'm fairly certain that Kaiko (yes, I named my "windtunnel") could use a break...
[/OT]
ok, yes, fine, os 9 is a horrendous excuse for an operating system, but it was an enjoyable one nonetheless. I mean memory protection insofar as trusting each application to not overstep its allocation. ;-)
they didn't even have that problem in system 0.1 (because the mfs drive format only allowed one directory level above root). and same through 1 and 2, i think 3 was where hfs came in. 4 didn't have any new features, 5 was more stable, 6 packed a wallop etc...
actually i collect these operating systems
-krel
karma: ouch!
Thanks for the info. I'm getting fink again as we speak!
dr00g911 wrote:
;)
;)
> My question, then, is... where are the little
> twin Japanese girls?!?!?
>
> They've been called the Cosmos lately and stuff
> since the kiddy-Mothra movies came out, but
> really!
The general name is "shobijin" (means "little beauty"), fairy, or fairy priestess.
In 1992 and 1994, they were the Series 2 Mothra's Cosmos.
In the Legend of the Protecting Goddess Mothra Leo (the late 90's Mothra trilogy) they were the Elias (pronounced like English "alias", with probably the same meaning).
The Mothra of Nilai Kanai (appeared as a moth in the picture on the wall inside the pyramid, and as the horribly mutated Dagara: "da"=corrupted, "ga"=moth, "ra"=Malay "lah" particle) had a human sized shobijin called "Kona" or "the Queen" in the Japanese version, "the Princess" in the American version of "Rebirth of Mothra 2".
Mothra of Yamato (GMK) shared Yuri Tachibana as her shobijin with Baragon and King Ghidora. Yuri could also telepathically sense Godzilla.
> THEY would guarantee complete and utter platform
> dominance if they were included as a feature!
Where do you think Belebera is? Mothra Leo sent her to Apple at the end of "Mothra 3" where she could put her technology skills to good use without getting into trouble.
I still wish Apple would port that telepathic interface to OS X. You know, the one the Elias and Fairy used to communicate with Ghogo on the screen of that Mac in "Rebirth of Mothra 2". OS 9 just had all kinds of features that are taking a while to get to OS X.
Mothra or Godzilla should do a Switch ad. Oh, yeah, that's right. Godzilla already did one. It was called "Godzilla 2000". Switch or he will stomp you.
"What I'm thinking is different from what you are."
Belabera, "Mothra 3" 1998
"Your way of thinking is completely different from mine!"
Shinoda, "Godzilla 2000 Millennium" (Japanese version)
I was able to cause a panic in 10.1.x by simply moving all files out of the root of an SMB share on a foreign host from the Terminal. I was able to duplicate at will, and did submit to Apple at one time.
No problem copying and removing the files from the terminal (using the same filespecs). Only the "mv" command would do it.
I have no idea of this was fixed in a later release of 10.1 or 10.2.
-- clvrmnky
I reported this bug to Apple quite a while ago and was informed that this bug was already known to them.
i just tried in 10.1.5... nothing. i think the second mydir that was created just disappeared. someone should tell apple though.
I mod down pyramid schemes in sigs.
ok, yes, fine, os 9 is a horrendous excuse for an operating system, but it was an enjoyable one nonetheless.
I had lots of enjoyable computing experiences with my old Atari 800, but I wouldn't want to use it as my everyday computer in this day and age.
--R.J.
Electric-Escape.net
I was able to cause a great kernel panic with 10.1, and reproduce it all the time. I'm not sure if it still works, but if one took Netscape 4.7 in classic and went to http://localhost/, assuming an apache web server were running, there was an instant kernel panic.
I sent an email to Apple awhile back, so it may be fixed; however, I have not tested this bug recently, as I cannot stand opening Classic anymore T.t
Just thought i'd help a brother out, it's actually "dairy-o" (the o is just for fun i guess), not derio. Hope this helps.
threaten a Congressional investigation into his mens' use of military-issued credit cards.
oh, wait, that's a Colonel....
Erm... Could this be about the "not enough mouse buttons"/"too many mouse buttons" divide?
I would have thought that too, but the kid honestly did not seem to be able to figure out how he was supposed to navigate.
T Money
World Domination with a plastic spoon since 1984
I just tested this over an FTP connection to a Mac OS X 10.2.2 box using Transmit (a Mac FTP client) from a MacOS 9 machine.
I was ABLE to panic the kernel remotely.
This has just taken a violent swing into serious, as ANY USER WITH FTP ACCESS can now drop your Mac OS X machine. Apple needs to patch this, and quickly. I don't care if the security update is 15k to replace
Any idea what eactly could be wrong with either the kernel or mv that would cause such a problem? Branching to the wrong case (i.e. branching to the "same name" case as opposed to the "can't replace a directory with an item it contains" case)?
Is this a job for the Darwin team since it involves a BSD component?
CAn'T CompreHend SARcaSm?
You're both wrong.
Heigh-ho, the derry-o.
Heigh-ho is in Shakespeare, as an interjection.
Derry, possibly as in county Derry?
seems questionable....
farmer....dairy..makes sense!
farmer....derry?
Unfortunately that's not funny, its plain sad, and I've seen it happen many times. My father and father-in-law both use PC's and can't seen to get anything done on my Mac. Yes, even if you open up Mozilla for them. They look with wide open eyes, move slowly with the mouse not daring to click on anything. And can't seem to find the menu bar :-)
Yet for some unknown reason, if you put an average highschool computer user who's grown up on a windows PC all his life in front of a mac, and open up netscape, they can't seem to figure out how to make it work, despite it having an identical interface to the PC version. The reason I was given was becasue "It's a mac, I don't know how to use a mac"
Don't you find it the least bit funny that you're trying to help him to cause a kernel panic on his computer?
Hey, this is OS X we're talking about here. Unlike in the Windows world, you really gotta put some effort into making the system crash.
It's damn funny what a novelty it is to us OS X users to see the system crash....I did it.....just for fun.
-ZTolerance does not tolerate intolerance, or hypocrisy.
Actually, I thought 9 was really good. Granted, it was hefty, but they had finally finished a lot of what they started with 7. AppleScript was very mature, for example, and virtually no 68K legacy code was to be found.
The reason Classic Mac OS stuck around so long was that they made a lot of good design decisions, and most of the apps really were pretty stable.
As some of you may know, you can use the equivalent of Terminal.app without logging into OS X by logging in as >console it will take you to a BSD style login prompt where you have to login and can still render the same results featured in this article.
"True programmers are artists and someday we'll respect programming as self expression and personal effort." - fateswarm