New issue
Advanced search Search tips

Issue 750242 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 669240



Sign in to add a comment

Crash in SSLClientCertificateSelectorCocoaTest.WorkaroundCrashySierra when building with 10.12 SDK.

Project Member Reported by erikc...@chromium.org, Jul 28 2017

Issue description

https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.mac%2Fmac_chromium_rel_ng%2F511501%2F%2B%2Frecipes%2Fsteps%2Fbrowser_tests__with_patch_%2F0%2Flogs%2FSSLClientCertificateSelectorCocoaTest.WorkaroundCrashySierra%2F0

[ RUN      ] SSLClientCertificateSelectorCocoaTest.WorkaroundCrashySierra
[47124:43791:0727/151314.494992:WARNING:mac_util.mm(222)] Failed to set backup exclusion for file '/private/var/folders/9x/6c6sv3cj4j53wzpzthbp4ksm0000gm/T/.org.chromium.Chromium.epM0FX/dgzalk5/Default/History': Error Domain=NSOSStatusErrorDomain Code=-50 "The operation couldn?t be completed. (OSStatus error -50.)" (paramErr: error in user parameter list) (-50)
[47124:5123:0727/151314.510901:WARNING:notification_platform_bridge_mac.mm(514)] AlertNotificationService: XPC connection invalidated.
[47135:771:0727/151314.597746:WARNING:vt_video_decode_accelerator_mac.cc(178)] Failed to create VTDecompressionSession: Error Domain=NSOSStatusErrorDomain Code=-8973 "The operation couldn?t be completed. (OSStatus error -8973.)" (codecOpenErr) (-8973)
[47135:771:0727/151314.599031:WARNING:vt_video_decode_accelerator_mac.cc(200)] Failed to create hardware VideoToolbox session
[47135:771:0727/151314.662759:ERROR:vt_video_encode_accelerator_mac.cc(495)]  VTCompressionSessionCreate failed: -12908
[47124:43791:0727/151314.709597:WARNING:mac_util.mm(222)] Failed to set backup exclusion for file '/private/var/folders/9x/6c6sv3cj4j53wzpzthbp4ksm0000gm/T/.org.chromium.Chromium.epM0FX/dgzalk5/Default/Favicons': Error Domain=NSOSStatusErrorDomain Code=-50 "The operation couldn?t be completed. (OSStatus error -50.)" (paramErr: error in user parameter list) (-50)
Backtrace from -dealloc:
0   browser_tests                       0x000000010baa6612 (anonymous namespace)::ZombieDealloc(objc_object*, objc_selector*) + 290
1   AppKit                              0x00007fff93696240 -[NSResponder dealloc] + 126
2   AppKit                              0x00007fff938b52b0 -[NSWindow dealloc] + 2146
3   SecurityInterface                   0x00007fff8fb6e794 -[SFChooseIdentityPanel dealloc] + 137
4   AppKit                              0x00007fff936665ea -[NSWindow release] + 193
5   CoreFoundation                      0x00007fff8f59143f CFRelease + 591
6   CoreFoundation                      0x00007fff8f5a4699 -[__NSArrayM dealloc] + 185
7   libobjc.A.dylib                     0x00007fff8c70065a (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 502
8   browser_tests                       0x0000000107ab93b9 SSLClientCertificateSelectorCocoaTest_WorkaroundCrashySierra_Test::RunTestOnMainThread() + 393
9   browser_tests                       0x000000010a7d4943 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() + 403
10  browser_tests                       0x000000010a128a7f ChromeBrowserMainParts::PreMainMessageLoopRunImpl() + 4335
11  browser_tests                       0x000000010a12788e ChromeBrowserMainParts::PreMainMessageLoopRun() + 62
12  browser_tests                       0x0000000108626163 content::BrowserMainLoop::PreMainMessageLoopRun() + 67
13  browser_tests                       0x0000000108aec207 content::StartupTaskRunner::RunAllTasksNow() + 39
14  browser_tests                       0x00000001086246af content::BrowserMainLoop::CreateStartupTasks() + 687
15  browser_tests                       0x000000010862911a content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) + 842
16  browser_tests                       0x0000000108621f14 content::BrowserMain(content::MainFunctionParams const&) + 100
17  browser_tests                       0x0000000109e882f0 content::ContentMainRunnerImpl::Run() + 528
18  browser_tests                       0x000000010c67ebee service_manager::Main(service_manager::MainParams const&) + 2574
19  browser_tests                       0x0000000109e876e4 content::ContentMain(content::ContentMainParams const&) + 68
[47124:771:0727/151316.053513:FATAL:objc_zombie.mm(231)] Zombie <SFChooseIdentityPanel: 0x7fd893fb4740> received -numberOfRowsInTableView:
0   browser_tests                       0x0000000109f5cdfc base::debug::StackTrace::StackTrace(unsigned long) + 28
1   browser_tests                       0x0000000109f80b90 logging::LogMessage::~LogMessage() + 224
2   browser_tests                       0x000000010baa5e7e (anonymous namespace)::ZombieObjectCrash(objc_object*, objc_selector*, objc_selector*) + 622
3   browser_tests                       0x000000010baa5c01 -[CrZombie forwardingTargetForSelector:] + 17
4   CoreFoundation                      0x00007fff8f623f1a ___forwarding___ + 154
5   CoreFoundation                      0x00007fff8f623df8 _CF_forwarding_prep_0 + 120
6   AppKit                              0x00007fff936a8a4c -[NSTableView _uncachedNumberOfRows] + 120
7   AppKit                              0x00007fff936a8953 -[_NSTableRowHeightStorage numberOfRows] + 58
8   AppKit                              0x00007fff936a88c0 -[NSTableView _totalHeightOfTableView] + 207
9   AppKit                              0x00007fff936a8689 -[NSTableView _minimumFrameSize] + 77
10  AppKit                              0x00007fff936a8619 -[NSClipView _minimumFrameSize] + 36
11  AppKit                              0x00007fff936a7d42 -[NSScrollView tile] + 1487
12  AppKit                              0x00007fff93f5df3e +[NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:] + 401
13  CoreFoundation                      0x00007fff8f694e0c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
14  CoreFoundation                      0x00007fff8f58882d _CFXNotificationPost + 2893
15  Foundation                          0x00007fff8a347dda -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
16  browser_tests                       0x0000000107ab95a6 SSLClientCertificateSelectorCocoaTest_WorkaroundCrashySierra_Test::RunTestOnMainThread() + 886
17  browser_tests                       0x000000010a7d4943 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() + 403
18  browser_tests                       0x000000010a128a7f ChromeBrowserMainParts::PreMainMessageLoopRunImpl() + 4335
19  browser_tests                       0x000000010a12788e ChromeBrowserMainParts::PreMainMessageLoopRun() + 62
20  browser_tests                       0x0000000108626163 content::BrowserMainLoop::PreMainMessageLoopRun() + 67
21  browser_tests                       0x0000000108aec207 content::StartupTaskRunner::RunAllTasksNow() + 39
22  browser_tests                       0x00000001086246af content::BrowserMainLoop::CreateStartupTasks() + 687
23  browser_tests                       0x000000010862911a content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) + 842
24  browser_tests                       0x0000000108621f14 content::BrowserMain(content::MainFunctionParams const&) + 100
25  browser_tests                       0x0000000109e882f0 content::ContentMainRunnerImpl::Run() + 528
26  browser_tests                       0x000000010c67ebee service_manager::Main(service_manager::MainParams const&) + 2574
27  browser_tests                       0x0000000109e876e4 content::ContentMain(content::ContentMainParams const&) + 68
28  browser_tests                       0x000000010a7d45d1 content::BrowserTestBase::SetUp() + 2289
29  browser_tests                       0x000000010a088b53 InProcessBrowserTest::SetUp() + 499
30  browser_tests                       0x0000000107c28511 testing::Test::Run() + 97
31  browser_tests                       0x0000000107c290c0 testing::TestInfo::Run() + 288
32  browser_tests                       0x0000000107c296e7 testing::TestCase::Run() + 263
33  browser_tests                       0x0000000107c30c07 testing::internal::UnitTestImpl::RunAllTests() + 871
34  browser_tests                       0x0000000107c30873 testing::UnitTest::Run() + 163
35  browser_tests                       0x000000010a0ab293 base::TestSuite::Run() + 163
36  browser_tests                       0x0000000109f3ffe5 ChromeTestSuiteRunner::RunTestSuite(int, char**) + 37
37  browser_tests                       0x000000010a81cae8 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) + 408
38  browser_tests                       0x0000000109f3ff4c main + 108
39  libdyld.dylib                       0x00007fff8ee045fd start + 1
[ RUN      ] SSLClientCertificateSelectorCocoaTest.WorkaroundCrashySierra
[48799:44547:0727/151524.329030:WARNING:mac_util.mm(222)] Failed to set backup exclusion for file '/private/var/folders/9x/6c6sv3cj4j53wzpzthbp4ksm0000gm/T/.org.chromium.Chromium.epM0FX/dypWdwG/Default/History': Error Domain=NSOSStatusErrorDomain Code=-50 "The operation couldn?t be completed. (OSStatus error -50.)" (paramErr: error in user parameter list) (-50)
[48799:5123:0727/151524.336425:WARNING:notification_platform_bridge_mac.mm(514)] AlertNotificationService: XPC connection invalidated.
[48804:771:0727/151524.454528:WARNING:vt_video_decode_accelerator_mac.cc(178)] Failed to create VTDecompressionSession: Error Domain=NSOSStatusErrorDomain Code=-8973 "The operation couldn?t be completed. (OSStatus error -8973.)" (codecOpenErr) (-8973)
[48804:771:0727/151524.455952:WARNING:vt_video_decode_accelerator_mac.cc(200)] Failed to create hardware VideoToolbox session
[48804:771:0727/151524.516565:ERROR:vt_video_encode_accelerator_mac.cc(495)]  VTCompressionSessionCreate failed: -12908
[48799:44547:0727/151524.551446:WARNING:mac_util.mm(222)] Failed to set backup exclusion for file '/private/var/folders/9x/6c6sv3cj4j53wzpzthbp4ksm0000gm/T/.org.chromium.Chromium.epM0FX/dypWdwG/Default/Favicons': Error Domain=NSOSStatusErrorDomain Code=-50 "The operation couldn?t be completed. (OSStatus error -50.)" (paramErr: error in user parameter list) (-50)
Backtrace from -dealloc:
0   browser_tests                       0x0000000111566612 (anonymous namespace)::ZombieDealloc(objc_object*, objc_selector*) + 290
1   AppKit                              0x00007fff93696240 -[NSResponder dealloc] + 126
2   AppKit                              0x00007fff938b52b0 -[NSWindow dealloc] + 2146
3   SecurityInterface                   0x00007fff8fb6e794 -[SFChooseIdentityPanel dealloc] + 137
4   AppKit                              0x00007fff936665ea -[NSWindow release] + 193
5   CoreFoundation                      0x00007fff8f59143f CFRelease + 591
6   CoreFoundation                      0x00007fff8f5a4699 -[__NSArrayM dealloc] + 185
7   libobjc.A.dylib                     0x00007fff8c70065a (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 502
8   browser_tests                       0x000000010d5793b9 SSLClientCertificateSelectorCocoaTest_WorkaroundCrashySierra_Test::RunTestOnMainThread() + 393
9   browser_tests                       0x0000000110294943 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() + 403
10  browser_tests                       0x000000010fbe8a7f ChromeBrowserMainParts::PreMainMessageLoopRunImpl() + 4335
11  browser_tests                       0x000000010fbe788e ChromeBrowserMainParts::PreMainMessageLoopRun() + 62
12  browser_tests                       0x000000010e0e6163 content::BrowserMainLoop::PreMainMessageLoopRun() + 67
13  browser_tests                       0x000000010e5ac207 content::StartupTaskRunner::RunAllTasksNow() + 39
14  browser_tests                       0x000000010e0e46af content::BrowserMainLoop::CreateStartupTasks() + 687
15  browser_tests                       0x000000010e0e911a content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) + 842
16  browser_tests                       0x000000010e0e1f14 content::BrowserMain(content::MainFunctionParams const&) + 100
17  browser_tests                       0x000000010f9482f0 content::ContentMainRunnerImpl::Run() + 528
18  browser_tests                       0x000000011213ebee service_manager::Main(service_manager::MainParams const&) + 2574
19  browser_tests                       0x000000010f9476e4 content::ContentMain(content::ContentMainParams const&) + 68
[48799:771:0727/151525.714414:FATAL:objc_zombie.mm(231)] Zombie <SFChooseIdentityPanel: 0x7f967788e230> received -numberOfRowsInTableView:
0   browser_tests                       0x000000010fa1cdfc base::debug::StackTrace::StackTrace(unsigned long) + 28
1   browser_tests                       0x000000010fa40b90 logging::LogMessage::~LogMessage() + 224
2   browser_tests                       0x0000000111565e7e (anonymous namespace)::ZombieObjectCrash(objc_object*, objc_selector*, objc_selector*) + 622
3   browser_tests                       0x0000000111565c01 -[CrZombie forwardingTargetForSelector:] + 17
4   CoreFoundation                      0x00007fff8f623f1a ___forwarding___ + 154
5   CoreFoundation                      0x00007fff8f623df8 _CF_forwarding_prep_0 + 120
6   AppKit                              0x00007fff936a8a4c -[NSTableView _uncachedNumberOfRows] + 120
7   AppKit                              0x00007fff936a8953 -[_NSTableRowHeightStorage numberOfRows] + 58
8   AppKit                              0x00007fff936a88c0 -[NSTableView _totalHeightOfTableView] + 207
9   AppKit                              0x00007fff936a8689 -[NSTableView _minimumFrameSize] + 77
10  AppKit                              0x00007fff936a8619 -[NSClipView _minimumFrameSize] + 36
11  AppKit                              0x00007fff936a7d42 -[NSScrollView tile] + 1487
12  AppKit                              0x00007fff93f5df3e +[NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:] + 401
13  CoreFoundation                      0x00007fff8f694e0c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
14  CoreFoundation                      0x00007fff8f58882d _CFXNotificationPost + 2893
15  Foundation                          0x00007fff8a347dda -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
16  browser_tests                       0x000000010d5795a6 SSLClientCertificateSelectorCocoaTest_WorkaroundCrashySierra_Test::RunTestOnMainThread() + 886
17  browser_tests                       0x0000000110294943 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() + 403
18  browser_tests                       0x000000010fbe8a7f ChromeBrowserMainParts::PreMainMessageLoopRunImpl() + 4335
19  browser_tests                       0x000000010fbe788e ChromeBrowserMainParts::PreMainMessageLoopRun() + 62
20  browser_tests                       0x000000010e0e6163 content::BrowserMainLoop::PreMainMessageLoopRun() + 67
21  browser_tests                       0x000000010e5ac207 content::StartupTaskRunner::RunAllTasksNow() + 39
22  browser_tests                       0x000000010e0e46af content::BrowserMainLoop::CreateStartupTasks() + 687
23  browser_tests                       0x000000010e0e911a content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) + 842
24  browser_tests                       0x000000010e0e1f14 content::BrowserMain(content::MainFunctionParams const&) + 100
25  browser_tests                       0x000000010f9482f0 content::ContentMainRunnerImpl::Run() + 528
26  browser_tests                       0x000000011213ebee service_manager::Main(service_manager::MainParams const&) + 2574
27  browser_tests                       0x000000010f9476e4 content::ContentMain(content::ContentMainParams const&) + 68
28  browser_tests                       0x00000001102945d1 content::BrowserTestBase::SetUp() + 2289
29  browser_tests                       0x000000010fb48b53 InProcessBrowserTest::SetUp() + 499
30  browser_tests                       0x000000010d6e8511 testing::Test::Run() + 97
31  browser_tests                       0x000000010d6e90c0 testing::TestInfo::Run() + 288
32  browser_tests                       0x000000010d6e96e7 testing::TestCase::Run() + 263
33  browser_tests                       0x000000010d6f0c07 testing::internal::UnitTestImpl::RunAllTests() + 871
34  browser_tests                       0x000000010d6f0873 testing::UnitTest::Run() + 163
35  browser_tests                       0x000000010fb6b293 base::TestSuite::Run() + 163
36  browser_tests                       0x000000010f9fffe5 ChromeTestSuiteRunner::RunTestSuite(int, char**) + 37
37  browser_tests                       0x00000001102dcae8 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) + 408
38  browser_tests                       0x000000010f9fff4c main + 108
39  libdyld.dylib                       0x00007fff8ee045fd start + 1

