Troubleshooting the Mysterious “-122” Shutdown Code
In an earlier article, “Mac G5 Desktop Spontaneously Shuts Down,” I discuss a problem with Macintosh OS X computers that can be difficult to diagnose, and for which there is precious little accurate information available to assist you – online or even with Apple Support!
If you are experiencing mysterious and random shutdown events on your Mac, check your system.log file for the following text, or something very similar:
ApplePMU::PMU FORCED SHUTDOWN, CAUSE = -122
or, as reported for later model G5's:
AppleSMU -- shutdown cause = -122
This discussion is an update of that earlier article, including specific troubleshooting suggestions, as well as new information gleaned from comments and emails detailing the experiences of readers of this blog. Yes, this problem may be serious, but it also can be as simple as a loose power cord. Read on to get the benefit of some hard won wisdom!
Click here to jump straight to the Troubleshooting section!
Symptoms to Look For
The symptom of this problem is that the Macintosh will mysteriously and randomly shut itself off. Perhaps you leave your Mac on all the time, and you just walked in to find your Macintosh completely shut off; or, perhaps you are using your Mac, and suddenly it turns off as if someone pulled the power cord right out of the wall. The key here is that the Macintosh is shutting itself off completely. There is no “crash,” no error dialog – just a computer that is suddenly completely turned off.
If this is what you are experiencing, make sure to check the system.log file (go your Applications folder, open the Utilities folder, and then open the Console application; click on the Logs button, then choose system.log from the list on the left). Find the section with the date and time showing the most recent reboot, and look carefully for text that mentions “shutdown” and look for an error code. The paragraph at the beginning of this article lists two actual log entries as examples, although future releases of the operating system may vary the text somewhat.
If you see a shutdown message that lists the numeric code “-122” then read on; any other numeric code will indicate issues other than what is addressed here.
A Little Background
Depending on the age and model of Mac you have, the power is controlled either by a Power Management Unit (PMU) or a Systems Management Unit (SMU). The changeover appears to have taken place around late 2004, but it doesn’t really affect the issue discussed in this article. I’ll use the term “SMU” in the rest of the article for convenience.
When the SMU has to initiate a shutdown, it attempts to store a code (either on the hard disk, or in non-volatile RAM) that indicates the reason for the shutdown. The codes indicate reasons running the gamut from emergency thermal shutdowns to the power units just getting “confused.” The code that concerns us here (code -122) seems to appear whenever there is a sudden loss of power to the computer.
There is surprisingly little information out on the Internet that really discusses this problem. Even Apple Support seems confused, giving very uneven responses to callers, and inconsistent repair recommendations. One thing to be aware of, should you have searched the Internet already, is that an old Macintosh OS 9 error code list is floating around, listing an “-122” error as some kind of file system error (to be specific, a “badMovErr” under the HFS file system). This does not apply to Macintosh OS X at all, so just ignore this red herring.
Outright Speculation
In the absence of specific official information, my speculation regarding this is that the operating system takes advantage of a common technique to handle unknown events. After the computer boots up and all is well, the SMU writes out a special code to indicate that it started up normally – we’ll call it “000”; when the SMU next shuts down the computer, it writes out a different code. Let’s say it writes out “001” for a normal shutdown. The next time the computer boots up, if it sees a “001” code, it knows that the last time it shut down, all was well, and so it doesn’t make any mention of any problems in the system.log file. But let’s say that the SMU shut down the computer for a reason, like an overheating condition. In this case, the SMU might write out a different code, like “999.” When the Mac next boots up, it sees the “999” code, and so it writes out a message in the system.log letting you know that the SMU forced a shutdown for a reason.
But think about this for a second: if someone literally trips over your power cord, your computer instantly loses power. The SMU doesn’t get a chance to do anything, and so it never gets a chance to write ANY code out. As a result, the “000” code is left in non-volatile memory, since it was the last code written out when the computer started up normally. When next the Mac reboots, it reads in the code, and when it sees “000” instead of any of the other codes, it knows that the computer shut down abnormally, but it has no clue of why. In this specific case—sort of the “mystery” case—the message that gets written out to the system.log file indicates that the SMU shutdown cause was “-122.” That is to say, when you see the “-122” code, it means that there was a sudden and catastrophic loss of power to the main logic board. Unfortunately, it doesn’t tell you the actual reason behind it.
The Likely Culprits (… And At Last, Some Troubleshooting)
When you are in this situation, there are a number of possible reasons for a sudden loss of power. More or less in order of how easy/cheap they are to fix, here are my top contenders:- Software Problems: although I don’t think the -122 code is generated by software issues, it’s standard practice at Apple to recommend that you reset the SMU (or PMU) on your Macintosh. And it’s easier than any of the following! So, try it out. Check the Apple Support site for an article on your computer; there are variations in the method and the effects, depending on your computer, so read carefully before doing anything. Here are some quick links that were active as of this writing:
-
Preference Problems: again, I don’t believe the -122 code is caused by the PMU “just getting confused,” but it doesn’t hurt to try this other standard Apple recommendation: delete the files “com.apple.powermanagement.plist” and “preferences.plist” from your Library/Preferences/SystemConfiguration folder.
Note: I have not personally received this information from Apple, but it has been related to me through comments and email messages. I strongly recommend that you confirm with Apple the proper files to delete before performing this step, and make sure to make backup archives of these files before deleting them!
Power Cord and Computer Case Problems: make sure your power cord is firmly plugged in to the back of the Macintosh, as well as the power outlet. If you’re using a power strip, take it out and plug it directly into the wall. Swap out a different power cord. There is also a report that an improperly closed case will cause this problem, so if you have recently installed RAM or an Airport Card in your Mac, make sure your case is completely closed, seated properly, and sealed tight.
External Device Problems: at least one user has reported definitively that his problems were caused by a bad external FireWire cable. I would recommend unplugging all external devices and their cables (external hard drives, iPod docks/cables, digital camera docks, printers, etc.) and see if it has any effect on the problem.
External Power Problems: perhaps the quality of the external power coming into your Mac is bad. Perhaps you’re on an overloaded circuit, or there’s a big load on your service that comes and goes, or you just have a bad plug. Try plugging your Mac into a different plug, and preferably a different circuit in your home/office. Or, move it to a different home/office and try it there. If you’re using a UPS (uninterruptible power supply), try plugging your Mac into a different UPS, or directly into the wall. UPS’s do fail, and in fact this is what introduced me to this very problem! If you’re not using a UPS, borrow one from a friend, and seriously consider buying one. While a quality UPS will allow your Mac to run for 10’s of minutes or longer (if you shell out a couple of hundred bucks!), decent UPS’s that will handle transient power failures of less than a minute can be had for less than $40 at your local office supply store.
-
Internal Component Failure: this is where things start to get a little ugly and a little expensive. When you have an intermittent hardware failure, they are notoriously hard to nail down exactly. The two main culprits are the power supply that converts AC power from the wall to DC power for your circuits, and the main logic board itself. At this point, I fear you're in the fine hands of Apple Support. If you’re writing the checks, I suspect that the power supply is the less expensive component, but if you’re under warranty, you’ll have to go with whatever Apple suggests.
Note: If you do have a bad internal component, I heartily recommend making sure you’re on a UPS when you get your computer back, as normal household power can be pretty tough on today’s electronics. Something caused your normally reliable hardware components to fail, and a UPS will go a long way to improving the power quality and preventing damaging power surges in the future.
Closing Thoughts
I hope that this article has been of help to you if you find yourself experiencing this maddening error. There is nothing worse than having your Macintosh just “turn off” for no apparent reason. And, it’s certainly not easy on your computer, either!
If you do find yourself experiencing this error, and manage to correct it, please take a moment to post your experience here on this blog entry – it’s through your efforts that we can add to the online knowledgebase for future readers!
Cheers!
..Chris..
Comments
Point of reference:
I started getting the -122 AppleSMU restart error on spontaneous shutdowns about 8 months after I got my second generation iMac G5. Tried the usual, PMU, VRAM, SMU, etc and got a UPS. None of these fixed it. Took it to the Apple store and they replaced the power supply in 20 minutes and the problem has gone away. Thanks for this page of troubleshooting ideas, ultimately it was a hardware problem....
Posted by: Harold | February 18, 2006 04:00 PM
One very, very, very trivial cause for repeated spontaneous shutdowns of the G5 iMac is incorrect replacement of the back cover, e.g. after installing an Airport card or RAM module.
A friend of mine wasted days on searching for hints and remedies on the net, and when I looked at his iMac, I noticed the back cover wasn't properly closed at the top, leaving a small gap that had escaped his attention.
It's easy to miss that when your dead frustrated about the problem!
The machine resumed its usual flawless operation after repositioning the back cover, taking care to properly align the tabs on the top edge of the back cover with the slots on the top edge of the computer.
Please don't be offended by this elemntary advice, but always make sure to check this first!
Posted by: GuyM | February 19, 2006 05:17 PM
I really think it is not a software problem because my iMac (Rev.B 20") just shut itself down when I was in Open Firmware.
I also think that it has nothing to do with the quality of my power circuit. I used my Mac for 10 months now on the same cicuit and I never had the problems. I first noticed the "problem" 3 days ago when I woke up in the morning and the iMac was powered off. I usually only use suspend.
i even switched the circuit and tried it at my parents home, but it happened again.
I can not reproduce this. Sometimes it happens moments after booting up, sometimes it happens after several hours.
I will bring it to an Apple service partner this week and we'll see...
ben
Posted by: Ben | February 27, 2006 11:15 AM
It certainly sounds like, in this case, the hardware (power supply and/or main logic board) need to be your top suspects. Random failures are such a pain to diagnose accurately.
Good luck!
..Chris..
Posted by: Chris Gibson | February 27, 2006 01:07 PM
I just thought, maybe it really is my power circuit, but damage to the logicboard/power supply was already done and this is why it even happens at my parents home.
I just remember that 2 normal atx pc power supplies have already died here. I always thought that these were bad quality, but with the thing happening to my iMac ...
After the repair is done I will get an UPS, so hopefully this will secure my mac a little.
Posted by: Ben | February 28, 2006 05:04 AM
Hi Ben - I think getting the UPS is a great idea. I have lived in two states here in the U.S. that have a lot of lightning and thunderstorms, and in both houses I experienced a lot of "mysterious" electronic component failures...until I put everything on UPS's and surge suppressors. As I mentioned in the troubleshooting section, if you wind up needing a new power supply or logic board, putting the Mac on a UPS after the repair is probably good insurance for the future.
Good luck!
..Chris..
Posted by: Chris Gibson | February 28, 2006 09:54 AM
OK, this is weird.
The last time it happened, I deactivated some menubar-haxxies and deleted the ATI control-panel. Since then (3 or 4 days) I haven't had a sudden shutdown. I even tried running the iMac on full load for about 5 hours (encoding h.264) without any problems. The Mac was really heated up (cpu-temp at about 85°C).
Maybe the local power-company had some problems with fluctuating currents....
Let's see how long it works.
Next time it happens, I will bring it to Apple-service.
I live in Germany, so we do not have Apple-stores. Only certified Apple dealers, but the reputation of the shop here in my town isn't the best. Maybe I have to ship it in, but then I will be without my Mac for about 2 weeks (I cannot live without my Mac anymore :) ).
I will keep you updated.
Posted by: Ben | March 6, 2006 11:00 AM
FYI, I just had this happen on my Power Mac G4 with a GigaDesign Dual 1.2GHz card (first time).
The system suddenly powered down. Fortunately, I also have two other computers running (a Cube and an older Sawtooth G4). They are both on the same physical circuit but plugged into different power strips. These two systems did not go down.
Therefore, the voltage drop occurred on just one power strip and not the entire circuit as my cable modem also reset and the cordless phone also played its built in message (when it loses power) at the same time my system shutdown (they are connected to the same strip as my QuickSilver).
So at least from the experience I just had, it does seem to be power related where the anomaly is within a certain range that it allows the PMU enough time to sense and register a voltage drop before cutting power to the system.
Conjecture (for at least the -122 case): possibly it could be a power spike condition from a very quick fluctuation/brown out and the PMU registers the condition and immediately kills power to save the rest of the system. A bad power supply with a faulty voltage regulator might likely also trigger the same set of conditions which again is meant to save the rest of the system from damage.
Posted by: QuickSilver 2002 Owner | March 22, 2006 10:10 PM
Thanks for this article. I have been seeing my iMac G5 shut down randomly for a couple of weeks and was getting really frustrated with it. I found the shutdown cause (-122) and found your article. I suspected HW due to the many other postings about bad power supplies and midplanes, but wanted to exhaust all other possibilities. I trashed the energy saver .plist and reset the SMU last night and haven't seen it shutdown in 24 hours. It usually shuts down anywhere from 5 min to 4 hours. So it looks like something corrupt in the power control was causing this. Thanks for the help.
Posted by: David Yen | April 6, 2006 10:50 PM