What steps will reproduce the problem?
1. Build target content_browsertests on Mac using the Chromium source code.
2. Run ContentBrowserTestSanityTest.SingleProcess test on Mac with dual-GPU:
$ system_profiler | grep 'Graphics/Displays' -A 40 | grep 'Chipset Model'
Chipset Model: Intel Iris Pro
Chipset Model: NVIDIA GeForce GT 750M
$ ./out/Debug/content_browsertests --gtest_filter="ContentBrowserTestSanityTest.SingleProcess"
What is the expected result?
The test should pass.
What happens instead of that?
The test fails with the following output:
[57073:41219:0422/201357:1402186039873339:FATAL:render_widget_host_impl.cc(265)] Check failed: ::content::BrowserThread::CurrentlyOn(BrowserThread::UI). Must be called on Chrome_UIThread; actually called on Chrome_InProcGpuThread.
0 libbase.dylib 0x0000000106502e8f _ZN4base5debug10StackTraceC2Ev + 47
1 libbase.dylib 0x0000000106503033 _ZN4base5debug10StackTraceC1Ev + 35
2 libbase.dylib 0x0000000106590100 _ZN7logging10LogMessageD2Ev + 80
3 libbase.dylib 0x000000010658da33 _ZN7logging10LogMessageD1Ev + 35
4 libcontent.dylib 0x000000010b46ae72 _ZN7content20RenderWidgetHostImpl6FromIDEii + 306
5 libcontent.dylib 0x000000010b46ad17 _ZN7content16RenderWidgetHost6FromIDEii + 39
6 libcontent.dylib 0x000000010b48312e _ZN7content12_GLOBAL__N_128RenderWidgetHostIteratorImpl11GetNextHostEv + 302
7 libcontent.dylib 0x000000010b42190e _ZN7content21RenderProcessHostImpl35RecomputeAndUpdateWebKitPreferencesEv + 110
8 libcontent.dylib 0x000000010b421873 _ZN7content21RenderProcessHostImpl13OnGpuSwitchedEv + 35
9 libcontent.dylib 0x000000010b421abc _ZThn136_N7content21RenderProcessHostImpl13OnGpuSwitchedEv + 44
10 libgl_wrapper.dylib 0x000000011344d1d6 _ZN2ui19GpuSwitchingManager17NotifyGpuSwitchedEv + 118
11 libcontent.dylib 0x000000010bf8c896 _ZN7content14GpuChildThread13OnGpuSwitchedEv + 230
12 libcontent.dylib 0x000000010bf9705b _ZN4base20DispatchToMethodImplIPN7content14GpuChildThreadEMS2_FvvEJEJEEEvRKT_T0_RKNSt3__15tupleIJDpT1_EEENS_13IndexSequenceIJXspT2_EEEE + 139
13 libcontent.dylib 0x000000010bf96fa3 _ZN4base16DispatchToMethodIPN7content14GpuChildThreadEMS2_FvvEJEEEvRKT_T0_RKNSt3__15tupleIJDpT1_EEE + 83
14 libcontent.dylib 0x000000010bf96f2d _ZN3IPC16DispatchToMethodIN7content14GpuChildThreadEMS2_FvvEvNSt3__15tupleIJEEEEEvPT_T0_PT1_RKT2_ + 93
15 libcontent.dylib 0x000000010bf8c74d _ZN3IPC8MessageTI23GpuMsg_GpuSwitched_MetaNSt3__15tupleIJEEEvE8DispatchIN7content14GpuChildThreadES8_vMS8_FvvEEEbPKNS_7MessageEPT_PT0_PT1_T2_ + 429
16 libcontent.dylib 0x000000010bf89ff9 _ZN7content14GpuChildThread24OnControlMessageReceivedERKN3IPC7MessageE + 1881
17 libcontent.dylib 0x000000010b9a9fa7 _ZN7content15ChildThreadImpl17OnMessageReceivedERKN3IPC7MessageE + 1719
18 libcontent.dylib 0x000000010bf8c915 _ZN7content14GpuChildThread17OnMessageReceivedERKN3IPC7MessageE + 85
19 libipc.dylib 0x00000001147c89e6 _ZN3IPC12ChannelProxy7Context17OnDispatchMessageERKNS_7MessageE + 166
20 libipc.dylib 0x00000001147cf2fc _ZN4base8internal15RunnableAdapterIMN3IPC12ChannelProxy7ContextEFvRKNS2_7MessageEEE3RunIS4_JS7_EEEvRK13scoped_refptrIT_EDpOT0_ + 156
21 libipc.dylib 0x00000001147cf1ba _ZN4base8internal12InvokeHelperILb0EvNS0_15RunnableAdapterIMN3IPC12ChannelProxy7ContextEFvRKNS3_7MessageEEEEE8MakeItSoIJRK13scoped_refptrIS5_ES8_EEEvSB_DpOT_ + 74
22 libipc.dylib 0x00000001147cf14c _ZN4base8internal7InvokerINS_13IndexSequenceIJLm0ELm1EEEENS0_9BindStateINS0_15RunnableAdapterIMN3IPC12ChannelProxy7ContextEFvRKNS6_7MessageEEEEFvPS8_SB_EJSF_SB_EEENS0_12InvokeHelperILb0EvSE_EEFvvEE3RunEPNS0_13BindStateBaseE + 140
23 libbase.dylib 0x00000001064d952f _ZNK4base8CallbackIFvvELNS_8internal8CopyModeE1EE3RunEv + 63
24 libbase.dylib 0x000000010650498e _ZN4base5debug13TaskAnnotator7RunTaskEPKcRKNS_11PendingTaskE + 654
25 libbase.dylib 0x00000001065d853d _ZN4base11MessageLoop7RunTaskERKNS_11PendingTaskE + 877
26 libbase.dylib 0x00000001065d8c16 _ZN4base11MessageLoop21DeferOrRunPendingTaskERKNS_11PendingTaskE + 86
27 libbase.dylib 0x00000001065d92c8 _ZN4base11MessageLoop6DoWorkEv + 552
28 libbase.dylib 0x00000001064ad938 _ZN4base24MessagePumpCFRunLoopBase7RunWorkEv + 104
29 libbase.dylib 0x00000001064ad8aa ___ZN4base24MessagePumpCFRunLoopBase13RunWorkSourceEPv_block_invoke + 42
30 libbase.dylib 0x000000010659391a _ZN4base3mac15CallWithEHFrameEU13block_pointerFvvE + 10
31 libbase.dylib 0x00000001064acc45 _ZN4base24MessagePumpCFRunLoopBase13RunWorkSourceEPv + 101
32 CoreFoundation 0x00007fff873175b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
33 CoreFoundation 0x00007fff87308c62 __CFRunLoopDoSources0 + 242
34 CoreFoundation 0x00007fff873083ef __CFRunLoopRun + 831
35 CoreFoundation 0x00007fff87307e75 CFRunLoopRunSpecific + 309
36 libbase.dylib 0x00000001064ae25c _ZN4base20MessagePumpCFRunLoop5DoRunEPNS_11MessagePump8DelegateE + 76
37 libbase.dylib 0x00000001064ad54d _ZN4base24MessagePumpCFRunLoopBase3RunEPNS_11MessagePump8DelegateE + 125
38 libbase.dylib 0x00000001065d7d6a _ZN4base11MessageLoop10RunHandlerEv + 298
39 libbase.dylib 0x00000001066814c5 _ZN4base7RunLoop3RunEv + 85
40 libbase.dylib 0x00000001065d584f _ZN4base11MessageLoop3RunEv + 303
41 libbase.dylib 0x0000000106763c27 _ZN4base6Thread3RunEPNS_11MessageLoopE + 39
42 libbase.dylib 0x00000001067644ad _ZN4base6Thread10ThreadMainEv + 1613
43 libbase.dylib 0x0000000106743681 _ZN4base12_GLOBAL__N_110ThreadFuncEPv + 705
44 libsystem_pthread.dylib 0x00007fff87f30899 _pthread_body + 138
45 libsystem_pthread.dylib 0x00007fff87f3072a _pthread_struct_init + 0
46 libsystem_pthread.dylib 0x00007fff87f34fc9 thread_start + 13
[0422/201357:ERROR:kill_posix.cc(82)] Unable to terminate process group 57073: No such process
Currently my branch is on commit 723a4b536fa9a2f0071c510d14c36918cfee83a9 and I'm using a dual-GPU MacBook Pro.
It seems that MacOS is always forcing a discrete GPU when running a single-process application with a call to a CGLChoosePixelFormat function (https://code.google.com/p/chromium/codesearch#chromium/src/ui/gl/gl_surface_mac.cc&q=InitializeOneOffForSandbox&sq=package:chromium&type=cs&l=78).
The gfxCardStatus(https://gfx.io) utility show an indication of discrete GPU when the test in running.
And then a DCHECK will be triggered inside a https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/renderer_host/render_process_host_impl.cc&q=RenderProcessHostImpl::OnGpuSwitched&sq=package:chromium&type=cs&l=2638 function.
It will call to RenderViewHost::RecomputeAndUpdateWebKitPreferences() and then RenderViewHost::From(), which is allowed to be called only on UI thread - https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/renderer_host/render_widget_host_impl.cc&q=RenderWidgetHostImpl::FromID&sq=package:chromium&type=cs&l=265, but it is called on GPU thread.
Is it correct to run this test in a single-process mode?
Comment 1 by durga.behera@chromium.org
, Apr 29 2016Labels: Te-NeedsFurtherTriage