cyfdecyf / cow

HTTP proxy written in Go. COW can automatically identify blocked sites and use parent proxies to access.
BSD 2-Clause "Simplified" License
8.45k stars 1.61k forks source link

COW 崩溃,报「panic: authIP should always get IP address」 #59

Open glacjay opened 11 years ago

glacjay commented 11 years ago

COW 版本:40cdfbd6ab6ff54dcf129858b78c4251e661eb10 Go 版本:1.1.1 Windows 32-bit 崩溃日志:

C:\Users\chujie\Desktop>D:

D:>cd D:\bin\

D:\bin>D:\bin\cow.exe 2013/07/18 15:25:21 COW proxy address 0.0.0.0:7777, PAC url http://:7777/pac panic: authIP should always get IP address

goroutine 16 [running]: main.authIP(0x20165230, 0x5, 0x5) D:/go/home/src/github.com/cyfdecyf/cow/auth.go:210 +0x86 main.Authenticate(0x200f9c00, 0x200fb960, 0x0, 0x0) D:/go/home/src/github.com/cyfdecyf/cow/auth.go:187 +0x12a main.(_clientConn).serve(0x200f9c00) D:/go/home/src/github.com/cyfdecyf/cow/proxy.go:325 +0x40e created by main.(_Proxy).Serve D:/go/home/src/github.com/cyfdecyf/cow/proxy.go:176 +0x4bc

goroutine 1 [chan receive]: main.main() D:/go/home/src/github.com/cyfdecyf/cow/main.go:85 +0x216

goroutine 3 [syscall]: os/signal.loop() C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/os/signal/signal_unix.go:21 +0x1e created by os/signal.init路1 C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/os/signal/signal_unix.go:27 +0x31

goroutine 8 [sleep]: time.Sleep(0x30b8a000, 0x346) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/runtime/ztime_windows_386.c:19 +0x39 main.func路011() D:/go/home/src/github.com/cyfdecyf/cow/sitestat.go:420 +0x2d created by main.initSiteStat D:/go/home/src/github.com/cyfdecyf/cow/sitestat.go:423 +0x5e

goroutine 9 [sleep]: time.Sleep(0xd964b800, 0x45) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/runtime/ztime_windows_386.c:19 +0x39 main.func路001() D:/go/home/src/github.com/cyfdecyf/cow/pac.go:186 +0x2d created by main.initPAC D:/go/home/src/github.com/cyfdecyf/cow/pac.go:189 +0x27

goroutine 10 [chan receive]: main.sigHandler() D:/go/home/src/github.com/cyfdecyf/cow/main.go:21 +0x10f created by main.main D:/go/home/src/github.com/cyfdecyf/cow/main.go:76 +0x11e

goroutine 13 [sleep]: time.Sleep(0xfc23ac00, 0x6) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/runtime/ztime_windows_386.c:19 +0x39 main.runEstimateTimeout() D:/go/home/src/github.com/cyfdecyf/cow/estimate_timeout.go:100 +0x62 created by main.main D:/go/home/src/github.com/cyfdecyf/cow/main.go:78 +0x13a

goroutine 14 [select]: net.(_ioSrv).ExecIO(0x20159618, 0x2016e520, 0x2010e6c0, 0x0, 0x0, ...) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/net/fd_windows.go:236 +0x664 net.(_netFD).accept(0x2012d080, 0x5bd140, 0x0, 0x0, 0x0, ...) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/net/fd_windows.go:644 +0x325 net.(_TCPListener).AcceptTCP(0x20159638, 0x40fc7c, 0x3ebeb8, 0x40fc7c) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/net/tcpsock_posix.go:229 +0x41 net.(_TCPListener).Accept(0x20159638, 0x201595d8, 0x2016e020, 0x200f9c00, 0x0, ...) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/net/tcpsock_posix.go:239 +0x28 main.(*Proxy).Serve(0x2016e020, 0x200f9ac0) D:/go/home/src/github.com/cyfdecyf/cow/proxy.go:167 +0x2b7 created by main.main D:/go/home/src/github.com/cyfdecyf/cow/main.go:82 +0x1d7

goroutine 15 [syscall]: syscall.Syscall6(0x76044e90, 0x5, 0xdc, 0x201652a0, 0x20159550, ...) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/runtime/zsyscall_windows_windows_386.c:97 +0x 49 syscall.GetQueuedCompletionStatus(0xdc, 0x201652a0, 0x20159550, 0x20159548, 0xffffffff, ...) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/syscall/zsyscall_windows_386.go:507 +0x7e net.(*resultSrv).Run(0x20159610) C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/net/fd_windows.go:150 +0x11a created by net.startServer C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist934530519/go/src/pkg/net/fd_windows.go:285 +0xde

D:\bin>pause 请按任意键继续. . .

cyfdecyf commented 11 years ago

Fixed in 597f056. Now refactored to use net.SplitHostPort exclusively and removed splitHostPort.

bobwenx commented 10 years ago

