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

net: exception initializing netFD on Windows #13541

Closed
esushu opened this issue Dec 9, 2015 · 6 comments

Comments

Projects
None yet
6 participants
@esushu
Copy link

commented Dec 9, 2015

Go 1.5.1 windows 10 64

Code:

package main

import (
    "fmt"
    "net"
)

func main() {
    fmt.Println("Starting the server ...")
    // create listener:
    listener, err := net.Listen("tcp", "localhost:8003")
    if err != nil {
        fmt.Println("Error listening", err.Error())
        return // terminate program
    }
    // listen and accept connections from clients:
    for {
        conn, err := listener.Accept()
        if err != nil {
            fmt.Println("Error accepting", err.Error())
            return // terminate program
        }
        go doServerStuff(conn)
    }
}
func doServerStuff(conn net.Conn) {
    for {
        buf := make([]byte, 512)
        _, err := conn.Read(buf)
        if err != nil {
            fmt.Println("Error reading", err.Error())
            return // terminate program
        }
        fmt.Printf("Received data: %v", string(buf))
    }
}

Exception occurs when I run the above code using go run file.go cmd.

Starting the server ...
Exception 0xc0000005 0x8 0x2b 0x2b
PC=0x2b

syscall.Syscall(0x7ff9c7e502b0, 0x2, 0x28c, 0x2, 0x0, 0x8, 0x62a380, 0xc08201a000)
        c:/go/src/runtime/syscall_windows.go:128 +0x5c
syscall.SetFileCompletionNotificationModes(0x28c, 0xc08201aa02, 0x0, 0x0)
        c:/go/src/syscall/zsyscall_windows.go:1699 +0x70
net.(*netFD).init(0xc08201aa80, 0x0, 0x0)
        c:/go/src/net/fd_windows.go:286 +0x146
net.(*netFD).listenStream(0xc08201aa80, 0x374300, 0xc0820441e0, 0x7fffffff, 0x0, 0x0)
        c:/go/src/net/sock_posix.go:169 +0x409
net.socket(0x5714d0, 0x3, 0x2, 0x1, 0x0, 0x0, 0x374300, 0xc0820441e0, 0x0, 0x0, ...)
        c:/go/src/net/sock_posix.go:76 +0x20b
net.internetSocket(0x5714d0, 0x3, 0x374300, 0xc0820441e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, ...)
        c:/go/src/net/ipsock_posix.go:160 +0x148
net.ListenTCP(0x5714d0, 0x3, 0xc0820441e0, 0x3742c8, 0x0, 0x0)
        c:/go/src/net/tcpsock_posix.go:329 +0x1a2
net.Listen(0x5714d0, 0x3, 0x576410, 0xe, 0x0, 0x0, 0x0, 0x0)
        c:/go/src/net/dial.go:395 +0x469
main.main()
        D:/development/go/go-example/src/example/test/net/tcp/server1.go:11 +0x13a
rax     0x0
rbx     0x62a708
rcx     0x28c
rdi     0x7ff5ffffd000
rsi     0xc082053890
rbp     0x0
rsp     0x8fda8
r8      0x0
r9      0x8
r10     0x0
r11     0x217
r12     0x2
r13     0x5aeaea
r14     0x3
r15     0x8
rip     0x2b
rflags  0x10246
cs      0x33
fs      0x53
gs      0x2b
@bradfitz

This comment has been minimized.

Copy link
Member

commented Dec 9, 2015

@ianlancetaylor ianlancetaylor changed the title syscall.Syscall Exception net: exception initializing netFD on Windows Dec 9, 2015

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Dec 9, 2015

@alexbrainman

This comment has been minimized.

Copy link
Member

commented Dec 10, 2015

@esushu does this happens every time you run this program?

Alex

@esushu

This comment has been minimized.

Copy link
Author

commented Dec 11, 2015

@alexbrainman Yes! It happens every time when i run the program on the computer of my company. But it is ok on my own computer which is also windows10 64.

@davecheney

This comment has been minimized.

Copy link
Contributor

commented Dec 11, 2015

Do you think antivirus or some other software your employer has installed
is involved ?

On Fri, 11 Dec 2015, 11:17 esushu notifications@github.com wrote:

@alexbrainman https://github.com/alexbrainman Yes! It happens every
time when i run the program on the computer of my company. But it is ok on
my own computer which is also windows10 64.


Reply to this email directly or view it on GitHub
#13541 (comment).

@esushu

This comment has been minimized.

Copy link
Author

commented Dec 11, 2015

@davecheney @alexbrainman I uninstall go and install it again today. It's OK now . I did it but failed yesterday. I'm confused! The environments are the same.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Dec 11, 2015

Closing as unreproducible. Let us know if it happens again. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.