Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

dogtunnel客户端运行报错index out of range #117

Open
georgeent opened this issue Aug 14, 2018 · 0 comments
Open

dogtunnel客户端运行报错index out of range #117

georgeent opened this issue Aug 14, 2018 · 0 comments

Comments

@georgeent
Copy link

感谢VZEX的在项目上的付出

内网测试环境:
服务端:Centos7 X86_64
远端:Centos7 X86_64
近端:Centos7 X86_64 & Fedora 2x X86_64

计划用于客户端的p2p互联
使用2进制版本与github上下载源代码编译(centos6+go1.8.3) v0.80与直接git clone的代码,
客户端运行时均出现panic: runtime error: index out of range,然后程序退出.

服务端日志未抛出错误日志:
2018/07/12 10:42:05 listenAdd: 0.0.0.0:65000
2018/07/12 10:42:05 master start success
2018/07/12 10:42:05 admin service start success
2018/07/12 10:44:15 client linked success 192.168.10.25:37718
2018/07/12 10:44:15 client disconnected 192.168.10.25:37718
2018/07/12 10:48:56 client linked success 192.168.10.208:48812
2018/07/12 10:48:56 OnLogin 1531363736
2018/07/12 10:48:56 client reg service success 192.168.10.208:48812 jack test
2018/07/12 10:49:14 client linked success 192.168.10.25:37732
2018/07/12 10:49:14 client link service success 192.168.10.25:37732 test
2018/07/12 10:49:14 start session 1 0 test 1
2018/07/12 10:49:14 ===>>tell a to report addrlist 192.168.10.25:37732 test 1
2018/07/12 10:49:14 <<===report addr list ok 192.168.10.25:37732 test 1
2018/07/12 10:49:14 ===>>tell b to report addlist,give b the a's addrlist 192.16
8.10.208:48812 test 1
2018/07/12 10:49:14 <<===report addr list ok 192.168.10.208:48812 test 1
2018/07/12 10:49:14 =====>>tell a the b 's addrlist, and a start bust 192.168.10
.25:37732 test 1

客户端A
$./dtunnel -addip 192.168.10.220:7004 -buster 192.168.10.220:65000 -remote 192.168.10.220:7004 -clientkey testkey -compress -delay 2 -dnscache 20 -reg test -local :22 -mode 0 -ssl=false -key 42ce996e7c61121ea8816c625324dbf3
connect to server succeed
save setting ok, nexttime please use -f to replace -key
2018-07-12 10:49:02 register service ok, user:jack
init aeskey for client 1 asd4153136376298
read: 192.168.10.208:60577
addrList 192.168.10.208:60577
192.168.10.208:60577
:60577

panic: runtime error: index out of range

goroutine 15 [running]:
github.com/vzex/dog-tunnel/nat/stun.BindResponse(0xc42007e734, 0xc, 0xc, 0xc42006eff0, 0x0, 0x0, 0x0, 0x0, 0xc4200ca8e0, 0x28, ...)
/root/go/src/github.com/vzex/dog-tunnel/nat/stun/stun.go:149 +0x3d4
github.com/vzex/dog-tunnel/nat.(*AttemptEngine).read(0xc4200ac090, 0xbec9ce4d058671de, 0x4fe797058)
/root/go/src/github.com/vzex/dog-tunnel/nat/nat.go:199 +0x7ad
github.com/vzex/dog-tunnel/nat.(*AttemptEngine).run(0xc4200ac090, 0xc420055ec8, 0xc420046990, 0xc4200469a0, 0x10, 0x61a520, 0xc420074e01, 0xc4200469a0)
/root/go/src/github.com/vzex/dog-tunnel/nat/nat.go:262 +0x249
github.com/vzex/dog-tunnel/nat.(*AttemptEngine).GetConn(0xc4200ac090, 0xc420044ec8, 0xc420046990, 0xc4200469a0, 0xc420074f28, 0xc42006ec01, 0x7fffd2f6e6ae, 0x7f620e870000)
/root/go/src/github.com/vzex/dog-tunnel/nat/nat.go:85 +0x4d
main.(*UDPMakeSession).beginMakeHole(0xc42007e460, 0x0, 0x0)
/root/go/src/github.com/vzex/dog-tunnel/client.go:287 +0x287
created by main.handleResponse
/root/go/src/github.com/vzex/dog-tunnel/client.go:142 +0xc1a

客户端B
$ ./dtunnel -addip 192.168.10.220:7004 -buster 192.168.10.220:65000 -remote 192.168.10.220:7004 -clientkey testkey \

-compress -delay 2 -encrypt -dnscache 20 -link test -local :1322 -mode 0 -ssl=false -key 42ce996e7c61121ea8816c625324dbf3
connect to server succeed
save setting ok, nexttime please use -f to replace -key
2018-07-12 10:44:23 serverName invalid!!!
read tcp 192.168.10.25:37718->192.168.10.220:7004: use of closed network connection
[brayden@brayden linux]$ ./dtunnel -addip 192.168.10.220:7004 -buster 192.168.10.220:65000 -remote 192.168.10.220:7004 -clientkey testkey -compress -delay 2 -encrypt -dnscache 20 -link test -local :1322 -mode 0 -ssl=false -key 42ce996e7c61121ea8816c625324dbf3
connect to server succeed
save setting ok, nexttime please use -f to replace -key
read: 192.168.10.25:41979
addrList 192.168.10.25:41979
192.168.10.25:41979
:41979

panic: runtime error: index out of range

goroutine 12 [running]:
github.com/vzex/dog-tunnel/nat/stun.BindResponse(0xc4200c40f4, 0xc, 0xc, 0xc42008cf00, 0x0, 0x0, 0x0, 0x0, 0xc42014c560, 0x28, ...)
/root/go/src/github.com/vzex/dog-tunnel/nat/stun/stun.go:149 +0x3d4
github.com/vzex/dog-tunnel/nat.(*AttemptEngine).read(0xc42013a000, 0xbec9ce4d298fc7e3, 0x9607d92a)
/root/go/src/github.com/vzex/dog-tunnel/nat/nat.go:199 +0x7ad
github.com/vzex/dog-tunnel/nat.(*AttemptEngine).run(0xc42013a000, 0xc420057ec8, 0xc42004c950, 0xc42004c960, 0x10, 0x61a520, 0x1, 0xc42004c960)
/root/go/src/github.com/vzex/dog-tunnel/nat/nat.go:262 +0x249
github.com/vzex/dog-tunnel/nat.(*AttemptEngine).GetConn(0xc42013a000, 0xc420049ec8, 0xc42004c950, 0xc42004c960, 0x3, 0xc42008cb10, 0x7ffd27960067, 0x7ffa18766000)
/root/go/src/github.com/vzex/dog-tunnel/nat/nat.go:85 +0x4d
main.(*UDPMakeSession).beginMakeHole(0xc42009a3c0, 0xc420016400, 0x31)
/root/go/src/github.com/vzex/dog-tunnel/client.go:287 +0x287
created by main.handleResponse
/root/go/src/github.com/vzex/dog-tunnel/client.go:137 +0xca1

如我编译问题或者命令错误,请给个提示,谢谢

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

1 participant