Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > How can I deliberately cause a kernel panic?

How can I deliberately cause a kernel panic?
Thread Tools
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 27, 2007, 03:57 AM
 
Yes, I'm serious about this. I'd like to know a simple way to induce a KP with software.

I remember there was a shell command in 10.2 that would cause a KP, but it was fixed in 10.3 IIRC. Does anybody know of such a command or an app that would allow me to induce KPs on a CD MB?

And before you post something like "<gasp>Why??? ", here's the deal. I'm trying to understand an issue with an iSight of one of our MBs here. Its iSight stops working every once in a while and all software repair attempts have failed. AHT reports no errors though. Interestingly enough we noticed the iSight started working again after a KP. We would like to reproduce this to see if it was just a coincidence.
     
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 27, 2007, 04:21 AM
 
try this Month of Kernel Bugs (MoKB): Mac OS X Apple UDIF Disk Image Kernel Memory Corruption (1)
Download the .dmg file and mount it, you should experience a nice KP.

but I'm not sure that's the right way to sort your problem...
     
Simon  (op)
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 27, 2007, 06:59 AM
 
Unfortunately that didn't work.

One of the links was dead. The other one worked, but it didn't cause a KP.
     
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 27, 2007, 08:59 AM
 
sorry about that, I didn't test it because I value my uptime
I'll give you another way today.
     
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Apr 27, 2007, 09:23 AM
 
Boot from an external hard disk and then pull its plug.
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Apr 27, 2007, 09:49 AM
 
Originally Posted by TETENAL View Post
Boot from an external hard disk and then pull its plug.
Ouch.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 27, 2007, 10:02 AM
 
It would probably have to be the same kind of kernel panic. They all look the same, but the underlying events might be completely different.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Addicted to MacNN
Join Date: Mar 2006
Status: Offline
Reply With Quote
Apr 27, 2007, 12:41 PM
 
Yeah - I can't recommend this as a diagnostic method. Many different things could cause a KP.
     
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Apr 27, 2007, 04:54 PM
 
open up the computer, and hit unimportant parts with a hammer.

perhaps you could erase some virtual memory files while it is doing stuff?
     
Simon  (op)
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 28, 2007, 03:24 AM
 
Originally Posted by Chuckit View Post
It would probably have to be the same kind of kernel panic. They all look the same, but the underlying events might be completely different.
Definitely. But only once it's been demonstrated will the user know that a KP is not going to fix his iSight.
     
Simon  (op)
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 28, 2007, 03:27 AM
 
Originally Posted by kick52 View Post
open up the computer, and hit unimportant parts with a hammer.
How witty! Is that your way of telling us you have no clue as to how to induce a KP?

perhaps you could erase some virtual memory files while it is doing stuff?
Now that's better! But have you actually tried that? You can delete the swap files and your Mac will still run. The thing is the files aren't actually deleted even though they appear to be gone. The OS is smart enough to not allow you to really remove the files.

cd /private/var/vm
ls -al
-rw------T 1 root wheel 67108864 Jan 3 10:13 swapfile0

It's all about that "T" up there - the sticky bit.
(Last edited by Simon; Apr 28, 2007 at 03:40 AM. )
     
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status: Offline
Reply With Quote
Apr 28, 2007, 10:40 AM
 
How about modifying a .kext file with gibberish?

Or would that just KP at startup, hmm? I was thinking something along the lines of a corrupt extension/driver that could by loaded by, for example, plugging in a related device or launching a piece of software that attempts to communicate with it.

(Conincidentally, I'm just sitting at a Mac I'm going to wipe clean in a few hours, so maybe I'll give this a shot after the backups are all done )
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 28, 2007, 12:37 PM
 
Just write a kernel extension that tries to divide by zero or memset NULL or something.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Apr 28, 2007, 04:38 PM
 
Moving a kernel extension out of Extensions while leaving it in the extensions cache and then rebooting used to do it for me.

Note that if you do this, you'll need to use single-user mode to fix it.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Apr 29, 2007, 05:26 AM
 
Apple has a kernel extension to do this published here: http://developer.apple.com/technotes/tn2004/tn2118.html (at the bottom in the Downloadables section).

There's one problem though, it's PowerPC only. So if you head here: http://www.allocinit.net/files/InstantPanic.zip you'll be able to grab a version I updated with the latest Xcode and built as Intel native for you.

You should be able to use kextload (as root) to load this extension and get an immediate kernel panic.

- proton
     
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 29, 2007, 08:32 AM
 
great find Proton!
Has anyone tested it with success?
(Last edited by Madrag; Apr 29, 2007 at 05:33 PM. )
     
Simon  (op)
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 29, 2007, 09:33 AM
 
Originally Posted by proton View Post
You should be able to use kextload (as root) to load this extension and get an immediate kernel panic.
That's looking like a real winner, proton. Unfortunately I wasn't able to load the kext.

sudo kextload ~/Desktop/InstantPanic/InstantPanic.kext
Password:
kextload: extension /Users/simon/Desktop/InstantPanic/InstantPanic.kext is not authentic (check ownership and permissions)



Any ideas what's going wrong there? I tried it as belonging to me and as root:admin. No dice. It's got 755 permissions so I guess that should be ok too.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 29, 2007, 12:18 PM
 
I believe it's supposed to be owned by root:wheel.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Simon  (op)
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 29, 2007, 01:48 PM
 
Originally Posted by Chuckit View Post
I believe it's supposed to be owned by root:wheel.
Tried that too. Still no dice.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:02 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2