bettermanbao / openwrt-kcptun

openwrt-kcptun is mips32 port of kcptun
https://github.com/xtaci/kcptun
249 stars 44 forks source link

版本v20161105在WNDRMACv2上产生流量直接崩溃 #16

Closed aon3ko closed 8 years ago

aon3ko commented 8 years ago

OpenWrt 15.05.1 使用 ar71xx 确认无误 崩溃记录:

2016/11/12 23:26:34 main.go:57: stream opened
panic: runtime error: slice bounds out of range

goroutine 17 [running]:
github.com/klauspost/compress/snappy.encodeBlock(0x105d0014, 0x12ac8, 0x12ac8, 0x105c0000, 0x107, 0x10000, 0x56a45168)
        /opt/mipsgo/src/github.com/klauspost/compress/snappy/encode_other.go:175 +0xe40
github.com/klauspost/compress/snappy.Encode(0x105d0012, 0x12aca, 0x12aca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/github.com/klauspost/compress/snappy/encode.go:37 +0x370
github.com/klauspost/compress/snappy.(*Writer).write(0x1053c780, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/github.com/klauspost/compress/snappy/encode.go:229 +0x280
github.com/klauspost/compress/snappy.(*Writer).Flush(0x1053c780, 0x0, 0x0)
        /opt/mipsgo/src/github.com/klauspost/compress/snappy/encode.go:272 +0xb0
main.(*compStream).Write(0x10538110, 0x1062a000, 0x107, 0x10008, 0x107, 0x0, 0x0)
        /home/openwrt/kcptun/client/main.go:40 +0x88
github.com/xtaci/smux.(*Session).writeFrame(0x1050a1e0, 0x1020000, 0x3, 0x10644000, 0xff, 0x8000, 0x10536a00, 0x0, 0x0)
        /opt/mipsgo/src/github.com/xtaci/smux/session.go:272 +0x3c8
github.com/xtaci/smux.(*Stream).Write(0x1053a090, 0x10644000, 0xff, 0x8000, 0xff, 0x0, 0x0)
        /opt/mipsgo/src/github.com/xtaci/smux/stream.go:87 +0x174
io.Copy(0x7789b500, 0x1053a090, 0x7789b518, 0x1051a2a0, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:364 +0x288
main.func·002()
        /home/openwrt/kcptun/client/main.go:67 +0xd8
created by main.handleClient
        /home/openwrt/kcptun/client/main.go:67 +0x578

goroutine 1 [IO wait]:
net.(*pollDesc).Wait(0x105561b8, 0x72, 0x0, 0x0)
        /opt/mipsgo/src/net/fd_poll_runtime.go:84 +0x4c
net.(*pollDesc).WaitRead(0x105561b8, 0x0, 0x0)
        /opt/mipsgo/src/net/fd_poll_runtime.go:89 +0x48
net.(*netFD).accept(0x10556180, 0x0, 0x77899b10, 0x10538298)
        /opt/mipsgo/src/net/fd_unix.go:419 +0x3dc
net.(*TCPListener).AcceptTCP(0x1051a850, 0x1051a2a0, 0x0, 0x0)
        /opt/mipsgo/src/net/tcpsock_posix.go:234 +0x58
main.func·005(0x10500b40, 0x0, 0x0)
        /home/openwrt/kcptun/client/main.go:376 +0x25e8
reflect.Value.call(0x213d60, 0x2baea4, 0x13, 0x267e68, 0x4, 0x10527ac0, 0x1, 0x1, 0x0, 0x0, ...)
        /opt/mipsgo/src/reflect/value.go:419 +0xf9c
reflect.Value.Call(0x213d60, 0x2baea4, 0x13, 0x10527ac0, 0x1, 0x1, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/reflect/value.go:296 +0xb0
github.com/urfave/cli.HandleAction(0x213d60, 0x2baea4, 0x10500b40, 0x0, 0x0)
        /opt/mipsgo/src/github.com/urfave/cli/app.go:487 +0x27c
github.com/urfave/cli.(*App).Run(0x10564000, 0x1050a000, 0x9, 0x9, 0x0, 0x0)
        /opt/mipsgo/src/github.com/urfave/cli/app.go:245 +0x9e0
main.main()
        /home/openwrt/kcptun/client/main.go:406 +0x1418

goroutine 5 [syscall]:
os/signal.loop()
        /opt/mipsgo/src/os/signal/signal_unix.go:21 +0x30
created by os/signal.init·1
        /opt/mipsgo/src/os/signal/signal_unix.go:27 +0x58

goroutine 6 [chan receive]:
main.sigHandler()
        /home/openwrt/kcptun/client/signal.go:23 +0x150
created by main.init·1
        /home/openwrt/kcptun/client/signal.go:15 +0x48

goroutine 7 [select]:
github.com/xtaci/kcp-go.(*UDPSession).updateTask(0x1055e080)
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:507 +0x33c
created by github.com/xtaci/kcp-go.newUDPSession
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:116 +0x524

goroutine 8 [select]:
github.com/xtaci/kcp-go.(*UDPSession).outputTask(0x1055e080)
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:408 +0x17a4
created by github.com/xtaci/kcp-go.newUDPSession
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:117 +0x554

goroutine 9 [select]:
github.com/xtaci/kcp-go.(*UDPSession).readLoop(0x1055e080)
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:625 +0x494
created by github.com/xtaci/kcp-go.newUDPSession
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:119 +0x594

goroutine 11 [IO wait]:
net.(*pollDesc).Wait(0x105628f8, 0x72, 0x0, 0x0)
        /opt/mipsgo/src/net/fd_poll_runtime.go:84 +0x4c
net.(*pollDesc).WaitRead(0x105628f8, 0x0, 0x0)
        /opt/mipsgo/src/net/fd_poll_runtime.go:89 +0x48
net.(*netFD).readFrom(0x105628c0, 0x10558000, 0x800, 0x800, 0x0, 0x0, 0x0, 0x77899b10, 0x10538130)
        /opt/mipsgo/src/net/fd_unix.go:269 +0x418
net.(*UDPConn).ReadFromUDP(0x1051a370, 0x10558000, 0x800, 0x800, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/net/udpsock_posix.go:67 +0x108
net.(*UDPConn).ReadFrom(0x1051a370, 0x10558000, 0x800, 0x800, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/net/udpsock_posix.go:82 +0x104
github.com/xtaci/kcp-go.(*UDPSession).receiver(0x1055e080, 0x10562180)
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:606 +0x108
created by github.com/xtaci/kcp-go.(*UDPSession).readLoop
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:622 +0x84

goroutine 12 [select]:
github.com/xtaci/kcp-go.(*UDPSession).Read(0x1055e080, 0x105f4000, 0x4, 0x12ace, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/github.com/xtaci/kcp-go/sess.go:180 +0x8d0
io.ReadAtLeast(0x7789b320, 0x1055e080, 0x105f4000, 0x4, 0x12ace, 0x4, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:298 +0x118
io.ReadFull(0x7789b320, 0x1055e080, 0x105f4000, 0x4, 0x12ace, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:316 +0x6c
github.com/klauspost/compress/snappy.(*Reader).readFull(0x105621c0, 0x105f4000, 0x4, 0x12ace, 0x1000000, 0x0)
        /opt/mipsgo/src/github.com/klauspost/compress/snappy/decode.go:108 +0x6c
github.com/klauspost/compress/snappy.(*Reader).Read(0x105621c0, 0x10608000, 0x8, 0x10008, 0x10500f00, 0x0, 0x0)
        /opt/mipsgo/src/github.com/klauspost/compress/snappy/decode.go:128 +0x1c0
main.(*compStream).Read(0x10538110, 0x10608000, 0x8, 0x10008, 0x2, 0x0, 0x0)
        /home/openwrt/kcptun/client/main.go:35 +0x5c
io.ReadAtLeast(0x7789b378, 0x10538110, 0x10608000, 0x8, 0x10008, 0x8, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:298 +0x118
io.ReadFull(0x7789b378, 0x10538110, 0x10608000, 0x8, 0x10008, 0x7788ca8c, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:316 +0x6c
github.com/xtaci/smux.(*Session).readFrame(0x1050a1e0, 0x10608000, 0x10008, 0x10008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/mipsgo/src/github.com/xtaci/smux/session.go:163 +0x104
github.com/xtaci/smux.(*Session).recvLoop(0x1050a1e0)
        /opt/mipsgo/src/github.com/xtaci/smux/session.go:198 +0x1d8
created by github.com/xtaci/smux.newSession
        /opt/mipsgo/src/github.com/xtaci/smux/session.go:63 +0x358

goroutine 13 [select]:
github.com/xtaci/smux.(*Session).keepalive(0x1050a1e0)
        /opt/mipsgo/src/github.com/xtaci/smux/session.go:246 +0x360
created by github.com/xtaci/smux.newSession
        /opt/mipsgo/src/github.com/xtaci/smux/session.go:64 +0x384

goroutine 14 [select]:
main.scavenger(0x10562280)
        /home/openwrt/kcptun/client/main.go:423 +0x610
created by main.func·005
        /home/openwrt/kcptun/client/main.go:373 +0x25d0

goroutine 15 [select]:
main.handleClient(0x7789b430, 0x1051a2a0, 0x7789b450, 0x1053a090)
        /home/openwrt/kcptun/client/main.go:70 +0x65c
created by main.func·005
        /home/openwrt/kcptun/client/main.go:402 +0x2fd4

goroutine 16 [select]:
github.com/xtaci/smux.(*Stream).Read(0x1053a090, 0x1063c000, 0x8000, 0x8000, 0x0, 0x778959c0, 0x1051a068)
        /opt/mipsgo/src/github.com/xtaci/smux/stream.go:67 +0x6c0
io.Copy(0x7789b4d0, 0x1051a2e0, 0x7789b488, 0x1053a090, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:362 +0x208
net.genericReadFrom(0x7789b470, 0x1051a2a0, 0x7789b488, 0x1053a090, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/net/net.go:404 +0xb4
net.(*TCPConn).ReadFrom(0x1051a2a0, 0x7789b488, 0x1053a090, 0x7789b4b8, 0x1051a2a0, 0x0, 0x0)
        /opt/mipsgo/src/net/tcpsock_posix.go:72 +0x118
io.Copy(0x7789b470, 0x1051a2a0, 0x7789b488, 0x1053a090, 0x0, 0x0, 0x0, 0x0)
        /opt/mipsgo/src/io/io.go:358 +0x154
main.func·001()
        /home/openwrt/kcptun/client/main.go:64 +0xd8
created by main.handleClient
        /home/openwrt/kcptun/client/main.go:64 +0x448
bettermanbao commented 8 years ago

加-nocomp参数启动,禁用压缩