OSX: Can't start applications

My laptop computer (2.4 GHz Intel Core 2 Duo, running Mac OSX 10.6.8) has lately been occasionally getting itself into a state where applications won’t open. When it’s in this state, any currently-open application continues to work fine, but whenever I attempt to start a new application, the icon bounces up and down a couple of times, then just stops bouncing and nothing else happens. Restarting the computer fixes it (until next time), but I haven’t found anything else that does: Attempts at fast user switch do nothing (the box never comes up for username and password), logging out doesn’t work (it logs out and goes to the login background, but the login window never appears), and attempting to restart Finder kills Finder successfully, but it never restarts (possibly leaving me without a menu bar, if that was the last app running).

What could be causing this problem, and what can I do to fix it?

In my experience, opening applications can time out when the system is overloaded and can’t start the app promptly.
I would do two things:

  1. Run Applications>Utilities>Disk Utility
    Click on your Hard Drive in the selector and then “Repair Disk Permissions” (This is just to clean up in case it is something stupid)

  2. Run Applications>Utilities> Activity Monitor
    and Watch the CPU. What programs are hammering the CPU (especially when the programs fail to start)

I am betting that it is a Flash-heavy (or flash like) website putting a browser at 100%. Hulu, games, Netflix can all do it. Quitting the browser (and restarting) will usually solve the problem.

Quitting the browser and restarting can’t solve the problem, because once I’ve quit the browser, I can’t restart it. Even if I have no applications other than Finder running, I still get this problem. Nor can I run anything to diagnose the problem while it’s happening, since the problem is (again) that I can’t start applications.

Sounds like launchd is hosed.
Try looking in the Console ans see if any interesting errors are being logged.

Sorry to bump this, but I was waiting for it to happen again, so I’d have a fresh console log to check.

All last night (when I wasn’t using the computer), for as far back as I can see in the Console, it was logging a message every ten seconds:

Then, at 8:37 AM (still before I got up), for a change of pace, I got

I got a variety of other error messages over the next half-hour or so (several say “Job appears to have crashed: Abort trap”). At approximately 9:48 AM, I sat down in front of the computer, woke it up, and attempted a quick user switch, which failed. I attempted it again, and then attempted to start Quicktime, to confirm, which also failed. At that time, Console logged the following errors:

This last error repeated many times. Since then, I’ve also got the “throttling respawn” message many times.

I did check, incidentally, and /System/Library/StartupItems does, in fact, fail to exist, and I can’t create it, since I don’t have permissions (I’m sure there’s some way to authenticate for that, but I’m not sure what it is).

This one is very interesting.
Sounds like you may have serious directory corruption. I’d run DiskWarrior if you have it, or boot into single-user mode and run fsck -y.

How about Zapping the PRAM?

Just to confirm: Chronos, did you try running Disk Utility to fix disk permissions? You don’t need to wait until the problem is happening to repair the permissions and possibly fix the problem. In my experience, this fixes just about every quirky behavior I’ve seen.

I haven’t had a chance to try much of anything yet, but I will this evening.

OK, neither Disk Utility nor fsck created the /System/Library/StartupItems directory, but fsck did report and correct an inconsistent count of files and of directories. Impossible to say as yet whether this’ll fix the problem, since it was only sporadic.

my WAG is either the hard drive is 'bout to die or you’ve got bad RAM.

I certainly hope it isn’t hardware failure… This machine is only a year old.

And it just happened again. The dominant error still seems to be the one about not being able to count the files in /System/Library/StartupItems. Should I just log in as root and create that directory? Or go all the way and re-install the OS? Something in between?

Where repair disk [permissions] didn’t work, and you’re actually missing a System directory like this, I would go ahead, back up your data files, format (erase) the disk, and reinstall the OS from the DVD. (Then run Software Update to get back to 10.6.8.) It will take a few hours, it’s true, but it’s a much surer way.

This could be a hard drive issue – the OS literally can’t see the sector of the disk where the missing directory is stored – but it sounds more like an OS issue. I can’t see this being a RAM issue (the errors don’t match up), or a PRAM/NVRAM issue (this article explains why: Reset NVRAM on your Mac - Apple Support).

It sounds to me like your hard drive is about to fail, just as someone upthread mentioned. I just swapped out a hard drive for my brother yesterday; his hard drive failed completely (luckily not before I could rescue his important documents!). You can check to make sure the RAM is properly seated (pop out your battery, unscrew 3 screws, and you’re there), but it really sounds like a dying drive. I’m sure you’ve already thought of this, but just in case you havent, I’d recommend backing up what’s important to you on a couple of DVDs or an external drive.

Your issues (missing directories, problems running programs, etc) are pretty great early indicators of hard drive failure, so in a way you’re lucky. It could have just outright died.

As a final note, running techtool if you’ve got it isn’t a bad idea. There’s an outside chance you just have a corrupted operating system, so exhausting other options before buying a new drive is never bad.

I’m leaning more towards a dying drive, as I think about it, and I wanted to emphasize this advice.

This goes for everyone who owns a computer (whether it be Windows, Mac OS, Linux, or other): back up your important files. Frequently, and thoroughly. And, on an occasion, make sure that you can read the backups themselves.

Drive failures happen all too often, and your data is (presumably), too important. Back up often.

I do have an external drive hooked up to the machine; I’ll double-check that it’s big enough for a full backup. If not, then I’ll take it up here to the office, where I have a ton of excess drive space.

Did you run fsck again? Sometimes fixing directory errors reveals other errors. If it reports “File system was modified” it’s best to rerun it until it no longer says that.

Yes, I did re-run it; the second time came up clean.

A bit of googling suggests the StartupItems error is probably a red herring. You may be able to fix that by restoring that folder from Time Machine, or by opening terminal and running this at the command line:

sudo mkdir /System/Library/StartupItems

However that will only fix the symptom. As others have said, back up, as impending HDD failure is a high risk. The only thing I’d add is: don’t just back up your important files, back up everything. There’s always something important that gets forgotten otherwise.

If you’re not already, I’d highly recommend using Time Machine to keep everything backed up once you’ve fixed the problem.

Hey, my boss’s Mac just had this problem a couple months ago. I re-created the StartupItems folder and it went away … but I backed the entire drive up on an external drive just to be safe.

A week or so later, his drive was clicking like mad and wouldn’t start up.