# Easily Caused Kernel Panic Mac OS X 10.2.2



## kendall (Nov 29, 2002)

As seen on Slashdot,

_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!_

I don't really want to try this to verify if its true or not.  Does anyone else?   Might be a good chance to try out the Journaling capabilities of 10.2.2.


----------



## stealth (Nov 29, 2002)

im not willing to verify this as well... maybe some1 else will be brave enough to try it.. what id like to know is if anyone can explain what JOURNALING CAPABILITIES are (or maybe a certain link that i can read.) ??? .. thanx


----------



## fryke (Nov 29, 2002)

http://mac.fryke.com/cgi-bin/blosxom.cgi/2002/nov/#journal20021116


----------



## Ricky (Nov 29, 2002)

No kernal panic for me when I followed those commands...

```
usage: mv [-fi] source target
       mv [-fi] source ... directory
```


----------



## Ricky (Nov 29, 2002)

Whoops!  Just returned from a kernel panic.  The correct code for this is:


```
mkdir ~/mydir
cd ~/mydir
mkdir mydir
mv mydir ~/
```

WARNING:  Dangerous if you don't know what you're doing.


----------



## kendall (Nov 29, 2002)

Ricky is most brave.  Thanks for taking one for the team!


----------



## fryke (Nov 29, 2002)

you see what the actual problem is? you're removing your current working directory's path. want to try what happens when you do this? is it the same? (i don't want to...):


```
mkdir ~/mydir
cd ~/mydir
rm -rf ~/mydir
```


----------



## kendall (Nov 29, 2002)

"mv -i" is my friend


----------



## edX (Nov 29, 2002)

ricky - checked your pm box lately?


----------



## wiz (Nov 30, 2002)

i've got a 10.1.5

tried it 

no kernel panic !!!

just an error message (i.e. what is supposed to happen)


----------



## kendall (Nov 30, 2002)

Its only supposed to happen in 10.2.2.


----------



## Ricky (Nov 30, 2002)

> _Originally posted by Ed Spruiell _
> *ricky - checked your pm box lately? *


w00t!


----------



## Ricky (Nov 30, 2002)

> _Originally posted by fryke _
> *you see what the actual problem is? you're removing your current working directory's path. want to try what happens when you do this? is it the same? (i don't want to...):*


Nothing for that one, Fryke.  It stayed in ~/mydir, but it actually deleted it.    See attached pic.


----------



## kommakazi (Nov 30, 2002)

I tried it on my iBook for fun...yup kernel panic. woohoo. How often does anyone actually do this? That's the real question...


----------



## solrac (Dec 1, 2002)

yep, insta-kernal panic!! That sucks. Windows-users will have a field day with this one!! Sigh...

Funny how in the finder, you get an error message if you try this, but the terminal kernal panics the computer?!

Elvis??!!!??!?!?!!!??!!!??!?!


----------



## bbloke (Dec 1, 2002)

> _Originally posted by solrac _
> *Elvis??!!!??!?!?!!!??!!!??!?! *


Hmm, I wonder if you have something here.  Of those who tried this self-destruct button, how many had journaling enabled?  I wonder if the enabled/disabled journaling accounts for the differences in experience.


----------



## fryke (Dec 1, 2002)

About Windows-users and their field day... Well, it's certainly a bug, but it's a rare condition one, too. And it's still much more complicated than "No keyboard found - Press any key to continue"


----------



## kendall (Dec 1, 2002)

Terminal warriors might not find this such a rare condition.  I've done this many of times in Linux where I tend to use a terminal for just about everything.  OS X is much more usable than any other Unix based OS so I don't find myself using Terminal that often.  Still, I'm sure there are still those who prefer using Terminal to perform operations rather than the GUI itself.  The ones likely to be most affected by this are system admins.  These also happen to be the ones who can afford a kernel panic the least.


----------



## boi (Dec 1, 2002)

i don't think any users will accidently do this to their computer ^_^. maybe i underestimate the ability of the world to produce idiots.


----------



## Ricky (Dec 1, 2002)

> _Originally posted by bbloke _
> *Hmm, I wonder if you have something here.  Of those who tried this self-destruct button, how many had journaling enabled?  I wonder if the enabled/disabled journaling accounts for the differences in experience. *


I had journaling on, if it matters...  I think it does...


----------



## bbloke (Dec 1, 2002)

> _Originally posted by Ricky _
> *I had journaling on, if it matters...  I think it does...   *


Thanks for the feedback, Ricky.

kommakazi and solrac: you both suffered from the kernel panics.  Did you both have journaling switched off?


----------



## Sogni (Dec 1, 2002)

Patient: Doc, it hurts when I do this...
Doc: Well, don't do that!


----------



## fryke (Dec 1, 2002)

I'm using the Terminal to create, copy and move directories often myself, but I haven't yet replaced a directory of name A with another directory of the same name which happens to be the directory of my current working directory. I think it IS rare. Or did you have lots of those kernel panics in the time you're using Mac OS X?

It's a bit like... In earlier times we used the expression "cutting the limb you're sitting on", nowadays we say "killing the SSH daemon of the server you're logged into"


----------



## kendall (Dec 1, 2002)

When you work in console 24/7 you do some crazy things.  Especially at 4:00 AM.

Also, with a bash shell when Tab sometimes auto completes the wrong file or directory.  You get working fast/carelessly, its bound to happen.

Obviously it happened once or we wouldn't know about it today.

Like I said, I don't use Terminal often in OS X but if a bug like this cropped up in Linux, it would be a major deal to me.


----------



## popey (Dec 2, 2002)

This bug has nothing to do with Elvis : it works wonderfully without journaling. I think it is a small bug in the HFS+ kext. The finder check the validity of the request before performing it (IE calling the kernel to perform the task).
It should be quite easy for Apple to carrect this bug, since it can be repeated (it makes it easly to locate).


----------



## Wickedkitten (Dec 2, 2002)

I've had better luck causing a KP in 10.2.2 by trying to connect to my idisk through path finder


----------



## malexgreen (Dec 3, 2002)

> _Originally posted by Ricky _
> *Whoops!  Just returned from a kernel panic.  The correct code for this is:
> 
> 
> ...



I tried this on my linux box (SUSE Linux 7.1 -- Kernel 2.2.18):

```
/home/magreen> mkdir mydir
/home/magreen> cd mydir/
Directory: /home/magreen/mydir
magreen/mydir> mkdir mydir
magreen/mydir> mv mydir ~/
mv: cannot overwrite directory `/home/magreen/mydir'
magreen/mydir> ls
mydir
```

Just using the ext FS. Why do you get a kernel panic with 10.2.2???


----------



## fryke (Dec 3, 2002)

Like the thread shows, it's a bug in 10.2.2 (and earlier I suppose) that hasn't been caught. I'd expect it to be fixed by 10.2.3 in the latest builds. Can anyone confirm/deny this?

Also, I think, you should try cd'ing inside the second mydir first. But it actually _shouldn't_ cause a freeze.


----------



## whitesaint (Dec 3, 2002)

Sorry guys I didn't read through the whole thread, but I just wanted to say that I had to reinstall everything for Mac OS X yesterday, and I lost tons of data, including pictures of my Grandma who i will never see again.  Thanks Mac OS X!


----------