相同问题: 2014/10/30 15:19:41 COW 0.9.3 listen http 0.0.0.0:3128, PAC url http://:3128/pac [DEBUG] 2014/10/30 15:19:44 cli([fe80::ee1a:59ff:fe3d:400b%en5]:65250) connected, total 1 clients [>>>>>] 2014/10/30 15:19:44 cli([fe80::ee1a:59ff:fe3d:400b%en5]:65250) request GET hootsuite.com:80/ [DEBUG] 2014/10/30 15:19:44 cli([fe80::ee1a:59ff:fe3d:400b%en5]:65250) closed, total 0 clients panic: authIP should always get IP address

goroutine 33 [running]: runtime.panic(0x1d3880, 0xc2080aeae0) /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5 main.authIP(0xc2080bf2f1, 0x1d, 0x1d) /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/auth.go:203 +0xc0 main.Authenticate(0xc2080bd700, 0xc208028c60, 0x0, 0x0) /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/auth.go:188 +0x1d6 main.(_clientConn).serve(0xc2080bd700) /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/proxy.go:466 +0x734 created by main.(_httpProxy).Serve /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/proxy.go:176 +0x6c7

goroutine 16 [semacquire]: sync.runtime_Semacquire(0xc2080ae65c) /usr/local/go/src/pkg/runtime/sema.goc:199 +0x30 sync.(*WaitGroup).Wait(0xc2080b1ee0) /usr/local/go/src/pkg/sync/waitgroup.go:129 +0x14b main.main() /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/main.go:83 +0x1ea

goroutine 19 [finalizer wait]: runtime.park(0x52950, 0x3e5b28, 0x3e4ec9) /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89 runtime.parkunlock(0x3e5b28, 0x3e4ec9) /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b runfinq() /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]: os/signal.loop() /usr/local/go/src/pkg/os/signal/signal_unix.go:21 +0x1e created by os/signal.init·1 /usr/local/go/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 21 [sleep]: time.Sleep(0x12a05f200) /usr/local/go/src/pkg/runtime/time.goc:39 +0x31 main.closeStaleServerConn(0xc2080240b0, 0x284890, 0x8) /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/conn_pool.go:190 +0x34 created by main.init·2 /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/conn_pool.go:30 +0x47

goroutine 27 [sleep]: time.Sleep(0x45d964b800) /usr/local/go/src/pkg/runtime/time.goc:39 +0x31 main.func·013() /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/sitestat.go:435 +0x2c created by main.initSiteStat /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/sitestat.go:438 +0x72

goroutine 28 [sleep]: time.Sleep(0xdf8475800) /usr/local/go/src/pkg/runtime/time.goc:39 +0x31 main.func·002() /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/pac.go:199 +0x2c created by main.initPAC /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/pac.go:202 +0x27

goroutine 29 [chan receive]: main.sigHandler() /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/main.go:22 +0x18e created by main.main /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/main.go:70 +0xd0

goroutine 31 [sleep]: time.Sleep(0x6fc23ac00) /usr/local/go/src/pkg/runtime/time.goc:39 +0x31 main.runEstimateTimeout() /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/estimate_timeout.go:100 +0x51 created by main.main /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/main.go:73 +0x100

goroutine 32 [IO wait]: net.runtime_pollWait(0x496bc0, 0x72, 0x0) /usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66 net.(_pollDesc).Wait(0xc20802d560, 0x72, 0x0, 0x0) /usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46 net.(_pollDesc).WaitRead(0xc20802d560, 0x0, 0x0) /usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42 net.(_netFD).accept(0xc20802d500, 0x2f1090, 0x0, 0x495418, 0x23) /usr/local/go/src/pkg/net/fd_unix.go:419 +0x343 net.(_TCPListener).AcceptTCP(0xc20803c080, 0x8, 0x0, 0x0) /usr/local/go/src/pkg/net/tcpsock_posix.go:234 +0x5d net.(_TCPListener).Accept(0xc20803c080, 0x0, 0x0, 0x0, 0x0) /usr/local/go/src/pkg/net/tcpsock_posix.go:244 +0x4b main.(_httpProxy).Serve(0xc2080270e0, 0xc2080b1ee0) /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/proxy.go:166 +0x4b5 created by main.main /Users/cyf/local/mygo/src/github.com/cyfdecyf/cow/main.go:81 +0x1bf

goroutine 33 [syscall]: runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1445

oscar-c commented 9 years ago

我这边也有类似问题。 cow 0.9.4 rc文件配置如下: listen = http://0.0.0.0:1085 [公网IP]:1085 proxy = socks5://localhost:1080 proxy = socks5://localhost:1081 logFile = /Users/[我的用户名]/.cow/log userPasswd = user:pass <--去掉这行则没有问题。 loadBalance = backup

局域网内设备通过mDNS名称(类似于 MyMac.local 这样的形式 )访问COW的服务的时候会出现这样退出,如果通过IP地址访问则没有这样的问题。