2014/05/12 21:22:55 Closing connection to <..>
panic: Index out of range.
goroutine 27 [running]:
runtime.panic(0x69f940, 0xc2082a5500)
/usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/jackpal/Taipei-Torrent/torrent.(*Bitset).IsSet(0xc2082420c0, 0x235, 0xc208357448)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/bitset.go:52 +0xda
github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).RecordBlock(0xc20802e000, 0xc2082c6340, 0x1800000000235, 0x4000, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:812 +0x721
github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).generalMessage(0xc20802e000, 0xc20848a000, 0x4009, 0x4009, 0xc2082c6340, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:1005 +0x1840
github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).DoMessage(0xc20802e000, 0xc2082c6340, 0xc20848a000, 0x4009, 0x4009, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:878 +0xb6
github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).DoTorrent(0xc20802e000)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:588 +0x1685
main.func·002()
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/main.go:96 +0x37
created by main.main
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/main.go:98 +0xbe4
goroutine 16 [select]:
main.main()
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/main.go:108 +0x1550
goroutine 19 [finalizer wait]:
runtime.park(0x4158d0, 0x96d280, 0x96b4e9)
/usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x96d280, 0x96b4e9)
/usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
/usr/local/go/src/pkg/runtime/mgc0.c:2626 +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 [chan receive]:
github.com/golang/glog.(*loggingT).flushDaemon(0x96eea0)
/home/nictuku/src/github.com/golang/glog/glog.go:839 +0x75
created by github.com/golang/glog.init·1
/home/nictuku/src/github.com/golang/glog/glog.go:406 +0x28a
goroutine 17 [syscall]:
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1445
goroutine 23 [IO wait]:
net.runtime_pollWait(0x7f818a43eac0, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2080521b0, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2080521b0, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).accept(0xc208052150, 0x83c680, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:409 +0x2fe
net.(*TCPListener).AcceptTCP(0xc20803e020, 0x6928a0, 0x0, 0x0)
/usr/local/go/src/pkg/net/tcpsock_posix.go:233 +0x59
net.(*TCPListener).Accept(0xc20803e020, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/tcpsock_posix.go:243 +0x4b
github.com/jackpal/Taipei-Torrent/torrent.func·001()
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/listen.go:52 +0x4c
created by github.com/jackpal/Taipei-Torrent/torrent.ListenForPeerConnections
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/listen.go:71 +0x43a
goroutine 24 [select]:
github.com/nictuku/nettools.(*ClientThrottle).cleanup(0xc208044da0)
/home/nictuku/src/github.com/nictuku/nettools/ratelimit.go:76 +0x220
created by github.com/nictuku/nettools.NewThrottler
/home/nictuku/src/github.com/nictuku/nettools/ratelimit.go:20 +0xcb
goroutine 28 [IO wait]:
net.runtime_pollWait(0x7f818a43ea10, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2080525a0, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2080525a0, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).readFrom(0xc208052540, 0xc208017000, 0x1000, 0x1000, 0x0, 0x0, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:259 +0x39d
net.(*UDPConn).ReadFromUDP(0xc20803e058, 0xc208017000, 0x1000, 0x1000, 0x1e, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/udpsock_posix.go:67 +0x141
github.com/nictuku/dht.readFromSocket(0xc20803e058, 0xc208004780, 0xc208054140, 0xc208004660)
/home/nictuku/src/github.com/nictuku/dht/krpc.go:215 +0xbb
created by github.com/nictuku/dht.(*DHT).Run
/home/nictuku/src/github.com/nictuku/dht/dht.go:300 +0x182
goroutine 26 [runnable]:
github.com/nictuku/dht.(*DHT).Run(0xc208066100, 0x0, 0x0)
/home/nictuku/src/github.com/nictuku/dht/dht.go:331 +0x1086
created by github.com/jackpal/Taipei-Torrent/torrent.NewTorrentSession
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:190 +0x4ee
goroutine 29 [select]:
github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).deadlockDetector(0xc20802e000)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:446 +0x48b
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).DoTorrent
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:475 +0x5f
goroutine 30 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.func·004()
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/trackerClient.go:47 +0x6c
created by github.com/jackpal/Taipei-Torrent/torrent.startTrackerClient
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/trackerClient.go:59 +0x247
goroutine 31 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.func·005()
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/trackerClient.go:62 +0x7b
created by github.com/jackpal/Taipei-Torrent/torrent.startTrackerClient
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/trackerClient.go:68 +0x286
goroutine 40 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.queueingWriter(0xc2082cb260, 0xc2082cb2c0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:65 +0xbc
created by github.com/jackpal/Taipei-Torrent/torrent.NewPeerState
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:94 +0x74
goroutine 52 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.queueingWriter(0xc2082dbd40, 0xc2082dbda0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:65 +0xbc
created by github.com/jackpal/Taipei-Torrent/torrent.NewPeerState
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:94 +0x74
goroutine 42 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerWriter(0xc2082c6820, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:240 +0xa1
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:418 +0x41e
goroutine 43 [runnable]:
net.runtime_pollWait(0x7f818a43e8b0, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc208132290, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc208132290, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc208132230, 0xc20818bc7c, 0x4, 0x4, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:232 +0x30e
net.(*conn).Read(0xc20803e040, 0xc20818bc7c, 0x4, 0x4, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/net.go:122 +0xe7
github.com/jackpal/Taipei-Torrent/torrent.readNBOUint32(0x7f818a43f048, 0xc20803e040, 0x7f8100000000, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:225 +0xcd
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerReader(0xc2082c6820, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:276 +0x47
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:419 +0x447
goroutine 64 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.queueingWriter(0xc208301f20, 0xc208301f80)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:65 +0xbc
created by github.com/jackpal/Taipei-Torrent/torrent.NewPeerState
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:94 +0x74
goroutine 54 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerWriter(0xc2082c7c70, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:240 +0xa1
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:418 +0x41e
goroutine 55 [runnable]:
net.runtime_pollWait(0x7f818a43e750, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2081333a0, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2081333a0, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc208133340, 0xc2081ad120, 0x4, 0x4, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:232 +0x30e
net.(*conn).Read(0xc20803e060, 0xc2081ad120, 0x4, 0x4, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/net.go:122 +0xe7
github.com/jackpal/Taipei-Torrent/torrent.readNBOUint32(0x7f818a43f048, 0xc20803e060, 0x7f8100000000, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:225 +0xcd
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerReader(0xc2082c7c70, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:276 +0x47
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:419 +0x447
goroutine 76 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.queueingWriter(0xc208300600, 0xc208300660)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:65 +0xbc
created by github.com/jackpal/Taipei-Torrent/torrent.NewPeerState
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:94 +0x74
goroutine 66 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerWriter(0xc208304d00, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:240 +0xa1
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:418 +0x41e
goroutine 67 [runnable]:
net.runtime_pollWait(0x7f818a43e490, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc208052d80, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc208052d80, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc208052d20, 0xc2082ba75c, 0x4, 0x4, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:232 +0x30e
net.(*conn).Read(0xc20803e0a0, 0xc2082ba75c, 0x4, 0x4, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/net.go:122 +0xe7
github.com/jackpal/Taipei-Torrent/torrent.readNBOUint32(0x7f818a43f048, 0xc20803e0a0, 0x7f8100000000, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:225 +0xcd
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerReader(0xc208304d00, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:276 +0x47
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:419 +0x447
goroutine 78 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerWriter(0xc2082c6340, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:240 +0xa1
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:418 +0x41e
goroutine 91 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.queueingWriter(0xc2082da5a0, 0xc2082da600)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:65 +0xbc
created by github.com/jackpal/Taipei-Torrent/torrent.NewPeerState
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:94 +0x74
goroutine 79 [runnable]:
net.runtime_pollWait(0x7f818a43e5f0, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2081bc530, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2081bc530, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc2081bc4d0, 0xc2084ae22d, 0x3ddc, 0x3ddc, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:232 +0x30e
net.(*conn).Read(0xc20803e0e0, 0xc2084ae22d, 0x3ddc, 0x3ddc, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/net.go:122 +0xe7
io.ReadAtLeast(0x7f818a448798, 0xc20803e0e0, 0xc2084ae000, 0x4009, 0x4009, 0x4009, 0x22d, 0x0, 0x0)
/usr/local/go/src/pkg/io/io.go:289 +0x11e
io.ReadFull(0x7f818a448798, 0xc20803e0e0, 0xc2084ae000, 0x4009, 0x4009, 0x4009, 0x0, 0x0)
/usr/local/go/src/pkg/io/io.go:307 +0x89
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerReader(0xc2082c6340, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:293 +0x16f
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:419 +0x447
goroutine 93 [chan receive]:
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerWriter(0xc2082c71e0, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:240 +0xa1
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:418 +0x41e
goroutine 94 [runnable]:
net.runtime_pollWait(0x7f818a43e280, 0x72, 0x0)
/usr/local/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2081bd6b0, 0x72, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2081bd6b0, 0x0, 0x0)
/usr/local/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc2081bd650, 0xc2082a53f8, 0x4, 0x4, 0x0, 0x7f818a43d440, 0xb)
/usr/local/go/src/pkg/net/fd_unix.go:232 +0x30e
net.(*conn).Read(0xc20803e128, 0xc2082a53f8, 0x4, 0x4, 0x0, 0x0, 0x0)
/usr/local/go/src/pkg/net/net.go:122 +0xe7
github.com/jackpal/Taipei-Torrent/torrent.readNBOUint32(0x7f818a43f048, 0xc20803e128, 0x7f8100000000, 0x0, 0x0)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:225 +0xcd
github.com/jackpal/Taipei-Torrent/torrent.(*peerState).peerReader(0xc2082c71e0, 0xc208004420)
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/peer.go:276 +0x47
created by github.com/jackpal/Taipei-Torrent/torrent.(*TorrentSession).addPeerImp
/home/nictuku/src/github.com/jackpal/Taipei-Torrent/torrent/torrent.go:419 +0x447
I can work on this but it may take me some time.