New issue
Advanced search Search tips

Issue 764519 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 764202
issue 765101
issue 765632


Previous locations:
chromedriver:2011


Sign in to add a comment

Origin trials is causing WindowProxy to be initialized too early

Project Member Reported by gmanikpure@chromium.org, Sep 12 2017

Issue description

https://build.chromium.org/p/chromium.chromedriver/builders/Linux/builds/30947

======================================================================
ERROR: testNetworkConnectionTypeIsAppliedToAllTabs (__main__.MobileEmulationCapabilityTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 2295, in testNetworkConnectionTypeIsAppliedToAllTabs
    driver.FindElement('id', 'link').Click()
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 346, in FindElement
    Command.FIND_ELEMENT, {'using': strategy, 'value': target})
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in ExecuteCommand
    response = self._ExecuteCommand(command, params)
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 284, in _ExecuteCommand
    raise _ExceptionForLegacyResponse(response)
NoSuchElement: no such element: Unable to locate element: {"method":"id","selector":"link"}
  (Session info: chrome=63.0.3214.0)
  (Driver info: chromedriver=2.32.500270 (4b0eeba7e0d952c6617e232fa8ed53257c35dd2f),platform=Linux 3.13.0-129-generic x86_64)
======================================================================
ERROR: testNetworkConnectionTypeIsAppliedToAllTabsImmediately (__main__.MobileEmulationCapabilityTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 2261, in testNetworkConnectionTypeIsAppliedToAllTabsImmediately
    driver.FindElement('id', 'requestButton').Click()
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 346, in FindElement
    Command.FIND_ELEMENT, {'using': strategy, 'value': target})
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in ExecuteCommand
    response = self._ExecuteCommand(command, params)
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 284, in _ExecuteCommand
    raise _ExceptionForLegacyResponse(response)
NoSuchElement: no such element: Unable to locate element: {"method":"id","selector":"requestButton"}
  (Session info: chrome=63.0.3214.0)
  (Driver info: chromedriver=2.32.500270 (4b0eeba7e0d952c6617e232fa8ed53257c35dd2f),platform=Linux 3.13.0-129-generic x86_64)
======================================================================
FAIL: testDeviceName (__main__.MobileEmulationCapabilityTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 2100, in testDeviceName
    body_tag.GetText())
AssertionError: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36' != u''
----------------------------------------------------------------------

========== org.openqa.selenium.FrameSwitchingTest.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation (5.945s)
junit.framework.AssertionFailedError: Condition timed out: title to be: Google
 
Labels: Pri-1
Owner: alex...@chromium.org
Status: Assigned (was: Untriaged)
Summary: FATAL:WindowProxy.cpp(105)] Check failed: global_proxy_.IsEmpty() on Chrome 63+ (was: NoSuchElement on Chrome 63+)
These tests are failing due to a crash in Chrome browser.

[1:1:0912/110753.702073:FATAL:WindowProxy.cpp(105)] Check failed: global_proxy_.IsEmpty(). 
#0 0x0054cf8a7bf7 <unknown>
#1 0x0054cf8bbad1 <unknown>
#2 0x0054d292af47 <unknown>
#3 0x0054d292b767 <unknown>
#4 0x0054d1833552 <unknown>
#5 0x0054d1d56c41 <unknown>
#6 0x0054d1d5e65f <unknown>
#7 0x0054d2d22245 <unknown>
#8 0x0054d1acc18f <unknown>
#9 0x0054d1acb400 <unknown>
#10 0x0054d1acb18f <unknown>
#11 0x0054d1aca4ce <unknown>
#12 0x0054d1acb608 <unknown>
#13 0x0054d1acb4d8 <unknown>
#14 0x0054cf4e0218 <unknown>
#15 0x0054cf4fc460 <unknown>
#16 0x0054d28cf96d <unknown>
#17 0x0054d28cffdb <unknown>
#18 0x0054d1675ade <unknown>
#19 0x0054ce532960 <unknown>
#20 0x0054d024753c <unknown>
#21 0x0054cf8a8356 <unknown>
#22 0x0054cf50c49c <unknown>
#23 0x0054cf50a679 <unknown>
#24 0x0054cf8a8356 <unknown>
#25 0x0054cf8c0254 <unknown>
#26 0x0054cf8c08c1 <unknown>
#27 0x0054cf8c1a7a <unknown>
#28 0x0054cf8dec80 <unknown>
#29 0x0054d1d9f4f4 <unknown>
#30 0x0054cf5f2032 <unknown>
#31 0x0054cf5f3251 <unknown>
#32 0x0054cf5faded <unknown>
#33 0x0054cf5f1d82 <unknown>
#34 0x0054ce16b204 <unknown>
#35 0x7fc9306edf45 __libc_start_main
#36 0x0054ce16b060 <unknown>

