Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Silly Kernel Panic in Mac OS X 10.2.2

Posted by pudge on Fri Nov 29, 2002 08:54 AM
from the don't-try-this-at-home dept.
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!
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Wow (Score:3, Funny)

    by darkov (261309) on Friday November 29 2002, @08:59AM (#4779529)
    Apple has a bug. This is amazing news. FP
    • Re:Wow by Anonymous Coward (Score:2) Friday November 29 2002, @09:11AM
    • Why? by 0x0d0a (Score:1) Friday November 29 2002, @11:45AM
      • Re: Why? by capmilk (Score:2) Friday November 29 2002, @12:22PM
      • Re:Why? by susehat (Score:2) Friday November 29 2002, @01:43PM
      • Re:Why? (Score:4, Informative)

        by stripes (3681) on Friday November 29 2002, @01:45PM (#4780668) Homepage Journal
        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).

        Well MACH isn't exactly an OS, it is more of an OS for running OSes, and one of the OSes it can run is the "BSD Single Server" which is a BSD4.3+/4.4ish derieved OS that isn't in my opnion as good as some of the other BSD4.4ish derived OSes (like FreeBSD).

        One of the other OSes that runs under MACH is a modifyed MacOS9. I havn't run OS9 (aka "Classic") on purpose for months, but other people find it rather indepsnsable, and wouldn't use OSX without it.

        As you say they could plop Carbon and Quartz ontop of FreeBSD just as easally as onto MACH's BSD Single Server. However getting OS9 to "run under" FreeBSD would have been a much larger pain.

        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...

        I doubt it is SMP issues. I'm not even sure the FreeBSD people would reject the stuff needed to get OS9-under-FreeBSD working, after all it might not be that different from what WINE needs from the kernel...but it would have taken a whole lot more time then getting OS9 running under MACH more or less along side the BSD Single Server (kind of under it and off to one side I susspect...)

        the device driver model is also different, and in a lot of ways better (and unfortunitly in a lot of ways worse) then FreeBSD.

        [ Parent ]
        • 1 reply beneath your current threshold.
      • Re:Why? (Score:5, Interesting)

        by Elwood P Dowd (16933) <judgmentalist@gmail.com> on Friday November 29 2002, @02:25PM (#4780851) Homepage Journal
        Well, Avie Tevinian [apple.com] probably doesn't agree with your "OS people up at Carnegie Mellon", and he's running the show over at Apple. He also wrote some pertinent versions of Mach, up at Carnegie Mellon.

        When it comes to questions like this, if you can get the best people, using their prefered tools is often a good idea. If Apple could have hired all the architects of the freebsd Kernel, then sure, maybe you'd be right.

        Also, I don't know what the hell you mean that you've "heard nothing but bad things about" Mach. It's a well known and well inspected peice of code. It might have problems, but saying "bad things" doesn't mean anything. What are the problems? Message passing is slow? This is true. Whatever. It's an architectural choice. Some of those architectural choices are exactly what makes Mach good for Apple - Multiple OS hosting.
        [ Parent ]
        • Re:Why? by Elwood P Dowd (Score:2) Monday December 02 2002, @02:25PM
        • 1 reply beneath your current threshold.
      • Re:Why? by KnotMe (Score:3) Saturday November 30 2002, @12:24PM
    • 1 reply beneath your current threshold.
  • I hope you submited to Apple (Score:5, Insightful)

    by feldsteins (313201) <`scott' `at' `scottfeldstein.net'> on Friday November 29 2002, @09:09AM (#4779557) Homepage


    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.
  • C|/CON/CON (Score:3, Insightful)

    by isorox (205688) on Friday November 29 2002, @09:11AM (#4779565) Homepage Journal
    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!)

    • Re:C|/CON/CON (Score:5, Funny)

      Can this be exploited by a rouge shell script?

      i don't think so, but a big blue one could do the job.
      [ Parent ]
    • Re:C|/CON/CON by jericho4.0 (Score:2) Friday November 29 2002, @05:25PM
    • Re:C|/CON/CON by banal avenger (Score:1) Sunday December 01 2002, @02:05PM
    • Re:C|/CON/CON by derch (Score:3) Sunday December 01 2002, @11:00PM
    • Video editing was Re:mail info (Score:5, Insightful)

      by Melantha_Bacchae (232402) on Friday November 29 2002, @10:43AM (#4779878)
      Funny you mention video editing. Even on the low end, your $1,200 PC is never going to run iMovie.

      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/art icle2.h tml

      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! ;)
      [ Parent ]
    • Re:mail info (Score:4, Funny)

      by MoneyT (548795) on Friday November 29 2002, @10:26PM (#4782303) Journal
      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"
      [ Parent ]
      • Re:mail info by mackstann (Score:1) Sunday December 01 2002, @08:31PM
        • Re:mail info by jaoswald (Score:1) Monday December 02 2002, @09:40AM
          • Re:mail info by mackstann (Score:1) Monday December 02 2002, @09:50AM
      • Re:mail info by rakslice (Score:2) Monday December 02 2002, @01:18AM
        • Re:mail info by MoneyT (Score:2) Monday December 02 2002, @03:24AM
          • 1 reply beneath your current threshold.
      • Re:mail info by ernst_mulder (Score:1) Monday December 02 2002, @01:07PM
    • 5 replies beneath your current threshold.
  • Its not a bug (Score:5, Funny)

    by WesG (589258) on Friday November 29 2002, @09:24AM (#4779602)
    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 :-)

  • Ooops (Score:5, Funny)

    by iMMersE (226214) on Friday November 29 2002, @09:32AM (#4779625) Homepage
    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 );
    } ...
    }
    • Re:Ooops (Score:4, Informative)

      by Gerry Gleason (609985) <gerry.geraldgleason@com> on Friday November 29 2002, @10:01AM (#4779740)
      Except that string comparisons aren't particularly useful in deciding that two directory arguments are the same. You have to stat them and compare inodes and devs.

      Yes, I know this is trying to be funny, but on /. accuracy counts in humor as well.

      [ Parent ]
      • Re:Ooops by iMMersE (Score:1) Friday November 29 2002, @10:20AM
        • Re:Ooops by Gerry Gleason (Score:2) Friday November 29 2002, @11:00AM
    • 3 replies beneath your current threshold.
  • First there was General Controls, who was sometimes drunk and forgot all my preferences.
    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.

  • IMPORTANT! (Score:5, Informative)

    by iMMersE (226214) on Friday November 29 2002, @09:56AM (#4779726) Homepage
    Be very careful with this - If you are testing, or accidentally gonna do this, you will lose both directories and all data in them.
  • by ewwhite (533880) on Friday November 29 2002, @09:58AM (#4779733) Homepage
    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$
  • They know .... (Score:5, Informative)

    by Draoi (99421) <draiocht@ma c . c om> on Friday November 29 2002, @10:13AM (#4779786) Journal
    This was originally posted to the darwin-development mailing list, of which I'm a subscriber;

    Here's the message [apple.com] (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 [macnn.com]

    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'?

    • Re:They know .... by longbottle (Score:3) Friday November 29 2002, @12:27PM
    • Re:They know .... by merdark (Score:1) Friday November 29 2002, @04:10PM
      • Re:They know .... by Lars T. (Score:3) Friday November 29 2002, @06:03PM
      • Re:They know .... (Score:4, Insightful)

        by Daniel Dvorkin (106857) on Friday November 29 2002, @10:33PM (#4782318) Homepage Journal
        It's found. If it's not fixed, it soon will be. And since Apple is very good about patch releases through Software Update, the fix will soon be easily available to every OS X user.

        This kind of partnership between OSS and a major commercial vendor is unprecedented, AFAIK. (No flames, please; if I'm wrong, just tell me so, and who did it first.) It's produced some great things so far, and I'm looking forward to seeing where it goes.
        [ Parent ]
      • Re:They know .... (Score:5, Interesting)

        by valmont (3573) on Saturday November 30 2002, @07:56PM (#4785721) Homepage Journal
        you are missing the point here. It works this way:

        1. user accidentally finds bug in OS
        2. user talks about it on open-source forums and other places on the internet
        3. Apple gets notified as well as open-source community at large
        4. within minutes of its discovery, some geeks manage to find the root of the problem
        5. apple developers are notified of geeks' findings, confirm, fix, and thoroughly test the fix.
        6. within days apple users get a software update notification if bug is important, or fix is rolled into the next major sub-dot release if fairly inconsequential for the broader user base, as it might be the case for this one
        You see, apple users don't need to do shit. All i know is that some bug that is fairly inconsequential to me was found, and that it's guna get fixed, fast, and my next OS X release will be all the stronger, and all i'll have to do is click the "install" button when prompted, and i will feel warm and fuzzy all over. I don't even need to what a fucking kernel is.

        now that's just me. Yes, many geeks out there will gladly hunt-down the bug in the source code and recompile their kernel.

        The point is, you know problems are addressed in an appropriate matter.

        So yes, open-source, is, indeed, so much better than anything else, especially if you're dealing with what i consider in my little world, the mission-critical piece of software that is my tibook's operating system.

        Such process shows me that a product that relies heavily on mature open-source components is less likely to cause productivity-killing crashes and loss of data such as the ones i've experienced with my previous dell laptop running win2k, as described in one of my journal entries [slashdot.org].

        And if was to direct an IT department, gee, i just may consider putting a flat-panel iMac on every employee's desktop. Shit i could mount user directories from a central location, enabling employees to switch work stations, i would uniformely configure all machines, prevent users from writing files or installing applications outside of their home directories, i could ssh in each box for sporadic debug work, i could create automated processes to create development environments based on users' needs, wether they're graphic artists or J2EE application developers.

        OS X owns you.

        this is it people. we are well on our way to reach the nirvana of computing, with symbiotic collaboration between a major hardware and software vendor and the open source community at large, market share gains in each camp benefits the other.

        [ Parent ]
    • Re:They know .... by 68kmac (Score:1) Saturday November 30 2002, @05:00PM
  • ArsTechnica (Score:5, Informative)

    by Draoi (99421) <draiocht@ma c . c om> on Friday November 29 2002, @10:23AM (#4779813) Journal
    .. have a thread going on this, too. Link here [infopop.net]
  • by Anonymous Coward on Friday November 29 2002, @11:25AM (#4780026)
    Isn't "mydir" a Microsoft innovation? Could explain why it crashes ;p
  • smb bug? or maybe i'm an idiot (Score:3, Interesting)

    by drive (621617) on Friday November 29 2002, @12:03PM (#4780167)
    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
  • Fink/GNU is your friend (Score:5, Insightful)

    by bluestar (17362) on Friday November 29 2002, @12:16PM (#4780207) Homepage
    Sure enough using /bin/mv it crashed as advertised.

    But /sw/bin/mv, which is the GNU version of mv from the fileutils package, just gives a "cannot overwrite directory" error.

    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).
  • Cool. (Score:5, Funny)

    by red5 (51324) <gired5@gmailCOUGAR.com minus cat> on Friday November 29 2002, @01:12PM (#4780512) Homepage Journal
    You should see the death screen. Very slick. I'd post a screen grab, but well you know. :)
    • Re:Cool. (Score:4, Interesting)

      by Have Blue (616) on Sunday December 01 2002, @12:01AM (#4786406) Homepage
      What's even slicker is that the diagnostic output that used to go all over the screen was instead written to NVRAM, and moved out to disk (~/Library/Logs IIRC) when you rebooted.
      [ Parent ]
  • by yngwie0 (597057) on Friday November 29 2002, @01:36PM (#4780624)
    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!
  • journalling (Score:2, Insightful)

    by owenc (255848) on Friday November 29 2002, @04:58PM (#4781396) Journal
    It would be smart to enable journalling before doing this:
    sudo diskutil enablejournal /
  • Another bug. (Score:2)

    by jericho4.0 (565125) on Friday November 29 2002, @05:18PM (#4781480)
    This page [entropymine.com], a browser test page for png images, instantly crashes IE on Jaguar. Kind of funny considering that IE on OS X has far better png support than the windows version.

    Overall, I've found OS X to be a wonderfully stable product, and have never seen a kernel panic.

    • Re:Another bug. by Huge Pi Removal (Score:2) Friday November 29 2002, @06:40PM
    • Re:Another bug. by anarkhos (Score:2) Sunday December 01 2002, @03:44AM
    • Re:Another bug. by huginOGmunin (Score:1) Tuesday December 03 2002, @09:33PM
    • 1 reply beneath your current threshold.
  • Don't you get it? (Score:3, Interesting)

    by WebBug (178944) on Friday November 29 2002, @06:18PM (#4781680) Homepage Journal
    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?!
  • Another easy one (Score:3, Interesting)

    by Wesley Felter (138342) <wesley@felter.org> on Friday November 29 2002, @06:49PM (#4781752) Homepage
    Try changing an Ethernet interface's MAC address using ifconfig. Whoops.
  • Works fine with UFS filesystem... (Score:1, Interesting)

    by Anonymous Coward on Friday November 29 2002, @11:35PM (#4782473)
    I finally feel better about formatting my disk UFS rather than HFS+. Now if they would just improve the performance...
  • by c13v3rm0nk3y (189767) on Saturday November 30 2002, @06:47PM (#4785408) Homepage

    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.

  • by generationxyu (630468) on Sunday December 01 2002, @12:12AM (#4786442) Homepage
    i just tried in 10.1.5... nothing. i think the second mydir that was created just disappeared. someone should tell apple though.
    • 1 reply beneath your current threshold.
  • by mkiwi (585287) on Sunday December 01 2002, @07:46PM (#4790126)
    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

  • WARNING: SHUT DOWN YOUR FTP DAEMON (Score:4, Interesting)

    by Tokerat (150341) on Monday December 02 2002, @04:49AM (#4791965) Journal

    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 /bin/mv, anyone who has an FTP cannot live like this.

    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?
  • by EggZact (629182) <spamit&edgarflores,com> on Thursday December 05 2002, @02:56PM (#4820644) Homepage Journal
    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.
  • Re:Sure (Score:5, Insightful)

    by qengho (54305) on Friday November 29 2002, @10:00AM (#4779738)

    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...

    [ Parent ]
    • Re:Sure by Ratso Baggins (Score:1) Friday November 29 2002, @12:55PM
      • Re:Sure by qengho (Score:1) Friday November 29 2002, @01:30PM
  • by GigsVT (208848) on Friday November 29 2002, @11:11AM (#4779969) Journal
    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?
    [ Parent ]
  • Re:os9 never did that (Score:5, Insightful)

    by Melantha_Bacchae (232402) on Friday November 29 2002, @11:17AM (#4779999)
    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. ;)
    [ Parent ]
  • Re:os9 never did that (Score:2, Informative)

    by sco08y (615665) on Saturday November 30 2002, @01:22AM (#4782713)
    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.
    [ Parent ]
  • 9 replies beneath your current threshold.