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
net: Listener crashes on windows #46125
Comments
This is a low-level crash in the runtime, not likely to be related to the program itself. I suggest disabling any antivirus software you have running. |
We tried the following steps:
Same result. |
On which version of Windows OS does this happen? Could you try this
If that doesn't help, what happens if you close the Conn object returned by Accept? |
I'm unable to reproduce this bug on Windows 10. |
@almartino I also cannot reproduce this running on current Go tip on Windows 10
Sorry, but I don't have time to debug this. Alex |
I do this when installing a network server on Windows, altho I don't think it's the cause of your error:
|
|
I don't know if this can help, but the same "crash" occurs when I build the executable. |
@almartino what I would do is download original version of Go and try it instead of using IDE. You can download latest version in a zip file, for example https://golang.org/dl/go1.16.4.windows-amd64.zip from Then unzip it somewhere on your system. And then open cmd.exe and try building your program from command line by using To be able to run correct Go version (the one that you unzipped to your disk), you would have to modify your PATH variable before you build your program. You can temporarily change PATH when you open cmd.exe program. Just do this command:
Just run Alex |
Hi @alexbrainman , we followed your suggested steps, same results. |
Did you run Same for Same for executing your program. Show output of your program. Thank you. Alex |
Does this happen for a simple "hello world" program with only Can you try a similar program in a different language (C#, C, Python, etc) on that machine? |
We unzipped the latest version into Go run
Go build(same terminal instance after SET command)
|
the net.Listen call triggers the issue. |
And your Java program runs fine? Did you try the command I suggested in #46125 (comment)? (Requires Admin privs.) |
Yes, the java program runs fine, and the "test" handler works when invoked. Additionally, I built the executable from my linux machine with |
We need to see complete stack trace output by test.exe program. Also
before you run test.exe so we can see as much detailed stacktrace as possible. It appears that your Thank you. Alex |
Sorry I reported a bad info: Stack trace with |
Since the executable built on Linux works, it might help to see a comparison of that with the executable built on Windows. cc @ianlancetaylor for suggestions on comparing executable files... |
Good.
Good.
The stack trace you posted says that your program is running net/http.ListenAndServe, but your original issue #46125 (comment) does not mention net/http.ListenAndServe. I need complete source code to be able to reproduce your problem. So, please, provide your program source and version of go that use. And do not use
and provide complete output of these commands. Thank you. Alex |
Sorry for the delay, I can't investigate more this problem because it is on my colleague's machine. Thanks for your help. Alberto |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, test done with:
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The following program fails when launched directly in the IDE (Goland) and with
go run main.go
:The same program is ok when launched in debug directly in the IDE(Goland)
The problem occurs also with windows firewall disabled
What did you expect to see?
A working http server / net listener
What did you see instead?
The following exception:
Goland run Output with listen on "127.0.0.1:9080"
Goland run Output with listen on ":9080"
The text was updated successfully, but these errors were encountered: