I've been getting a lot of spinning beach balls recently in different apps on OSX. They seem to happen with great frequency when right clicking, but this is not restricted to a single app. It happens in Safari, Adium, NetNewsWire, etc. My gut feel is that there is that there is some common facility/plugin/routine causing this, likely from some third party extension or something else I've enabled.

What is the best way to go about trying to troubleshoot this kind of issue? Can I somehow dump the hung app to see what it is trying to do? Are there some things I can do to track down what might be causing this.


One utility to track down hangs is called Spin Control, which is installed with Apple's Developer Tools in the /Developer/Applications/Performance Tools folder. Once you open it, and an application hangs, it will ask for your password and start collecting data. Once the application crashes or becomes responsive again, you can look at the report it collected.

Detected Hangs

Sample Report

You can poke through the report and look at the listed calls, which are all the things the program was doing (indented items are sub-calls). The number next to each item in the list appears to be how much time was spent in that call, so if you look at the names of them (at least the intelligible ones), you may be able to glean some information as to what was taking so long. If you find something you're not sure of, you can also ask about it specifically.

And, if an application crashes, if you click the "Report" button, you will get a similar list of the things the program was doing when it crashed, in addition to the error that was raised. If you look at the error description, and look near the end of the list of calls, you can probably figure out what went wrong.

  • Also, you can try a similar thing with Shark, also installed with the developer tools. – jtbandes Jul 16 '09 at 23:25
  • 1
    IIRC, neither of these tools are part of a default install of OS X – you'll need to download the developer tools from developer.apple.com or your OS X install disc (they're worth having, and are by no means limited in use just to "developers") – David Snyder Jul 16 '09 at 23:30
  • That's correct, they're not installed by default. The download is usually around a couple gigabytes, but as you said, it's pretty worth it. – jtbandes Jul 16 '09 at 23:33
  • As already mentioned but to highlight it is on the OSX install discs as well. – BinaryMisfit Jul 17 '09 at 15:40
  • 1
    I believe that the version on install discs may be quite out of date. I downloaded the tools recently from Apple, and they were just under a gig (not a couple of gigs). – Telemachus Jul 17 '09 at 15:43

Thanks for the responses, they were very helpful. jtbandes gave me the first step in solving the issue, but I wanted to go into detail of the other parts in case it helps others.

I was able to get the problem to happen in a reasonably reproducible way with Adium. Basically, start the app up, open a conversation, type in some text and then right click on some of the text. Spinner the first time after launch, lasting for over a minute.

So I started up Spin Control, went into the preferences to target only Adium, followed the procedures to cause the problem. Was able to get a text report of the issue and found what I expected was the issue:

    5531 Thread_7203
  5531 0x30b9
    5531 0x3192
      5531 NSApplicationMain
        5531 -[NSApplication run]
          5531 -[NSApplication sendEvent:]
            5531 -[NSWindow sendEvent:]
              5531 -[NSTextView rightMouseDown:]
                5531 -[NSView rightMouseDown:]
                  5531 -[NSMenu _popUpMenuWithEvent:forView:]
                    5531 -[NSMenu _popUpContextMenu:withEvent:forView:]
                      5531 -[NSMenu _popUpContextMenu:withEvent:forView:withFont:]
                        5531 -[NSCarbonMenuImpl _popUpContextMenu:withEvent:forView:withFont:]
                          5531 _NSPopUpCarbonMenu1
                            5531 _NSPopUpCarbonMenu2
                              5531 _NSPopUpCarbonMenu3
                                5531 _ContextualMenuInsertItems
                                  5531 ContextualMenuInsertItems(MenuData*, unsigned short, AEDesc const*, ContextualMenuHelp const*, unsigned long*, OpaqueContextualMenuItemsRef**)
                                    5531 TContextualMenuPluginList::GetPlugins()
                                      5531 TContextualMenuPlugin::LoadContextualMenuPlugins(FSRef const&, __CFArray*)
                                        5531 TContextualMenuPlugin::LoadCMPluginsFromCFPlugin(FSRef const&, __CFArray*)
                                          5531 0x1d1ee0d6

So it did appear that I was running into an issue with a plugin, but the context lacked for details of which.

So I relaunched Adium but this time I also had the Activity Monitor open and selected the process and used Inspect->Open Files and Ports to monitor what specifically the app was working with. When I repeated the steps to generate the problem, I was able to grab the following from the listing (note new files/ports opened appear at the end of the list, so it is easiest to find the problem by looking at the end of the list):

/Users/tim/Library/Contextual Menu Items

From this I was able to go through the items in my local Context Menu Items directory and determine the one causing the problem.

Thanks for the help.

  • 1
    Hey, great troubleshooting! Glad you solved it. – jtbandes Jul 17 '09 at 16:55

Well, it could be a 3rd party extension, or it could be low ram or a slow harddisk. What kind of computer is it? Open up "System Preferences." Do you have any icons under "Other"? Open up /Library/InputManagers. Are there any files there? When an app hangs, force quit it and click on "Report." Post the log here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.