I'll try to get around to this early next week. +sdy in case he has an instant solution.
 

Comment 1 by thakis@chromium.org, Jul 28 2017

https://bugs.chromium.org/p/chromium/issues/detail?id=653093#c26 sounds like the workaround is only needed with the 10.10 sdk, so maybe we can revert the fix for that bug when switching to the 10.12 sdk?
The workaround is only applied when building with 10.10 or older. 

I'm unable to repro on my 10.12.5 machine. I suspect this is a bug that has been fixed in the 10.12.5 frameworks. The buildbot is still on 10.12.2. Regardless of whether the SDK says a reference is "zeroing weak", what we actually care about is the runtime framework. 

In the 10.12 SDK, we see:
"""
/* Get and set the dataSource. The dataSource can implement methods in the protocol NSTableViewDataSource. Some methods are required, unless bindings are used, in which case they are optional. The dataSource is a weak refere    nce (non retained) in non garbage collected applications. Under garbage collected apps, it is a strong reference. The default value is 'nil'.
198  */                                                                                                                                                                                                                             
199 @property (nullable, weak) id <NSTableViewDataSource> dataSource;             
"""

Notice that this refers to garbage collected apps, *not* ARC-enabled.

I don't think we can avoid this workaround, even when linking against the 10.12 SDK, because we still need to support older, broken frameworks.
Thinking about this a bit more, there's no way that "weak" references can zero-themselves correctly when being built against non-ARC code.

