SendKeyPressSync() after entering browser fullscreen may randomly trigger crashes on MacOSX |
|||
Issue descriptionThis issue is caught by change https://codereview.chromium.org/2922773002/, KeyEventsShouldBeConsumedByWebPageInBrowserFullscreen has been disabled on MacOSX. Following are several stack traces.
,
Jul 4 2017
In this attempt, interactive_ui_tests crashed after the forth key press (command + n) has been send. The stack trace is broken, though the mysterious [0x0000000000000070] is still in the stack trace.
[ RUN ] BrowserCommandControllerInteractiveTest.DISABLED_KeyEventsShouldBeConsumedByWebPageInBrow
serFullscreen
[95422:4611:0703/163657.790353:WARNING:notification_platform_bridge_mac.mm(514)] AlertNotificationServ
ice: XPC connection invalidated.
2017-07-03 16:36:57.843 interactive_ui_tests[95422:13264644] NSWindow warning: adding an unknown subvi
ew: <FullSizeContentView: 0x7ff1adc7b1a0>. Break on NSLog to debug.
2017-07-03 16:36:57.843 interactive_ui_tests[95422:13264644] Call stack:
(
"+callStackSymbols disabled for performance reasons"
)
[95427:775:0703/163657.910944:WARNING:vt_video_decode_accelerator_mac.cc(178)] Failed to create VTDecompressionSession: Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)" (-12913)
[95427:775:0703/163657.911175:WARNING:vt_video_decode_accelerator_mac.cc(200)] Failed to create hardware VideoToolbox session
[95427:775:0703/163657.932953:ERROR:vt_video_encode_accelerator_mac.cc(495)] VTCompressionSessionCreate failed: -12915
[95422:35603:0703/163658.498164:WARNING:simple_synchronous_entry.cc(1102)] Could not open platform files for entry.
[95422:41507:0703/163658.570084:WARNING:embedded_test_server.cc(219)] Request not handled. Returning 404: /favicon.ico
[95422:775:0703/163658.780903:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 0)
[95422:775:0703/163658.897519:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
[95422:775:0703/163658.929061:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 1)
[95422:775:0703/163658.930542:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(84, 0)
[95422:775:0703/163659.106740:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(78, 0)
Received signal 10 BUS_ADRERR 7ff1af802e46
[0x0001136350fe]
[0x00011363515d]
[0x00011363378c]
[0x000113634fe7]
[0x7fffa7cbfb3a]
[0x000000000070]
[0x000109b085b0]
[0x0001099f50e8]
[0x0001099f7a31]
[0x00011182989b]
[0x00011182be8d]
[0x00011182bdd4]
[0x00011182bd63]
,
Jul 4 2017
In this attempt, the binary did not crash, but SendKeyPressSync() function always returns false. Note: Since no other log printed, SendKeyPressSync() may fail in GetNativeWindow().
[ RUN ] BrowserCommandControllerInteractiveTest.DISABLED_KeyEventsShouldBeConsumedByWebPageInBrowserFullscreen
[95315:8195:0703/163351.477417:WARNING:notification_platform_bridge_mac.mm(514)] AlertNotificationService: XPC connection invalidated.
2017-07-03 16:33:51.528 interactive_ui_tests[95315:13233095] NSWindow warning: adding an unknown subview: <FullSizeContentView: 0x7ffa7e751320>. Break on NSLog to debug.
2017-07-03 16:33:51.528 interactive_ui_tests[95315:13233095] Call stack:
(
"+callStackSymbols disabled for performance reasons"
)
[95320:775:0703/163351.611083:WARNING:vt_video_decode_accelerator_mac.cc(178)] Failed to create VTDecompressionSession: Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)" (-12913)
[95320:775:0703/163351.611331:WARNING:vt_video_decode_accelerator_mac.cc(200)] Failed to create hardware VideoToolbox session
[95320:775:0703/163351.628651:ERROR:vt_video_encode_accelerator_mac.cc(495)] VTCompressionSessionCreate failed: -12915
[95315:35603:0703/163352.200872:WARNING:simple_synchronous_entry.cc(1102)] Could not open platform files for entry.
[95315:41507:0703/163352.280684:WARNING:embedded_test_server.cc(219)] Request not handled. Returning 404: /favicon.ico
[95315:775:0703/163352.494261:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 0)
[95315:775:0703/163352.648990:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 1)
../../chrome/browser/ui/browser_command_controller_interactive_browsertest.cc:117: Failure
Value of: ui_test_utils::SendKeyPressSync(browser(), key, control_modifier, shift, false, command_modifier)
Actual: false
Expected: true
,
Jul 4 2017
In this attempt, the binary crashed with CHECK failure in TabStripModel::IsTabSelected(int) after sending command + tab to switch the tab.
[ RUN ] BrowserCommandControllerInteractiveTest.DISABLED_KeyEventsShouldBeConsumedByWebPageInBrowserFullscreen
[95241:3843:0703/163105.417796:WARNING:notification_platform_bridge_mac.mm(514)] AlertNotificationService: XPC connection invalidated.
2017-07-03 16:31:05.469 interactive_ui_tests[95241:13197618] NSWindow warning: adding an unknown subview: <FullSizeContentView: 0x7fc2bb596a50>. Break on NSLog to debug.
2017-07-03 16:31:05.469 interactive_ui_tests[95241:13197618] Call stack:
(
"+callStackSymbols disabled for performance reasons"
)
[95246:775:0703/163105.537502:WARNING:vt_video_decode_accelerator_mac.cc(178)] Failed to create VTDecompressionSession: Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)" (-12913)
[95246:775:0703/163105.537736:WARNING:vt_video_decode_accelerator_mac.cc(200)] Failed to create hardware VideoToolbox session
[95246:775:0703/163105.554634:ERROR:vt_video_encode_accelerator_mac.cc(495)] VTCompressionSessionCreate failed: -12915
[95241:35603:0703/163106.137128:WARNING:simple_synchronous_entry.cc(1102)] Could not open platform files for entry.
[95241:81179:0703/163106.211832:WARNING:embedded_test_server.cc(219)] Request not handled. Returning 404: /favicon.ico
[95241:775:0703/163106.216256:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 0)
[95241:775:0703/163106.350053:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 1)
[95241:775:0703/163106.360579:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(84, 0)
[95241:775:0703/163106.470541:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(78, 0)
[95241:775:0703/163106.573425:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(78, 1)
[95241:775:0703/163106.676062:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(84, 1)
[95241:775:0703/163106.778640:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(9, 0)
[95241:775:0703/163106.832211:FATAL:tab_strip_model.cc(732)] Check failed: ContainsIndex(index).
0 interactive_ui_tests 0x0000000119c580fe base::debug::StackTrace::StackTrace(unsigned long) + 174
1 interactive_ui_tests 0x0000000119c5815d base::debug::StackTrace::StackTrace(unsigned long) + 29
2 interactive_ui_tests 0x0000000119c5678c base::debug::StackTrace::StackTrace() + 28
3 interactive_ui_tests 0x0000000119ccf4bf logging::LogMessage::~LogMessage() + 479
4 interactive_ui_tests 0x0000000119ccce95 logging::LogMessage::~LogMessage() + 21
5 interactive_ui_tests 0x00000001214715f3 TabStripModel::IsTabSelected(int) const + 211
6 interactive_ui_tests 0x0000000121477bcd TabStripModel::GetIndicesForCommand(int) const + 77
7 interactive_ui_tests 0x00000001214797f7 TabStripModel::WillContextMenuMute(int) + 55
8 interactive_ui_tests 0x0000000121826d38 (anonymous namespace)::UpdateToggleStateWithTag(long, objc_object*, NSWindow*) + 904
9 interactive_ui_tests 0x00000001218268c5 -[BrowserWindowCommandHandler validateUserInterfaceItem:window:] + 1461
10 interactive_ui_tests 0x000000011a5140ef -[CommandDispatcher validateUserInterfaceItem:forHandler:] + 175
11 interactive_ui_tests 0x0000000121934306 -[ChromeEventProcessingWindow validateUserInterfaceItem:] + 102
12 AppKit 0x00007fff8fa0a546 -[NSMenu _enableItem:] + 684
13 AppKit 0x00007fff8fa0a23b -[NSMenu _enableItems] + 240
14 AppKit 0x00007fff8facb1fe -[NSMenu performKeyEquivalent:] + 392
15 AppKit 0x00007fff8facb342 -[NSMenu performKeyEquivalent:] + 716
16 AppKit 0x00007fff8fff831c routeKeyEquivalent + 1024
17 AppKit 0x00007fff8fff5f39 -[NSApplication(NSEvent) sendEvent:] + 3377
18 interactive_ui_tests 0x00000001164471a3 __34-[BrowserCrApplication sendEvent:]_block_invoke + 259
19 interactive_ui_tests 0x0000000119cd758a base::mac::CallWithEHFrame(void () block_pointer) + 10
20 interactive_ui_tests 0x0000000116446f2f -[BrowserCrApplication sendEvent:] + 575
21 interactive_ui_tests 0x00000001199b5345 ui_controls::SendKeyPressNotifyWhenDone(NSWindow*, ui::KeyboardCode, bool, bool, bool, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) + 1253
22 interactive_ui_tests 0x000000011012b7a8 ui_test_utils::SendKeyPressToWindowSync(NSWindow*, ui::KeyboardCode, bool, bool, bool, bool) + 344
23 interactive_ui_tests 0x000000011012b609 ui_test_utils::SendKeyPressSync(Browser const*, ui::KeyboardCode, bool, bool, bool, bool) + 185
24 interactive_ui_tests 0x00000001100180e8 BrowserCommandControllerInteractiveTest::SendShortcut(ui::KeyboardCode, bool) + 376
25 interactive_ui_tests 0x000000011001aa66 BrowserCommandControllerInteractiveTest_DISABLED_KeyEventsShouldBeConsumedByWebPageInBrowserFullscreen_Test::RunTestOnMainThread() + 422
,
Jul 4 2017
I think the problem is that ui_test_utils::SendKeyPressSync is not robust around Cocoa "immersive fullscreen" windows. When you call `SendKeyPressSync(browser(), ...)` the event is sent to the NSWindow associated with that browser(). The problem is that -- when entering immersive fullscreen -- there is a different window to the one from before entering fullscreen.
,
Jul 4 2017
Yes, I have the same feeling. But I cannot tell why HTML fullscreen won't be impacted. Are they using different implementations?
,
Jul 4 2017
It's complicated :/. Apple keep changing the way fullscreen works on OSX. From https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/browser_window_controller.mm?q=enterWebContentFullscreen&sq=package:chromium&l=1995 - (void)enterWebContentFullscreen { // HTML5 Fullscreen should only use AppKit fullscreen in 10.10+. // However, if the user is using multiple monitors and turned off // "Separate Space in Each Display", use Immersive Fullscreen so // that the other monitors won't blank out. display::Screen* screen = display::Screen::GetScreen(); BOOL hasMultipleMonitors = screen && screen->GetNumDisplays() > 1; if (base::mac::IsAtLeastOS10_10() && !(hasMultipleMonitors && ![NSScreen screensHaveSeparateSpaces])) { [self enterAppKitFullscreen]; } else { [self enterImmersiveFullscreen]; } if (!exclusiveAccessController_->url().is_empty()) [self updateFullscreenExitBubble]; } "enterAppKitFullscreen" uses the same window "enterImmersiveFullscreen" creates a new window. Note trybots usually pick a 10.9 machine, but can also pick a 10.10 machine. But both need to work when the CL hits the waterfall where all versions are tested. For Mac, I would avoid the tests using container().webkitRequestFullscreen() on 10.9. You can use methods in mac_util.h to test for this. Restricting to 10.10+ should make your tests more predictable.
,
Jul 4 2017
Oh, it looks like the test works well in "immersive fullscreen" mode, but not in "appkit fullscreen" mode. Since "appkit fullscreen" is always used in browser fullscreen. (https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/browser_window_controller.mm?rcl=97445b4f994675054cf5ae3363f18d8a6a52fa54&l=1950)
,
Jan 24 2018
,
Jan 24 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by zijiehe@chromium.org
, Jul 3 2017In this attempt, interactive_ui_tests crashed after the second key press (shift + command + w) has been sent. [ RUN ] BrowserCommandControllerInteractiveTest.DISABLED_KeyEventsShouldBeConsumedByWebPageInBrowserFullscreen [95056:3843:0703/162117.073820:WARNING:notification_platform_bridge_mac.mm(514)] AlertNotificationService: XPC connection invalidated. 2017-07-03 16:21:17.123 interactive_ui_tests[95056:13163366] NSWindow warning: adding an unknown subview: <FullSizeContentView: 0x7fe6717a3460>. Break on NSLog to debug. 2017-07-03 16:21:17.123 interactive_ui_tests[95056:13163366] Call stack: ( "+callStackSymbols disabled for performance reasons" ) [95061:775:0703/162118.134689:WARNING:vt_video_decode_accelerator_mac.cc(178)] Failed to create VTDecompressionSession: Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)" (-12913) [95061:775:0703/162118.136092:WARNING:vt_video_decode_accelerator_mac.cc(200)] Failed to create hardware VideoToolbox session [95061:775:0703/162118.167811:ERROR:vt_video_encode_accelerator_mac.cc(495)] VTCompressionSessionCreate failed: -12915 [95056:35603:0703/162118.917446:WARNING:simple_synchronous_entry.cc(1102)] Could not open platform files for entry. [95056:71955:0703/162119.003455:WARNING:embedded_test_server.cc(219)] Request not handled. Returning 404: /favicon.ico [95056:775:0703/162119.012585:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 0) [95056:775:0703/162119.158322:ERROR:browser_command_controller_interactive_browsertest.cc(108)] SendShortcut(87, 1) BrowserTestBase received signal: Segmentation fault: 11. Backtrace: 0 interactive_ui_tests 0x00000001177c50fe base::debug::StackTrace::StackTrace(unsigned long) + 174 1 interactive_ui_tests 0x00000001177c515d base::debug::StackTrace::StackTrace(unsigned long) + 29 2 interactive_ui_tests 0x00000001177c378c base::debug::StackTrace::StackTrace() + 28 3 interactive_ui_tests 0x00000001159b9d69 content::(anonymous namespace)::DumpStackTraceSignalHandler(int) + 537 4 libsystem_platform.dylib 0x00007fffa7cbfb3a _sigtramp + 26 5 ??? 0x0000000000000070 0x0 + 112 6 interactive_ui_tests 0x000000010dc985b0 ui_test_utils::SendKeyPressSync(Browser const*, ui::KeyboardCode, bool, bool, bool, bool) + 96 7 interactive_ui_tests 0x000000010db850e8 BrowserCommandControllerInteractiveTest::SendShortcut(ui::KeyboardCode, bool) + 376 8 interactive_ui_tests 0x000000010db857f0 BrowserCommandControllerInteractiveTest::SendShiftShortcut(ui::KeyboardCode) + 32 9 interactive_ui_tests 0x000000010db87a0b BrowserCommandControllerInteractiveTest_DISABLED_KeyEventsShouldBeConsumedByWebPageInBrowserFullscreen_Test::RunTestOnMainThread() + 331