macports hangs while installing port

Clemens Lang cal at macports.org
Fri Sep 7 12:04:59 PDT 2012


Taking this to -dev, because I think it's rather development related and
might be a bug in some Apple utility.

On Wed, Aug 29, 2012 at 03:12:27PM +0300, Viktor Remennik wrote:
> there's a common point in both cases. port run something that is
> trying to check a version. Found another case with javac -version with
> the same symptoms.
> 
> >>here's the ps and test:
> >>
> >>  502  7780  7754   0 11:03PM ttys000    0:17.65 /usr/bin/tclsh /opt/local/bin/port -d install openssh
> >>  502 12739  7780   0 11:16PM ttys000    0:00.00 sh -c  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_python27/python27/work/Python-2.7.3" && ./configure --prefix=/opt/local --enable-framework=/opt/local/Library/Frameworks --enable-ipv6
> >>  502 12740 12739   0 11:16PM ttys000    0:00.17 /bin/sh ./configure --prefix=/opt/local --enable-framework=/opt/local/Library/Frameworks --enable-ipv6
> >>  502 13221 12740   0 11:16PM ttys000    0:00.00 /bin/sh ./configure --prefix=/opt/local --enable-framework=/opt/local/Library/Frameworks --enable-ipv6
> >>  502 13222 13221   0 11:16PM ttys000    0:00.01 sw_vers -productVersion
> >>  502 13223 13221   0 11:16PM ttys000    0:00.00 sed s/\(10\.[0-9]*\).*/\1/
> >>    0   557   546   0 Mon03PM ttys001    0:00.03 login -fp viktor

A similar hang was just reported on IRC and we were able to collect some
data on the problem. Interestingly, the hanging process was sw_vers in
both cases.