e.g. Imagine


car.h
@interface Car
@property(weak) Driver driver;
@end

car.mm
@implementation Car
@end

driver.h
@interface Driver
@end

driver.mm
@implementation Driver
@end

simulation.mm
- (void)test {
  Car c = [[Car alloc] init]; 
  Driver d = [[Driver alloc] init];
  c.driver = d;

  // At this point, there's no way for c.driver to be zeroed.
  [d release]; 
}

Assume that car.mm is compiled with ARC [like the 10.12 SKD], but driver.mm and simulation.mm are compiled w/o ARC [like Chrome]. I'm pretty sure there's no way for zeroing to actually "work" unless both simulation.mm, driver.mm and car.mm are all compiled with ARC.

Comment 4 by sdy@chromium.org, Jul 29 2017

Re. #3, an associated object would do the trick :-).

Comment 5 by sdy@chromium.org, Jul 29 2017

I take that back, it uses +[NSValue valueWithWeakObject:], which in turn uses objc_storeWeakOrNil, which is part of the ObjC runtime and works regardless of ARC.

Comment 6 by sdy@chromium.org, Jul 29 2017

Labels: OS-Mac
Hmm. I haven't been able to track anything down so far, but I don't have a copy of the 10.12.2 runtime. I thought that maybe zombification would defeat weak referencing, but now I don't (it calls objc_destructInstance, which clears weak references AFAICT).

Being fixed in newer macOS looks totally plausible. If updating the bots is impractical, the quickest fix should be to turn the workaround on for all SDKs (#if 1 || …):

https://chromium.googlesource.com/chromium/src/+/892a81ed3ba0c0ec6a2a5c79f1b91a3759be8c54/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm#120
Status: WontFix (was: Available)
This appears to no longer be a problem. 

Sign in to add a comment