Received signal 6
#0 0x0054cf8a7bf7 <unknown>
#1 0x0054cf8a775f <unknown>
#2 0x7fc9367bb330 <unknown>
#3 0x7fc930702c37 gsignal
#4 0x7fc930706028 abort
#5 0x0054cf8a67a2 <unknown>
#6 0x0054cf8bbf8c <unknown>
#7 0x0054d292af47 <unknown>
#8 0x0054d292b767 <unknown>
#9 0x0054d1833552 <unknown>
#10 0x0054d1d56c41 <unknown>
#11 0x0054d1d5e65f <unknown>
#12 0x0054d2d22245 <unknown>
#13 0x0054d1acc18f <unknown>
#14 0x0054d1acb400 <unknown>
#15 0x0054d1acb18f <unknown>
#16 0x0054d1aca4ce <unknown>
#17 0x0054d1acb608 <unknown>
#18 0x0054d1acb4d8 <unknown>
#19 0x0054cf4e0218 <unknown>
#20 0x0054cf4fc460 <unknown>
#21 0x0054d28cf96d <unknown>
#22 0x0054d28cffdb <unknown>
#23 0x0054d1675ade <unknown>
#24 0x0054ce532960 <unknown>
#25 0x0054d024753c <unknown>
#26 0x0054cf8a8356 <unknown>
#27 0x0054cf50c49c <unknown>
#28 0x0054cf50a679 <unknown>
#29 0x0054cf8a8356 <unknown>
#30 0x0054cf8c0254 <unknown>
#31 0x0054cf8c08c1 <unknown>
#32 0x0054cf8c1a7a <unknown>
#33 0x0054cf8dec80 <unknown>
#34 0x0054d1d9f4f4 <unknown>
#35 0x0054cf5f2032 <unknown>
#36 0x0054cf5f3251 <unknown>
#37 0x0054cf5faded <unknown>
#38 0x0054cf5f1d82 <unknown>
#39 0x0054ce16b204 <unknown>
#40 0x7fc9306edf45 __libc_start_main
#41 0x0054ce16b060 <unknown>
  r8: ffffacea706443e0  r9: ffffacea706443d0 r10: 0000000000000008 r11: 0000000000000202
 r12: 00007ffc64253790 r13: 000000000000005b r14: 00007ffc64253788 r15: 00007ffc64253780
  di: 0000000000000001  si: 0000000000000001  bp: 00007ffc64253140  bx: 00007ffc64253140
  dx: 0000000000000006  ax: 0000000000000000  cx: 00007fc930702c37  sp: 00007ffc64252f98
  ip: 00007fc930702c37 efl: 0000000000000202 cgf: 0000000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

Culprit CL - https://chromium.googlesource.com/chromium/src/+/27caae83cb530daaf49f9a38793e427cdf493a65

Attaching the chromedriver verbose logs.

alexmos@, could you please take a look? Thanks.
chromedriver_1.log
99 KB View Download
chromedriver_2.log
27.4 KB View Download
Cc: creis@chromium.org dcheng@chromium.org
Can you please provide instructions on how to reproduce this locally for someone not very familiar with chromedriver?  It'd be useful to get a filled in stack trace.

