Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IEDriverServer.exe crashes when connection is refused #5664

Closed
cnsgithub opened this issue Mar 22, 2018 · 2 comments
Closed

IEDriverServer.exe crashes when connection is refused #5664

cnsgithub opened this issue Mar 22, 2018 · 2 comments

Comments

@cnsgithub
Copy link

Meta -

OS:
Windows 8.1
Selenium Version:
3.11.0
Browser:
Internet Explorer 11.0.9600.18763
IEDriverServer.exe Version:
3.11.1

Expected Behavior -

If connection to target server is refused, test should fail without crashing the driver. The browser window should be closed.

Actual Behavior -

IEDriverServer.exe crashes and the browser window stays open.

WinDbg output:

Microsoft (R) Windows Debugger Version 10.0.16299.91 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

*** wait with pending attach
Symbol search path is: srv*
Executable search path is: 
ModLoad: 00007ff7`eca90000 00007ff7`ecd9e000   <path>\IEDriverServer.exe
ModLoad: 00007ffb`2f780000 00007ffb`2f92d000   C:\Windows\SYSTEM32\ntdll.dll
ModLoad: 00007ffb`2f640000 00007ffb`2f77e000   C:\Windows\system32\KERNEL32.DLL
ModLoad: 00007ffb`2cad0000 00007ffb`2cbe5000   C:\Windows\system32\KERNELBASE.dll
ModLoad: 00007ffb`2a790000 00007ffb`2a79a000   C:\Windows\SYSTEM32\VERSION.dll
ModLoad: 00007ffb`2f590000 00007ffb`2f63a000   C:\Windows\system32\msvcrt.dll
ModLoad: 00007ffa`eb2b0000 00007ffa`eb57d000   C:\Users\<user>\AppData\Local\Temp\IEDF228.tmp
ModLoad: 00007ffb`2ea00000 00007ffb`2eb40000   C:\Windows\system32\RPCRT4.dll
ModLoad: 00007ffb`2e9f0000 00007ffb`2e9f7000   C:\Windows\system32\PSAPI.DLL
ModLoad: 00007ffb`28380000 00007ffb`283ea000   C:\Windows\SYSTEM32\OLEACC.dll
ModLoad: 00007ffb`24a00000 00007ffb`24d21000   C:\Windows\SYSTEM32\WININET.dll
ModLoad: 00007ffb`250f0000 00007ffb`25275000   C:\Windows\SYSTEM32\urlmon.dll
ModLoad: 00007ffb`2f0d0000 00007ffb`2f247000   C:\Windows\system32\USER32.dll
ModLoad: 00007ffb`2ef80000 00007ffb`2f0cb000   C:\Windows\system32\GDI32.dll
ModLoad: 00007ffb`2e760000 00007ffb`2e80a000   C:\Windows\system32\ADVAPI32.dll
ModLoad: 00007ffb`2ebc0000 00007ffb`2ed54000   C:\Windows\system32\ole32.dll
ModLoad: 00007ffb`2e690000 00007ffb`2e756000   C:\Windows\system32\OLEAUT32.dll
ModLoad: 00007ffb`2f470000 00007ffb`2f4c4000   C:\Windows\system32\SHLWAPI.dll
ModLoad: 00007ffb`286c0000 00007ffb`28871000   C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.18696_none_9333287b4748e6ab\gdiplus.dll
ModLoad: 00007ffb`2e630000 00007ffb`2e68a000   C:\Windows\system32\WS2_32.dll
ModLoad: 00007ffb`2cdd0000 00007ffb`2cdfe000   C:\Windows\system32\SspiCli.dll
ModLoad: 00007ffb`2f250000 00007ffb`2f462000   C:\Windows\system32\combase.dll
ModLoad: 00007ffb`24e20000 00007ffb`250ea000   C:\Windows\SYSTEM32\iertutil.dll
ModLoad: 00007ffb`2bec0000 00007ffb`2bee1000   C:\Windows\SYSTEM32\USERENV.dll
ModLoad: 00007ffb`2f530000 00007ffb`2f589000   C:\Windows\SYSTEM32\sechost.dll
ModLoad: 00007ffb`2f4d0000 00007ffb`2f4d9000   C:\Windows\system32\NSI.dll
ModLoad: 00007ffb`2c8a0000 00007ffb`2c8b5000   C:\Windows\SYSTEM32\profapi.dll
ModLoad: 00007ffb`2f4e0000 00007ffb`2f516000   C:\Windows\system32\IMM32.DLL
ModLoad: 00007ffb`2ee20000 00007ffb`2ef72000   C:\Windows\system32\MSCTF.dll
ModLoad: 00007ffb`2c130000 00007ffb`2c189000   C:\Windows\system32\mswsock.dll
ModLoad: 00007ffb`2b700000 00007ffb`2b70b000   C:\Windows\SYSTEM32\kernel.appcore.dll
ModLoad: 00007ffb`2c7e0000 00007ffb`2c7eb000   C:\Windows\SYSTEM32\CRYPTBASE.dll
ModLoad: 00007ffb`2c770000 00007ffb`2c7d3000   C:\Windows\SYSTEM32\bcryptPrimitives.dll
ModLoad: 00007ffb`2b530000 00007ffb`2b659000   C:\Windows\system32\uxtheme.dll
ModLoad: 00007ffb`25f40000 00007ffb`261f4000   C:\Program Files (x86)\Stardock\Start8\Start8_64.dll
ModLoad: 00007ffb`26df0000 00007ffb`26f6f000   C:\Windows\SYSTEM32\PROPSYS.dll
ModLoad: 00007ffb`2aed0000 00007ffb`2aef1000   C:\Windows\system32\dwmapi.dll
ModLoad: 00007ffb`2a970000 00007ffb`2abeb000   C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.18006_none_623f33d3ecbe86e8\comctl32.dll
ModLoad: 00007ffb`1eb30000 00007ffb`1eb3f000   C:\Windows\SYSTEM32\atlthunk.dll
ModLoad: 00007ffb`2b0d0000 00007ffb`2b182000   C:\Windows\SYSTEM32\shcore.dll
ModLoad: 00007ffb`2ce60000 00007ffb`2e389000   C:\Windows\system32\SHELL32.dll
ModLoad: 00007ffb`2b190000 00007ffb`2b21e000   C:\Windows\system32\apphelp.dll
ModLoad: 00007ffb`2c190000 00007ffb`2c1b0000   C:\Windows\SYSTEM32\CRYPTSP.dll
ModLoad: 00007ffb`2bdb0000 00007ffb`2bde6000   C:\Windows\system32\rsaenh.dll
ModLoad: 00007ffb`2c450000 00007ffb`2c476000   C:\Windows\SYSTEM32\bcrypt.dll
ModLoad: 00007ffb`2ed60000 00007ffb`2ee16000   C:\Windows\SYSTEM32\clbcatq.dll
ModLoad: 00007ffb`2c7f0000 00007ffb`2c889000   C:\Windows\SYSTEM32\sxs.dll
ModLoad: 00007ffa`e4260000 00007ffa`e5af4000   C:\Windows\System32\mshtml.dll
ModLoad: 00007ffa`f4f50000 00007ffa`f500a000   C:\Program Files\Internet Explorer\ieproxy.dll
ModLoad: 00007ffb`0d420000 00007ffb`0d6e4000   C:\Windows\System32\actxprxy.dll
ModLoad: 00007ffb`273f0000 00007ffb`273fc000   C:\Windows\SYSTEM32\Secur32.dll
ModLoad: 00007ffb`28d80000 00007ffb`28d8c000   C:\Windows\System32\dispex.dll
(1c8c.4b84): Security check failure or stack buffer overrun - code c0000409 (!!! second chance !!!)
*** WARNING: Unable to verify checksum for <path>\IEDriverServer.exe
*** ERROR: Module load completed but symbols could not be loaded for <path>\IEDriverServer.exe
IEDriverServer+0x186fc:
00007ff7`ecaa86fc cd29            int     29h

IEDriverServer call stack:
image

IEDriverServer trace log:
https://gist.github.com/cnsgithub/7c9fcf9ebddde81e78ccf4ef9ef7f314

Java call stack:

Started InternetExplorerDriver server (64-bit)
3.11.1.0
Listening on port 17832
Log level is set to TRACE
Log file is set to <path>\IEDriverServer.log
Only local connections are allowed
Mar 22, 2018 12:50:02 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C

org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:17832
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:08.638Z'
System info: host: '<host>', ip: '<ip>', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '9.0.4'
Driver info: driver.version: RemoteWebDriver

	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:319)
	at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:365)
	at org.openqa.selenium.By$ById.findElement(By.java:218)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:311)
	at SeleniumTest.testLoginValid(SeleniumTest.java:36)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:17832
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:242)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:160)
	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
	at okhttp3.RealCall.execute(RealCall.java:77)
	at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:101)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:155)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
	... 30 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.base/java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.base/java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:400)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:243)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:225)
	at java.base/java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:402)
	at java.base/java.net.Socket.connect(Socket.java:591)
	at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129)
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:240)
	... 50 more

Steps to reproduce -

Prerequisite: Ensure there is no process listening on port 12345 at localhost.
Just execute this JUnit test:

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;

import java.util.concurrent.TimeUnit;

public class SeleniumTest {

    private WebDriver driver;

    @Before
    public void setup() {
        System.setProperty("webdriver.ie.driver", "<path>/IEDriverServer.exe");
        System.setProperty("webdriver.ie.driver.loglevel", "TRACE");
        System.setProperty("webdriver.ie.driver.logfile", "<path>/IEDriverServer.log");
        driver = new InternetExplorerDriver(new InternetExplorerOptions());
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    }

    @After
    public void teardown() {
        driver.close();
    }

    @Test
    public void testLoginValid() {
        driver.get("http://localhost:12345"); // no process must be listening on port 12345
        driver.findElement(By.id("foo")); // if you comment this out, there won't be a crash
    }

}
jimevans added a commit that referenced this issue Mar 22, 2018
This is to resolve issues with creating a JSON value that contains the
empty string. Fixes issue #5664.
@jimevans
Copy link
Member

This should be fixed in 7d4b038. If you want to pick up a built binary and see if it resolves the issue for you, you can do so from the prebuilt binaries checked into project source tree. If that does resolve the issue, we can close this one.

@cnsgithub
Copy link
Author

I tested the prebuilt binary and everything works fine. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants