majestrate / XD

meme bittorrent client
https://xd-torrent.github.io/
MIT License
241 stars 25 forks source link

ctrl+c causes sigsegv #18

Closed l-n-s closed 7 years ago

l-n-s commented 7 years ago

At first run, when it prints forever

[DBG] 2017-08-10 17:04:02.564856198 +0000 UTC torrent waiting for network

I press ctrl+c and it throws new error


[DBG] 2017-08-10 17:04:03.565118023 +0000 UTC   torrent waiting for network
^C[NFO] 2017-08-10 17:04:03.831307788 +0000 UTC Interrupted
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x55bf829ebff9]

goroutine 18 [running]:
github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm.(*torrentAnnounce).tryAnnounce(0x0, 0x55bf82aa26db, 0x7, 0x0, 0x55bf82fb0b40)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm/announce.go:21 +0x39
github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm.(*Torrent).announce(0xc4200ba0c0, 0x0, 0x0, 0x55bf82aa26db, 0x7)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm/torrent.go:246 +0xca
github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm.(*Torrent).StopAnnouncing(0xc4200ba0c0)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm/torrent.go:218 +0xc9
github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm.(*Torrent).Close(0xc4200ba0c0, 0xc420114d80, 0xc42001cfa8)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm/torrent.go:86 +0x73
github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm.(*Holder).Close.func1(0xc420052f18, 0xc4201b3230, 0x28)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm/holder.go:90 +0xda
created by github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm.(*Holder).Close
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/bittorrent/swarm/holder.go:91 +0x203
majestrate commented 7 years ago

try https://github.com/majestrate/XD/commit/4a3decff76f2e3456c3a6c68fb2d3dd70c02508c

l-n-s commented 7 years ago

seems to be fixed