Daniel - you might be interested in the "Check failed: global_proxy_.IsEmpty()".  Any ideas on what might be causing it?  The test that triggers this is FrameSwitchingTest.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation (internal codesearch seems to have it), which apparently just loads a frame and clicks on a link there, which triggers a window.top.location = 'issue5237_target.html' via onclick.  All same-origin.

Comment 3 by dcheng@chromium.org, Sep 12 2017

This means that something is touching the Window object before we swapped frames. I checked in some "temporary" debugging code for this 3 months ago: https://chromium-review.googlesource.com/c/chromium/src/+/536575

If this repros consistently, it should be easy to log out the captured stack trace and see what's causing early initialization at the CHECK.
Please find the steps as follows:

1) In chromium checkout, run the below command for python tests:
:~/chromium/src$ chrome/test/chromedriver/test/run_py_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --log-path=$HOME/Desktop/chromedriver.log --filter=*.testDeviceName

:~/chromium/src$ chrome/test/chromedriver/test/run_py_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --log-path=$HOME/Desktop/chromedriver.log --filter=*.testNetworkConnectionTypeIsAppliedToAllTabs

:~/chromium/src$ chrome/test/chromedriver/test/run_py_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --log-path=$HOME/Desktop/chromedriver.log --filter=*.testNetworkConnectionTypeIsAppliedToAllTabsImmediately

2) And for java test:

:~/chromium/src$ chrome/test/chromedriver/test/run_java_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --filter=*.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation --log-path=$HOME/Desktop/chromedriver.log

Chromedriver binary can be downloaded from http://chromedriver.storage.googleapis.com/index.html?path=2.32/

This issue reproduces consistently. Please find the attached chrome_debug.log

chrome_debug.log
386 KB View Download

Comment 5 by dcheng@chromium.org, Sep 12 2017

Cc: alex...@chromium.org
Owner: iclell...@chromium.org
It's because origin trials is causing the context to be initialized in InstallNewDocument(), before we've actually committed the navigation and swapped frames:

#1 0x7fdb8e23cddc blink::WindowProxy::InitializeIfNeeded()
#2 0x7fdb8e814785 blink::Frame::GetWindowProxy()
#3 0x7fdb8e8339b0 blink::LocalFrame::WindowProxy()
#4 0x7fdb8e22355d blink::ToV8ContextEvenIfDetached()
#5 0x7fdb8e223422 blink::ToScriptStateImpl()                                                                                                                 
#6 0x7fdb8e22362f blink::ToScriptState()
#7 0x7fdb8ee1390e blink::OriginTrialContext::InitializePendingFeatures()
#8 0x7fdb8ee13bb6 blink::OriginTrialContext::AddFeature()
#9 0x7fdb8edb8368 blink::DocumentLoader::DidInstallNewDocument()
#10 0x7fdb8edb7535 blink::DocumentLoader::InstallNewDocument()
#11 0x7fdb8edb7095 blink::DocumentLoader::CommitNavigation()
#12 0x7fdb8edb5dd3 blink::DocumentLoader::CommitData()
#13 0x7fdb8edb7957 blink::DocumentLoader::ProcessData()
#14 0x7fdb8edb7815 blink::DocumentLoader::DataReceived()
#15 0x7fdb8d72c842 blink::RawResource::AppendData()
#16 0x7fdb8d753940 blink::ResourceLoader::DidReceiveData()
#17 0x7fdb92b2b953 content::WebURLLoaderImpl::Context::OnReceivedData()
#18 0x7fdb92b2c27b content::WebURLLoaderImpl::RequestPeerImpl::OnReceivedData()
#19 0x7fdb92b20c67 content::URLResponseBodyConsumer::OnReadable()
#20 0x7fdb92b20468 content::URLLoaderClientImpl::OnStartLoadingResponseBody()                                                                                
#21 0x7fdb92bd25b6 content::ThrottlingURLLoader::OnStartLoadingResponseBody()
#22 0x7fdb92cd9372 content::mojom::URLLoaderClientStubDispatch::Accept()

(This is the cause of another crash alexmos is investigating as well)

Comment 6 by dcheng@chromium.org, Sep 12 2017

