panic: syscall: string with NUL passed to StringToUTF16
goroutine 1 [running]:
panic(0x5fea40, 0x11820598)
D:/liteidex30.2.windows-qt5/go/src/runtime/panic.go:500 +0x331
syscall.StringToUTF16(0x118a274f, 0x10, 0x0, 0x0, 0x0)
D:/liteidex30.2.windows-qt5/go/src/syscall/syscall_windows.go:31 +0xab
syscall.StringToUTF16Ptr(0x118a274f, 0x10, 0x11867bd4)
D:/liteidex30.2.windows-qt5/go/src/syscall/syscall_windows.go:66 +0x29
net.lookupPort(0x70ad00, 0x118040cc, 0x6345aa, 0x3, 0x118a274f, 0x10, 0x0, 0x0,
0x0)
D:/liteidex30.2.windows-qt5/go/src/net/lookup_windows.go:145 +0x17a
net.LookupPort(0x6345aa, 0x3, 0x118a274f, 0x10, 0x118a274f, 0x0, 0x0)
D:/liteidex30.2.windows-qt5/go/src/net/lookup.go:147 +0x90
net.internetAddrList(0x70ad00, 0x118040cc, 0x6345aa, 0x3, 0x118a2740, 0x1f, 0x0
0x0, 0x0, 0x0, ...)
D:/liteidex30.2.windows-qt5/go/src/net/ipsock.go:205 +0x7ef
net.ResolveUDPAddr(0x6345aa, 0x3, 0x118a2740, 0x1f, 0x1, 0x0, 0x0)
D:/liteidex30.2.windows-qt5/go/src/net/udpsock.go:61 +0xe0
main.main()
D:/liteidex30.2.windows-qt5/work/src/p2ptest/homeclienta.go:85 +0xe9b
85行代码
raddr, err := net.ResolveUDPAddr("udp", strladdr)
strladdr值是正常的. 以上错误很奇怪, 在windows下不管32还是64位都是如此.
但是源码在linux上编译后运行, 就不会出错..为啥呢
有疑问加站长微信联系(非本文作者)