You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our environment, IEDriverServer.exe runs as a low privileged user and it runs fine for
the most part. The environment is deployed as a Windows VM (2012R2) on Amazon EC2. Also,
we are running with IEDriver version 3.0.0.0. But, I have verified that the problem persists
even in the most recent version of the driver.
After running webdriver scripts for a while, things start to go south. For reasons unknown, IEDriverServer begins crashing everytime an attempt is made to create a new webdriver.
Nothing fancy, just a simple webdriver.Ie() is enough to crash the IEDriverServer.
I managed to get the crash dump and after debugging it for a bit, I discovered that, in AttachToBrowserUsingShellWindows, an attempt is made to CoCreateInstance of CLSID_ShellWindows and this call fails with 'Access Denied'. Since there is no error
checking following this, later code which tries to invoke _NewEnum on the IShellWindows
fails badly.
bool BrowserFactory::AttachToBrowserUsingShellWindows(
...
CComPtr<IShellWindows> shell_windows;
shell_windows.CoCreateInstance(CLSID_ShellWindows);
CComPtr<IUnknown> enumerator_unknown;
HRESULT hr = shell_windows->_NewEnum(&enumerator_unknown);
if (FAILED(hr)) {
LOGHR(WARN, hr) << "Unable to get enumerator from IShellWindows interface";
return false;
}
Notice that there is no check for HRESULT for the CoCreateInstance call. In our environment,
this call fails and as a result shell_windows instance is bogus.
There are two aspects that I don't understand:
The system runs fine for a while, and only then it starts misbehaving. It appears as if
the permissions to CoCreateInstance was valid at one point for the low-privileged user and
becomes invalid later.
Given that the low-privileged user is unable to CoCreateInstance, how can it be fixed?
I tried to poke around Component Services but even when logged in as administrator, all
the property settings are greyed out for ShellWindows.
I'd be happy to attach the crash dump if needed. I can submit a patch for the missing check for CoCreateInstance call.
Browser Version: IE10/IE11
Expected Behavior -
No IEDriverServer.exe crashes. And the driver object should be created without any issues.
Actual Behavior -
IEDriverServer.exe crashes because of 'Access Denied' for CoCreateInstance.
Steps to reproduce -
There is no easy way to reproduce this. It happens in our system after running scripts for a long time as the unprivileged user.
The text was updated successfully, but these errors were encountered:
I've papered over the crash, adding error checking around the call to CoCreateInstance. Unfortunately, if that call fails, there's precious little the driver can do about it. That's calling into an OS component that the driver has no influence on or control over.
Meta -
OS: Windows Server 2012 R2
Selenium Version: 3.0.1, IEDriver version: 3.0.0.0
Browser: IE10/IE11
In our environment, IEDriverServer.exe runs as a low privileged user and it runs fine for
the most part. The environment is deployed as a Windows VM (2012R2) on Amazon EC2. Also,
we are running with IEDriver version 3.0.0.0. But, I have verified that the problem persists
even in the most recent version of the driver.
After running webdriver scripts for a while, things start to go south. For reasons unknown, IEDriverServer begins crashing everytime an attempt is made to create a new webdriver.
Nothing fancy, just a simple
webdriver.Ie()
is enough to crash the IEDriverServer.I managed to get the crash dump and after debugging it for a bit, I discovered that, in
AttachToBrowserUsingShellWindows
, an attempt is made toCoCreateInstance
ofCLSID_ShellWindows
and this call fails with 'Access Denied'. Since there is no errorchecking following this, later code which tries to invoke
_NewEnum
on theIShellWindows
fails badly.
Notice that there is no check for
HRESULT
for theCoCreateInstance
call. In our environment,this call fails and as a result
shell_windows
instance is bogus.There are two aspects that I don't understand:
The system runs fine for a while, and only then it starts misbehaving. It appears as if
the permissions to CoCreateInstance was valid at one point for the low-privileged user and
becomes invalid later.
Given that the low-privileged user is unable to
CoCreateInstance
, how can it be fixed?I tried to poke around
Component Services
but even when logged in as administrator, allthe property settings are greyed out for
ShellWindows
.I'd be happy to attach the crash dump if needed. I can submit a patch for the missing check for
CoCreateInstance
call.Browser Version: IE10/IE11
Expected Behavior -
No IEDriverServer.exe crashes. And the driver object should be created without any issues.
Actual Behavior -
IEDriverServer.exe crashes because of 'Access Denied' for CoCreateInstance.
Steps to reproduce -
There is no easy way to reproduce this. It happens in our system after running scripts for a long time as the unprivileged user.
The text was updated successfully, but these errors were encountered: