New issue
Advanced search Search tips

Issue 749181 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug

Blocking:
issue 748242



Sign in to add a comment

unit_tests ExceptionProcessorTest.ThrowExceptionInRunLoop fails on 10.13

Project Member Reported by rsesek@chromium.org, Jul 26 2017

Issue description

Chrome Version: 5f9df04869c13d09182e36ad8f1c7192e0389214
OS: macOS 10.13 High Sierra

What steps will reproduce the problem?
(1) Run unit_tests on 10.13
(2) ExceptionProcessorTest.ThrowExceptionInRunLoop fails

ExceptionProcessorTest.ThrowExceptionInRunLoop (run #1):
[ RUN      ] ExceptionProcessorTest.ThrowExceptionInRunLoop
../../chrome/browser/mac/exception_processor_unittest.mm:122: Failure
Death test: ThrowExceptionInRunLoop()
    Result: died but not with expected error.
  Expected: .*FATAL:exception_processor\.mm.*Terminating from Objective-C exception:.*
Actual msg:
[  DEATH   ] [71427:775:0725/223246.987113:23297437385823:WARNING:test_suite.cc(235)] Test launcher output path /b/rr/tmp_w9mAM/t/.org.chromium.Chromium.WupDHb/test_results.xml exists. Not adding test launcher result printer.
[  DEATH   ] 2017-07-25 22:32:47.087 unit_tests[71427:1602312] *** Terminating app due to uncaught exception 'ThrowExceptionInRunLoop', reason: ''
[  DEATH   ] *** First throw call stack:
[  DEATH   ] (
[  DEATH   ] 	0   CoreFoundation                      0x00007fff9684350b __exceptionPreprocess + 171
[  DEATH   ] 	1   unit_tests                          0x0000000108598cba _ZN6chromeL25ObjcExceptionPreprocessorEP11objc_object + 874
[  DEATH   ] 	2   libobjc.A.dylib                     0x00007fffbceaed06 objc_exception_throw + 48
[  DEATH   ] 	3   CoreFoundation                      0x00007fff968d943d +[NSException raise:format:] + 205
[  DEATH   ] 	4   CoreFoundation                      0x00007fff967dbe5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
[  DEATH   ] 	5   CoreFoundation                      0x00007fff967bea0b __CFRunLoopDoBlocks + 203
[  DEATH   ] 	6   CoreFoundation                      0x00007fff967be1de __CFRunLoopRun + 1022
[  DEATH   ] 	7   CoreFoundation                      0x00007fff967bdb69 CFRunLoopRunSpecific + 409
[  DEATH   ] 	8   CoreFoundation                      0x00007fff967fc003 CFRunLoopRun + 99
[  DEATH   ] 	9   unit_tests                          0x0000000104aac1d0 _ZN6chrome51ExceptionProcessorTest_ThrowExceptionInRunLoop_Test8TestBodyEv + 512
[  DEATH   ] 	10  unit_tests                          0x00000001063531c6 _ZN7testing4Test3RunEv + 246
[  DEATH   ] 	11  unit_tests                          0x0000000106353c60 _ZN7testing8TestInfo3RunEv + 288
[  DEATH   ] 	12  unit_tests                          0x00000001063541c7 _ZN7testing8TestCase3RunEv + 263
[  DEATH   ] 	13  unit_tests                          0x000000010635a447 _ZN7testing8internal12UnitTestImpl11RunAllTestsEv + 871
[  DEATH   ] 	14  unit_tests                          0x000000010635a0b3 _ZN7testing8UnitTest3RunEv + 163
[  DEATH   ] 	15  unit_tests                          0x00000001078cad43 _ZN4base9TestSuite3RunEv + 163
[  DEATH   ] 	16  unit_tests                          0x00000001078d791b _ZN4base15LaunchUnitTestsEiPPcRKNS_8CallbackIFivELNS_8internal8CopyModeE1ELNS4_10RepeatModeE1EEE + 139
[  DEATH   ] 	17  unit_tests                          0x00000001078c01d1 main + 273
[  DEATH   ] 	18  libdyld.dylib                       0x00007fffbda8cff9 start + 1
[  DEATH   ] )
[  DEATH   ] libc++abi.dylib: terminating with uncaught exception of type NSException
[  DEATH   ]
[  FAILED  ] ExceptionProcessorTest.ThrowExceptionInRunLoop (278 ms)


What is the expected result?
Test passes

What happens instead?
Test fails

Please use labels and text to provide additional information.

Job: https://luci-milo.appspot.com/buildbot/chromium.fyi/Chromium%20Mac%2010.13/6
Logs: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.fyi%2FChromium_Mac_10.13%2F6%2F%2B%2Frecipes%2Fsteps%2Funit_tests%2F0%2Flogs%2FExceptionProcessorTest.ThrowExceptionInRunLoop%2F0


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Labels: -Pri-2 M-62 Pri-1
rsesek@ - can you investigate to figure out why this is failing? 

Comment 2 by rsesek@chromium.org, Aug 10 2017

Status: Started (was: Assigned)
CFRunLoopRunSpecific() is where CF puts its global exception catch-all exception handler/rethrower, and that function is sinkholed by our exception preprocessor already. It looks like in 10.13, __CFRunLoopRun now has this logic:

  id pool = _CFAutoreleasePoolPush();
  __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__(q);
  @try {
    _CFAutoreleasePoolPop(pool);
  } @catch (id exc) {
    os_log_error("Caught exception during autorelease pool drain %{public}@: %{private}@ userInfo: %{private}@", …);
    objc_terminate();
  }

The exception preprocessor lets the program continue if the function contains any try/catch block, because it can't easily differentiate between okay exception-catching and usage that should be suppressed.

I'll just sinkhole __CFRunLoopRun().
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aae6177874e6a17f9a321a5c0697f9e3727f8d66

commit aae6177874e6a17f9a321a5c0697f9e3727f8d66
Author: Robert Sesek <rsesek@chromium.org>
Date: Thu Aug 10 18:08:55 2017

[Mac] Sinkhole __CFRunLoopRun() in the exception preprocessor.

On 10.13, this function now contains a try/catch block.

Bug:  749181 
Change-Id: I314d2e9468d850d29062ef559f1fbdb92cef073e
Reviewed-on: https://chromium-review.googlesource.com/610660
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493460}
[modify] https://crrev.com/aae6177874e6a17f9a321a5c0697f9e3727f8d66/chrome/browser/mac/exception_processor.mm

Comment 4 by rsesek@chromium.org, Aug 10 2017

Status: Fixed (was: Started)

Sign in to add a comment