Project: chromium
Moved issue chromedriver:2011 to now be  issue chromium:764519 .

Comment 7 by dcheng@chromium.org, Sep 12 2017

Components: Blink>Bindings
Labels: Type-Bug
Summary: Origin trials is causing WindowProxy to be initialized too early (was: FATAL:WindowProxy.cpp(105)] Check failed: global_proxy_.IsEmpty() on Chrome 63+)
To follow up on #5, the other crash I'm seeing due to this is when doing DevTools audits, once my fix for a preceding crash (https://chromium-review.googlesource.com/662904) lands.   Issue 764202  has the repro steps for it.

Since DidInstallNewDocument happens just before DidCommitNavigation in InstallNewDocument(), could we just do the OriginTrialContext::AddFeature a little bit later, after DidCommitNavigation?
Blocking: 764202
Blocking: 765101
Project Member

Comment 11 by bugdroid1@chromium.org, Sep 14 2017

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

commit 03793ac434be2878935f084870828b0cd5e0d7c8
Author: Gauri Manikpure <gmanikpure@chromium.org>
Date: Thu Sep 14 23:15:29 2017

[Chromedriver] Disable tests on HEAD that fails due to a Chrome browser crash.

Bug:  764519 
Change-Id: Id3ff2f511c71aeb550a98efbd38bea50774ec115
Reviewed-on: https://chromium-review.googlesource.com/668063
Reviewed-by: Shuotao Gao <stgao@chromium.org>
Commit-Queue: Gauri Manikpure <gmanikpure@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502090}
[modify] https://crrev.com/03793ac434be2878935f084870828b0cd5e0d7c8/chrome/test/chromedriver/test/run_py_tests.py
[modify] https://crrev.com/03793ac434be2878935f084870828b0cd5e0d7c8/chrome/test/chromedriver/test/test_expectations

Cc: dgozman@chromium.org
+dgozman who added the problematic call to OriginTrialContext::From(document)->AddFeature("ForceTouchEventFeatureDetectionForInspector") in https://chromium-review.googlesource.com/c/chromium/src/+/600989.

Dmitry, any thoughts about #8 or other ways to fix this?
Sure, we can move this call later. I'd even say we should not force any WindowProxy initialization at all, since it will ask for enabled origin trials when initializing anyway. I will take a look at how to avoid this tomorrow.
Cc: -dgozman@chromium.org iclell...@chromium.org
Owner: dgozman@chromium.org
#13: Thanks a lot!  I'll reassign this to you for now.
Blocking: 765632
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 18 2017

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

commit ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Mon Sep 18 19:55:26 2017

Move origin trials initialization later in document loading process

Enabling any origin trial feature forces WindowProxy initialization,
which should not be done before frame has been swapped in. This means
we should only initialize origin trials after DidCommitNavigation call.

Added a cross-site navigation to the test to catch this regression.

BUG= 764519 

Change-Id: Iea1c390eb27c0ecf9789215fb1349e0f01c16354
Reviewed-on: https://chromium-review.googlesource.com/669777
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502651}
[modify] https://crrev.com/ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
[modify] https://crrev.com/ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7/third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Status: Fixed (was: Assigned)
Project Member

Comment 18 by bugdroid1@chromium.org, Jan 30 2018

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

commit f84d86f12882a60cf51eb17e43a48716a41ae1a0
Author: Artur Khachatryan <khachatryan@chromium.org>
Date: Tue Jan 30 22:54:46 2018

[ChromeDriver] Enable several MobileEmulationCapabilityTest tests in HEAD

 Bug 764519  was fixed so relevant disabled tests are now enabled by this commit.

Bug:  764519 
Change-Id: I1af80b6ecbbf9548aeae8d5ab08641180dde9f2c
Reviewed-on: https://chromium-review.googlesource.com/894263
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Artur Khachatryan <khachatryan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533057}
[modify] https://crrev.com/f84d86f12882a60cf51eb17e43a48716a41ae1a0/chrome/test/chromedriver/test/run_py_tests.py

Sign in to add a comment