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 > opendirectoryd trashing CPU after upgrade to Lion

opendirectoryd trashing CPU after upgrade to Lion
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 09:55 AM
 
Since upgrading to Lion I see a reoccurring issue whereby opendirectoryd will spin chewing up all my CPU. The image below shows the CPU spiking with automountd and opendirectoryd. When this is happening, I've noticed that it appears some applications become unresponsive when attempting to write to the file system, most noticeably is when developing in Eclipse.



Any suggestions on how to avoid this problem would be hugely appreciated. I do not see any red flags in system logs nor in /var/log/opendirectoryd.log

Thanks much.
     
Professional Poster
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Jul 29, 2011, 12:30 PM
 
Are you attached to an OD?
MacBook 2.0GHz CD; MacBook Pro 15" 2.4GHz Late '08; PowerMac G4 MDD Dual 1GHz; 3x Xserve G4 1GHz; Mac Mini 2GHz; Big pile of broken and working bits;
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 12:57 PM
 
That's the odd part, no. I do have a Time Capsule, but this is happening running on my home network. In addition to my MacBook Pro this is happening on, I do have an iMac also running Lion on the network, though no issues that I've observed on that one (though granted it's the "family" system and I do not touch it that often).

Cable Modem -> Time Capsule -> 802.11n Wireless -> Laptop running Lion

Nothing fancy installed. Normal standard tools like iStat Menus installed, etc. though I did just notice that I have an old Menu Meters installed that I didn't upgrade that I'll uninstall now.

Thanks for the quick response!
     
Professional Poster
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Jul 29, 2011, 02:44 PM
 
Fire up Console and check your logs for (very frequently) repeated messages. Probably involving launchd. It is most likely an app that hasn't been properly updated yet.
MacBook 2.0GHz CD; MacBook Pro 15" 2.4GHz Late '08; PowerMac G4 MDD Dual 1GHz; 3x Xserve G4 1GHz; Mac Mini 2GHz; Big pile of broken and working bits;
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 03:13 PM
 
Regarding launchd, I did indeed run into this problem with one app that I fixed last week. Some Video Accelerator that I barely recalled installing -- that has been removed and I stopped getting the lovely "trying again in 10 seconds". The only other messages I see repeat periodically were similar to the following.

I switched my Eclipse over to be Cocoa based instead of Carbon to see if this now fixes my issues. I've only just made the change so will take a few before I have an answer. Apart from these messages, there is nothing in my Console that appears very frequently and the opendirectoryd speedup seems to be much more frequent than the messages below.

Thanks again!

Jul 29 13:16:40 Macintosh eclipse[321]: kCGErrorInvalidConnection: CGSGetWindowTags: Invalid connection
Jul 29 13:17:54 Macintosh eclipse[321]: kCGErrorInvalidConnection: CGSGetWindowTags: Invalid connection
Jul 29 13:19:16 Macintosh java[3209]: dlopen(<snip>/plugins/org.eclipse.equinox.launcher.carbon.macosx_1.1.100 .v20110502/eclipse_1406.so, 1): no suitable image found. Did find:
<snip>/plugins/org.eclipse.equinox.launcher.carbon.macosx_1.1.100 .v20110502/eclipse_1406.so: no matching architecture in universal wrapper
Jul 29 13:19:23 Macintosh java[3210]: CPSSetForegroundOperationState(): This call is deprecated and should not be called anymore.
Jul 29 13:19:54 Macintosh eclipse[321]: kCGErrorInvalidConnection: CGSGetWindowTags: Invalid connection
Jul 29 13:26:07 Macintosh java[4677]: CPSSetForegroundOperationState(): This call is deprecated and should not be called anymore.
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 03:14 PM
 
Bummer, just as I finished posting this message, sure enough, the same opendirectoryd / automountd spinng CPU triggered again.
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 03:21 PM
 
To confirm, when the CPU pegs, there are no messages within a couple minutes in the Console.

I've read somewhere about turning up logging on opendirectoryd but I've had little luck making sense of it. Is there perhaps some extra logging I could turn on somewhere to get more information in my opendirectoryd.log file?

Cheers.
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 03:35 PM
 
OK, a bit more data...

I've turned on opendirectoryd debugging and I see it doing a huge number of ODQueryCreateWithNode

cat opendirectoryd.log | grep ODQueryCreateWithNode | wc -l
4446

This is 4,446 during one of the CPU pegging incidents. I'm not sure what ODQueryCreateWithNode is, but I see it doing repetitively ones like the following:

011-07-29 15:26:50.022 CDT - 25916.512071 - ODQueryCreateWithNode request, NodeID: 538667E6-2E44-42E4-B4F4-E7C0B6C63699, RecordType(s): dsRecTypeStandard:Users, Attribute: dsAttrTypeStandard:RecordName, MatchType: EqualTo, Equality: CaseIgnore, Value(s): src.zip, Requested Attributes: dsAttrTypeStandard:RecordType,dsAttrTypeStandard:R ecordName,dsAttrTypeStandard:HomeDirectory,dsAttrT ypeStandard:NFSHomeDirectory,dsAttrTypeStandard:Ap pleMetaRecordName,dsAttrTypeStandard:AppleMetaNode Location, Max Results: 2147483647
2

This is repeated for src.jar, src.zip, and *.

My guess is something is going on between Java (not included by default now in Lion) and opendirectoryd -- though I don't know what. Clearly this can't be just a catastrophic break with Java so something else is causing opendirectoryd and Java to misbehave. I'm going through my Java settings in Eclipse too to see if there is anything else that may cause this.
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Jul 29, 2011, 03:48 PM
 
Using odutil, I can see a bunch of search requests:

Macintoshesktop $ odutil show all
Active connections:

Node Refs Module Destination Socket Connected Shared Active Requests Credentials Timeout
-------------- ---- --------- ----------- ------ --------- ------ --------------- ----------- -------
/Local/Default 29 PlistFile X X 0 0
/Search 2 search X 0 0
/Search 2 search X 0 0
</Search repeated 20 more times>

Going through the Directory Utility, I can't see any specific directory information enabled.
     
Professional Poster
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Jul 29, 2011, 07:20 PM
 
Its definitely something to do with Java. I haven't delved into the guts of Lion much yet, but from flicking through the odd page here or there it looks like opendirectoryd might have taken over some duties from launchd since Snow Leopard. Which would at least explain the link.
MacBook 2.0GHz CD; MacBook Pro 15" 2.4GHz Late '08; PowerMac G4 MDD Dual 1GHz; 3x Xserve G4 1GHz; Mac Mini 2GHz; Big pile of broken and working bits;
     
Fresh-Faced Recruit
Join Date: Jul 2011
Status: Offline
Reply With Quote
Aug 1, 2011, 12:16 PM
 
On a whim I re-installed the Java Developer Documentation for 10.7 and I have not noticed any lockups since that change. So to recap, I'd summarize this as:

OS X Lion 10.7
with Java installed
without Java Developer Documentation

Eclipse > File Write actions often caused excessive ODQueryCreateWithNode operations causing spinning of opendirectoryd and automountd

Installing the Java Developer Documentation

Eclipse > File Write actions function correctly without lockup.

My guess is that something happens in the Java VM implementation on file writes that can potentially trigger a search for src.jar/src.zip, that when the Java Developer Documentation is not installed, fails / retries attempting to find the resource.

Certainly I may be completely off base, but that's the best I can do with the data available.

Thanks Waragainstsleep for your assistance. From my standpoint, at least I can work reliably again.
     
Professional Poster
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Aug 1, 2011, 12:57 PM
 
You're welcome. For all the good I did.
MacBook 2.0GHz CD; MacBook Pro 15" 2.4GHz Late '08; PowerMac G4 MDD Dual 1GHz; 3x Xserve G4 1GHz; Mac Mini 2GHz; Big pile of broken and working bits;
     
   
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 02:05 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