In particular, the subversion port's configure script was affected,
which calls sw_vers in ./build/ac-macros/java.m4:
	OSX_VER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`

I told the user to sample the hanging sw_vers process using Activity
Monitor. The result is attached and it seems there's a deadlock in
there, because all samples show the process in semaphore_wait_trap.

What are we going to do about this? Should we file this with Apple? Did
somebody already do this? Any Apple engineers reading this that could
comment and/or look into this?

-- 
Clemens Lang

-------------- next part --------------
Analysis of sampling sw_vers (pid 5017) every 1 millisecond
Process:         sw_vers [5017]
Path:            /usr/bin/sw_vers
Load Address:    0x101ebd000
Identifier:      sw_vers
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  sh [5016]

Date/Time:       2012-09-07 20:39:29.568 +0200
OS Version:      Mac OS X 10.8.1 (12B19)
Report Version:  7

Call graph:
    2784 Thread_33167   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2784 start  (in libdyld.dylib) + 1  [0x7fff8dda87e1]
    +   2784 ???  (in sw_vers)  load address 0x101ebd000 + 0x8bb  [0x101ebd8bb]
    +     2784 _CFCopyVersionDictionary  (in CoreFoundation) + 181  [0x7fff8a2d3965]
    +       2784 _CFCopyLocalizedVersionKey  (in CoreFoundation) + 144  [0x7fff8a2d3b80]
    +         2784 CFBundleCopyLocalizedString  (in CoreFoundation) + 448  [0x7fff8a2d5530]
    +           2784 _CFBundleCopyFindResources  (in CoreFoundation) + 1709  [0x7fff8a372a1d]
    +             2784 _CFBundleCopyURLsOfKey  (in CoreFoundation) + 361  [0x7fff8a375529]
    +               2784 _CFBundleCopyQueryTable  (in CoreFoundation) + 279  [0x7fff8a370e87]
    +                 2784 _CFBundleCreateQueryTableAtPath  (in CoreFoundation) + 761  [0x7fff8a374609]
    +                   2784 _CFBundleGetLanguageSearchList  (in CoreFoundation) + 107  [0x7fff8a2c316b]
    +                     2784 _CFBundleAddPreferredLprojNamesInDirectory  (in CoreFoundation) + 308  [0x7fff8a2c2944]
    +                       2784 _CFBundleGetLanguageSearchList  (in CoreFoundation) + 107  [0x7fff8a2c316b]
    +                         2784 _CFBundleAddPreferredLprojNamesInDirectory  (in CoreFoundation) + 440  [0x7fff8a2c29c8]
    +                           2784 dispatch_once_f  (in libdispatch.dylib) + 50  [0x7fff8d13c085]
    +                             2784 _dispatch_client_callout  (in libdispatch.dylib) + 8  [0x7fff8d13c0fa]
    +                               2784 ___CFBundleCopyUserLanguages_block_invoke_0  (in CoreFoundation) + 35  [0x7fff8a3731e3]
    +                                 2784 CFPreferencesCopyAppValue  (in CoreFoundation) + 186  [0x7fff8a2e467a]
    +                                   2784 +[CFPrefsSearchListSource withSearchListForIdentifier:perform:]  (in CoreFoundation) + 205  [0x7fff8a40e57d]
    +                                     2784 -[CFPrefsSearchListSource addManagedSourceForIdentifier:user:]  (in CoreFoundation) + 108  [0x7fff8a40eddc]
    +                                       2784 +[CFPrefsManagedSource withSourceForIdentifier:user:perform:]  (in CoreFoundation) + 235  [0x7fff8a41194b]
    +                                         2784 -[CFPrefsManagedSource initWithDomain:user:byHost:]  (in CoreFoundation) + 56  [0x7fff8a411a58]
    +                                           2784 _CFPreferencesIsManaged  (in CoreFoundation) + 92  [0x7fff8a30277c]
    +                                             2784 dispatch_once_f  (in libdispatch.dylib) + 50  [0x7fff8d13c085]
    +                                               2784 _dispatch_client_callout  (in libdispatch.dylib) + 8  [0x7fff8d13c0fa]
    +                                                 2784 ___CFPreferencesIsManaged_block_invoke_0  (in CoreFoundation) + 120  [0x7fff8a40ce68]
    +                                                   2784 withDaemonConnection  (in CoreFoundation) + 36  [0x7fff8a40ced4]
    +                                                     2784 setUpDaemonConnectionIfNecessary  (in CoreFoundation) + 316  [0x7fff8a411e6c]
    +                                                       2784 xpc_connection_send_message_with_reply_sync  (in libxpc.dylib) + 127  [0x7fff8e09fe1f]
    +                                                         2784 _dispatch_semaphore_wait_slow  (in libdispatch.dylib) + 241  [0x7fff8d13f4c2]
    +                                                           2784 semaphore_wait_trap  (in libsystem_kernel.dylib) + 10  [0x7fff8629b6c2]
    2784 Thread_33172   DispatchQueue_2: com.apple.libdispatch-manager  (serial)
      2784 _dispatch_mgr_thread  (in libdispatch.dylib) + 54  [0x7fff8d13ea2a]
        2784 _dispatch_mgr_invoke  (in libdispatch.dylib) + 883  [0x7fff8d13ee26]
          2784 kevent  (in libsystem_kernel.dylib) + 10  [0x7fff8629dd16]

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        kevent  (in libsystem_kernel.dylib)        2784
        semaphore_wait_trap  (in libsystem_kernel.dylib)        2784

Binary Images:
       0x101ebd000 -        0x101ebdfff +sw_vers (??? - ???) <6547B56E-1F9C-3819-AE71-7369277DA5E3> /usr/bin/sw_vers
    0x7fff61abd000 -     0x7fff61af193f  dyld (210.2 - ???) <A40597AA-5529-3337-8C09-D8A014EB1578> /usr/lib/dyld
    0x7fff8628b000 -     0x7fff862a6ff7  libsystem_kernel.dylib (2050.9.2 - compatibility 1.0.0) <F646589B-13F8-3685-8C17-92C77993AE86> /usr/lib/system/libsystem_kernel.dylib
    0x7fff86a0e000 -     0x7fff86b26a27  libobjc.A.dylib (228.0.0 - compatibility 1.0.0) <9FA80CDA-97F4-3801-8879-0C1B976BC5CA> /usr/lib/libobjc.A.dylib
    0x7fff86b6a000 -     0x7fff86b71fff  libcopyfile.dylib (89.0.0 - compatibility 1.0.0) <876573D0-E907-3566-A108-577EAD1B6182> /usr/lib/system/libcopyfile.dylib
    0x7fff871ac000 -     0x7fff871d0ff7  libc++abi.dylib (24.2.0 - compatibility 1.0.0) <340E7C7B-DC93-3AA2-B015-B1C9541EC255> /usr/lib/libc++abi.dylib
    0x7fff871d1000 -     0x7fff873d1fff  libicucore.A.dylib (49.1.0 - compatibility 1.0.0) <17E8B610-6B16-3F91-B49C-7CAE0D08E9CF> /usr/lib/libicucore.A.dylib
    0x7fff8779b000 -     0x7fff877c9ff7  libsystem_m.dylib (??? - ???) <B434BE5C-25AB-3EBD-BAA7-5304B34E3441> /usr/lib/system/libsystem_m.dylib
    0x7fff87ab0000 -     0x7fff87b7cfef  libsystem_c.dylib (825.24.0 - compatibility 1.0.0) <16B6B86C-53EE-36E8-AC2B-4AADC1008098> /usr/lib/system/libsystem_c.dylib
    0x7fff87c62000 -     0x7fff87c6aff7  libsystem_dnssd.dylib (??? - ???) <B9F7B01D-8FAF-3CA5-909E-4D52B8D2DD8A> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff87cec000 -     0x7fff87d22fff  libsystem_info.dylib (??? - ???) <4FFCA242-7F04-365F-87A6-D4EFB89503C1> /usr/lib/system/libsystem_info.dylib
    0x7fff8837f000 -     0x7fff88384fff  libcache.dylib (57.0.0 - compatibility 1.0.0) <65187C6E-3FBF-3EB8-A1AA-389445E2984D> /usr/lib/system/libcache.dylib
    0x7fff884f8000 -     0x7fff88560ff7  libc++.1.dylib (65.1.0 - compatibility 1.0.0) <20E31B90-19B9-3C2A-A9EB-474E08F9FE05> /usr/lib/libc++.1.dylib
    0x7fff88561000 -     0x7fff8856fff7  libsystem_network.dylib (??? - ???) <0D99F24E-56FE-380F-B81B-4A4C630EE587> /usr/lib/system/libsystem_network.dylib
    0x7fff89256000 -     0x7fff89264fff  libcommonCrypto.dylib (50000.0.0 - compatibility 1.0.0) <2D6537F5-1B5E-305C-A1CF-D1FA80CA3939> /usr/lib/system/libcommonCrypto.dylib
    0x7fff89265000 -     0x7fff89266fff  libDiagnosticMessagesClient.dylib (??? - ???) <56A70657-E8C2-3804-AB87-77DC100512A4> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff89341000 -     0x7fff89343fff  libquarantine.dylib (52.0.0 - compatibility 1.0.0) <4BE2E642-A14F-340A-B482-5BD2AEFD9C24> /usr/lib/system/libquarantine.dylib
    0x7fff89ad7000 -     0x7fff89b26ff7  libcorecrypto.dylib (??? - ???) <57BC99C6-3C3F-344C-BDD6-25E845D956F2> /usr/lib/system/libcorecrypto.dylib
    0x7fff89dde000 -     0x7fff89e47fff  libstdc++.6.dylib (56.0.0 - compatibility 7.0.0) <EAA2B53E-EADE-39CF-A0EF-FB9D4940672A> /usr/lib/libstdc++.6.dylib
    0x7fff89e48000 -     0x7fff89e94ff7  libauto.dylib (??? - ???) <73CDC482-16E3-3FC7-9BB4-FBA2DA44DBC2> /usr/lib/libauto.dylib
    0x7fff89e95000 -     0x7fff89ea0fff  libsystem_notify.dylib (98.5.0 - compatibility 1.0.0) <C49275CC-835A-3207-AFBA-8C01374927B6> /usr/lib/system/libsystem_notify.dylib
    0x7fff8a297000 -     0x7fff8a480fff  com.apple.CoreFoundation (6.8 - 744) <47AEA7C7-EF9B-3FC6-AEBF-CE02FC650301> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff8d13a000 -     0x7fff8d14fff7  libdispatch.dylib (228.18.0 - compatibility 1.0.0) <0B6B6E7F-4D8A-3F3B-A4BF-6CF34638DBBB> /usr/lib/system/libdispatch.dylib
    0x7fff8dcab000 -     0x7fff8dcacfff  libsystem_blocks.dylib (59.0.0 - compatibility 1.0.0) <D92DCBC3-541C-37BD-AADE-ACC75A0C59C8> /usr/lib/system/libsystem_blocks.dylib
    0x7fff8dd69000 -     0x7fff8dd6aff7  libdnsinfo.dylib (453.16.0 - compatibility 1.0.0) <38A3E0F4-E34C-3D45-A2C9-4CDE2DF007BD> /usr/lib/system/libdnsinfo.dylib
    0x7fff8dd72000 -     0x7fff8dd73ff7  libremovefile.dylib (23.1.0 - compatibility 1.0.0) <DBBFAF35-AC78-3856-92F6-6E4FD9DF14A2> /usr/lib/system/libremovefile.dylib
    0x7fff8dda6000 -     0x7fff8dda9ff7  libdyld.dylib (210.2.3 - compatibility 1.0.0) <F59367C9-C110-382B-A695-9035A6DD387E> /usr/lib/system/libdyld.dylib
    0x7fff8e094000 -     0x7fff8e0b6ff7  libxpc.dylib (140.37.0 - compatibility 1.0.0) <C552985C-2171-3136-A1B9-3AB21CBF7C4A> /usr/lib/system/libxpc.dylib
    0x7fff8e24a000 -     0x7fff8e252fff  liblaunch.dylib (442.21.0 - compatibility 1.0.0) <224CB010-6CF8-3FC2-885C-6F80330321EB> /usr/lib/system/liblaunch.dylib
    0x7fff8e6f5000 -     0x7fff8e6fbfff  libmacho.dylib (829.0.0 - compatibility 1.0.0) <BF332AD9-E89F-387E-92A4-6E1AB74BD4D9> /usr/lib/system/libmacho.dylib
    0x7fff8ea64000 -     0x7fff8ea76ff7  libz.1.dylib (1.2.5 - compatibility 1.0.0) <2A1551E8-A272-3DE5-B692-955974FE1416> /usr/lib/libz.1.dylib
    0x7fff8eba6000 -     0x7fff8eba8ff7  libunc.dylib (25.0.0 - compatibility 1.0.0) <92805328-CD36-34FF-9436-571AB0485072> /usr/lib/system/libunc.dylib
    0x7fff9063d000 -     0x7fff90642fff  libcompiler_rt.dylib (30.0.0 - compatibility 1.0.0) <08F8731D-5961-39F1-AD00-4590321D24A9> /usr/lib/system/libcompiler_rt.dylib
    0x7fff90eb7000 -     0x7fff90ebdff7  libunwind.dylib (35.1.0 - compatibility 1.0.0) <21703D36-2DAB-3D8B-8442-EAAB23C060D3> /usr/lib/system/libunwind.dylib
    0x7fff91234000 -     0x7fff91234fff  libkeymgr.dylib (25.0.0 - compatibility 1.0.0) <CC9E3394-BE16-397F-926B-E579B60EE429> /usr/lib/system/libkeymgr.dylib
    0x7fff914c7000 -     0x7fff914c8ff7  libsystem_sandbox.dylib (??? - ???) <3C3B03CF-C525-3CB3-8557-62E91B93AC95> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff9262f000 -     0x7fff92630ff7  libSystem.B.dylib (169.3.0 - compatibility 1.0.0) <132FE02E-3865-3F1F-B78D-C93D65930A67> /usr/lib/libSystem.B.dylib


More information about the macports-dev mailing list