某些 Mac 应用程序频繁崩溃,回溯中出现“__THE_SYSTEM_HAS_NO_PORT_SETS_AVAILABLE__”

某些 Mac 应用程序频繁崩溃,回溯中出现“__THE_SYSTEM_HAS_NO_PORT_SETS_AVAILABLE__”

最近我发现一些 Mac OS X 应用程序频繁崩溃,并出现如下回溯:

Process:         Mail [39226]
Path:            /Applications/Mail.app/Contents/MacOS/Mail
Identifier:      com.apple.mail
Version:         4.4 (1082)
Build Info:      Mail-10820000~1
Code Type:       X86-64 (Native)
Parent Process:  launchd [338]

Date/Time:       2011-01-12 21:59:48.383 -0500
OS Version:      Mac OS X 10.6.6 (10J567)
Report Version:  6

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  12  Dispatch queue: com.apple.root.default-priority

[...]

Thread 12 Crashed:  Dispatch queue: com.apple.root.default-priority
0   com.apple.CoreFoundation        0x00007fff81653975 __THE_SYSTEM_HAS_NO_PORT_SETS_AVAILABLE__ + 5
1   com.apple.CoreFoundation        0x00007fff815a1f69 __CFRunLoopFindMode + 553
2   com.apple.CoreFoundation        0x00007fff815a1c5d __CFRunLoopCreate + 317
3   com.apple.CoreFoundation        0x00007fff815a1a78 _CFRunLoopGet0 + 744
4   com.apple.CoreFoundation        0x00007fff815dc90a CFRunLoopRunInMode + 58
5   com.apple.MessageFramework      0x00007fff81d01183 +[NSRunLoop(MessageExtensions) _flushQueuedEventsAddingSource:] + 120
6   com.apple.MessageFramework      0x00007fff81d010d2 +[NSRunLoop(MessageExtensions) flushQueuedEvents] + 36
7   com.apple.MessageFramework      0x00007fff81ce6515 -[_MFInvocationOperation main] + 275
8   com.apple.Foundation            0x00007fff83921de4 -[__NSOperationInternal start] + 681
9   com.apple.Foundation            0x00007fff83a00beb __doStart2 + 97
10  libSystem.B.dylib               0x00007fff801402c4 _dispatch_call_block_and_release + 15
11  libSystem.B.dylib               0x00007fff8011e831 _dispatch_worker_thread2 + 239
12  libSystem.B.dylib               0x00007fff8011e168 _pthread_wqthread + 353
13  libSystem.B.dylib               0x00007fff8011e005 start_wqthread + 13

[...]

和:

Process:         osascript [34568]
Path:            /usr/bin/osascript
Identifier:      osascript
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  GeekTool [6699]

Date/Time:       2011-01-19 06:06:41.198 -0500
OS Version:      Mac OS X 10.6.6 (10J567)
Report Version:  6

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation        0x00007fff81653975 __THE_SYSTEM_HAS_NO_PORT_SETS_AVAILABLE__ + 5
1   com.apple.CoreFoundation        0x00007fff815a1f69 __CFRunLoopFindMode + 553
2   com.apple.CoreFoundation        0x00007fff815a1c5d __CFRunLoopCreate + 317
3   com.apple.CoreFoundation        0x00007fff815a1988 _CFRunLoopGet0 + 504
4   com.apple.CoreFoundation        0x00007fff815a177f CFRunLoopGetMain + 79
5   com.apple.CoreFoundation        0x00007fff815a08ef _CFXNotificationCenterCreate + 383
6   com.apple.CoreFoundation        0x00007fff815a073b _CFXNotificationGetHostCenter + 75
7   com.apple.CoreFoundation        0x00007fff815a0532 __CFXPreferencesGetSourceForTriplet + 354
8   com.apple.CoreFoundation        0x00007fff8159db49 __CFXPreferencesGetSearchListForBundleID + 217
9   com.apple.CoreFoundation        0x00007fff8159d9fb CFPreferencesCopyAppValue + 43
10  com.apple.CoreFoundation        0x00007fff8159d999 _CFBundleCopyUserLanguages + 665
11  com.apple.CoreFoundation        0x00007fff8159d1b4 _CFBundleAddPreferredLprojNamesInDirectory + 404
12  com.apple.CoreFoundation        0x00007fff8159cc8a _CFBundleGetLanguageSearchList + 170
13  com.apple.CoreFoundation        0x00007fff8159d4ba _CFBundleAddPreferredLprojNamesInDirectory + 1178
14  com.apple.CoreFoundation        0x00007fff8159cc8a _CFBundleGetLanguageSearchList + 170
15  com.apple.CoreFoundation        0x00007fff8159cadf CFBundleCopyResourceURL + 47
16  com.apple.CoreFoundation        0x00007fff815fe4c4 _CFBundleCopyResourceForkURLMayBeLocal + 148
17  com.apple.CoreFoundation        0x00007fff8162c7d0 CFBundleOpenBundleResourceFiles + 144
18  ...ple.CoreServices.CarbonCore  0x00007fff885f3130 _openFrameworkResourceFiles + 137
19  ...ple.CoreServices.CarbonCore  0x00007fff885e048c CLVVisitValuesForKey + 81
20  ...ple.CoreServices.CarbonCore  0x00007fff885f2fee INIT_ResourceManager + 734
21  ...ple.CoreServices.CarbonCore  0x00007fff885f2bed StandardEntry + 57
22  ...ple.CoreServices.CarbonCore  0x00007fff885f2af9 FSOpenResourceFile + 77
23  ...ple.CoreServices.CarbonCore  0x00007fff886543fc FSOpenResFile + 75
24  com.apple.openscripting         0x00007fff844e8884 OSADoIt(short, ComponentInstanceRecord*, FSRef const*, unsigned int, unsigned int, int, unsigned int*, AEDesc*, unsigned char*) + 2715
25  com.apple.openscripting         0x00007fff844e8b6a OSALoadFile + 50
26  osascript                       0x0000000100001898 0x100000000 + 6296
27  osascript                       0x0000000100000fa0 0x100000000 + 4000

对于造成这种情况的原因和/或如何补救,您有什么想法吗?

答案1

我不是内核程序员,但我猜想该消息与内核中 Mach 端口耗尽有关。您是否正在运行无数个进程,或者您是否在进行大量进程间通信?您是否可能内存和磁盘空间不足(没有空间扩展交换区)?

尝试使用top或活动监视器来查看是否有任何进程出现问题,比如您可能编写了一个递归 AppleScript 或 shell 脚本,它会产生无数的子进程(就像意外的“fork 炸弹”)。

遇到此崩溃时,请注意您正在运行哪些应用程序。也许某个应用程序过度使用 Mach 端口,有时会吞噬所有端口。当您运行虚拟机系统(例如 VMware、Parallels 或 VirtualBox)时,是否更容易出现此问题?

答案2

嗯。我尝试重置 SyncServices ---http://support.apple.com/kb/TS1627--- 从那时起 Mail 就再也没有崩溃过。

相关内容