[NPMUG] Mac Fixit on "Tackling kernel panics, hangs, and unexpected quits." ( highly recommended reading )

Dave Sevick dave at davesevick.com
Tue Apr 28 04:41:51 MDT 2009


This article was published yesterday on Ted Landau's Mac Fixit site.   http://www.macfixit.com/article.php?story=20090427080548101

It is a basic summary of steps to take when your Mac freezes or has  
other system issues.

==============

Tackling kernel panics, hangs, and unexpected quits
In the Classic Mac OS, when an application crashed it would usually  
take down the whole system, requiring a hard reset. Apple largely  
tackled this in OS X by basing the system off of a UNIX kernel, which  
basically runs each system process more independently, almost like  
individual applications. Memory is protected and other resources are  
shared rather than taken over and as such, an individual application  
or system process shouldn't take down the whole system when it  
crashes. There are several crash scenarios that will happen in OS X,  
and while most should not take down the system, there are a couple  
that can.



Here are the three main forms of crashes that people experience in OS  
X, along with a few methods for troubleshooting each type:

Unexpected quits
One common form of application malfunction is an "Unexpected Quit,"  
which will happen if an application or process cannot continue to run  
because of some dependency problem or other problem in the coding of  
the program. This can happen for a variety of reasons, but luckily  
Apple will display an error log for the application that will help you  
troubleshoot which application threads ran into problems. The error  
logs will usually indicate which threads crashed, and what functions  
that thread was running when it crashed. Many times this can help you  
pinpoint items that may need reinstallation (such as plug-ins), among  
other routes for troubleshooting. If the same application keeps  
crashing, contact the developer; however, you can try the following  
suggestions to help.

	1.  Remove plist files.
Try locating and removing plist files that are associated with the  
problematic application. These are usually found in the preferences  
folders in the Library folder under your account name, as well as in  
the Library folder at the root of the drive.

	2.   Reinstall application dependencies.
Sometimes applications will hang when they are not able to access  
other programs on which they depend. Most of these instances are plug- 
ins such as QuickTime and Flash, and it's recommended to reinstall  
these if they're referenced in the error logs for the crash.

	3.   Reinstall the application.
Try reinstalling the application to clear any problems with the  
binaries or other support files the application may use.

	4.  Troubleshoot with new or different accounts.
Many times these problems can be from file corruption or other  
problems with your account, which can be tested by creating a new  
account and launching the application in that account. If everything  
works, you can try searching for resources in your account that the  
application may use. Various locations in which to look include the  
following:
/username/Library/Preferences/
/username/Library/Application Support/
In addition, if there is a folder with the name of the problematic  
application that's in the /username/Library/ folder, then that's  
another source for troubleshooting.


Application hangs
The more frustrating application problems happen when a process hangs.  
The operating system is built to run independently of these processes,  
and usually will only show the infamous spinning color wheel when the  
hung application is in the foreground, which indicates the system is  
no longer able to communicate with the application. However, when a  
process that other applications depend on gets hung (such as underling  
system processes--Windowserver, QuickTime, etc), those applications  
may stop responding as well. There are several things you can try if  
an application hangs.

	1.   Force-quit
Press Options-Command-Escape to bring up the Force-quit window. If  
that does not work or if the hanging process is not listed, try using  
Activity Monitor to select the unresponsive application (which should  
appear in red) and quitting it. Select the application in the list,  
and then select "Send Signal to Process" in the "View" menu. From  
here, choose "Kill (SIGKILL)" in the drop-down menu and click "Send."  
This should quit the process. For any process that has "root" as the  
user, we recommend you restart the system instead of just quitting the  
process.

	2.   Run system maintenance utilities (Safe Mode, cache cleaners, etc).
Many times hangs can be the result of inaccessible files such as  
caches. There are a variety of utilities that can clean up caches and  
remove any corruption that can cause applications to hang, including  
Onyx, MacDust, and Leopard Cache Cleaner. Run the scripts in these  
applications to see if that clears the problem.

	3.   Boot into Safe Mode.
Booting into Safe Mode by holding the Shift key at bootup will run  
several maintenance scripts and could help clear problems that can  
have applications hanging.

	4.   Ensure peripheral devices do not go to sleep.
If you have attached drives and other devices that go into stand-by  
modes, the system might hang while it waits for them to start up and  
become available. One way to prevent this is to set the devices to not  
go into power-saving, sleep, or standby modes. Doing this will depend  
on the device and the software interface for it, so consult the manual  
and manufacturer's Web site for specific instructions.



Kernel panic
The least common form of a crash is a kernel panic, which usually  
indicates some problem with the system's ability to communicate with  
critical hardware, but can also be caused by problems with software  
that is trying to directly access hardware. In OS X and other UNIX- 
based systems, the kernel is the lowest level interface between the  
hardware and other software on the system. If it receives an erroneous  
command that causes problems from which it cannot recover, it will go  
into panic mode where it will quickly write a small log of what caused  
the panic to the NVRAM before halting all activity through the kernel  
and requiring a hard restart. On reboot, the system will write the  
NVRAM log to disk for troubleshooting.

Common cause of kernel panics is corruption in drivers (kernel  
extensions), faulty hardware (especially critical hardware such as RAM  
and drive malfunctions), and malfunctioning external hardware.  
Luckily, most random kernel panics are isolated events and can usually  
be dismissed. However, if they start occurring after recent changes to  
the system, some event such as a power outage, or otherwise start  
randomly but continuously occur, then you can try a few basic steps  
for resolving the issue.

	1.   Unplug all peripheral devices.
Remove all devices from the system except for the monitor and keyboard/ 
mouse. Then restart the system.

	2.  Reset PRAM and SMC.
Reset the PRAM by rebooting and holding the Options-Command-P-R keys,  
letting the system reset several times before releasing the keys and  
allowing the system to boot normally.

	3.   Run Apple's Hardware Test.
Insert the restore disk that came with your computer, and reboot while  
holding the "d" key, which should launch the diagnostics.

	4.   Thoroughly test RAM.
Run a RAM testing program, which may take awhile but will ensure the  
installed and recognized RAM is OK. One that we recommend is "Rember".

	5.   Repair hard drive.
Use Apple's Disk Utility (when booted off the install DVD) or a third- 
party disk repair program to run diagnostics and repairs on the hard  
drive.

	6.   Remove or reinstall newly added hardware.
If you have recently installed any expansion cards or memory, remove  
the upgrades and reboot the system.

	7.   Uninstall newly installed applications (restore to backups)
Lastly, if you have installed any applications, try removing them.  
This can probably most easily be done by restoring to a recent backup  
of the system, which is highly recommended before you install any new  
software.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://davesevick.com/pipermail/npmug/attachments/20090428/77acba30/attachment-0001.htm 


More information about the NPMUG mailing list