majestrate / XD

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

SIGSEGV if SAM address is not reachable #15

Closed l-n-s closed 7 years ago

l-n-s commented 7 years ago

Not critical, but maybe it could shutdown more gracefully, print some information to user etc.

[NFO] 2017-08-08 23:14:53.750845717 +0000 UTC   starting XD-0.0.5
[NFO] 2017-08-08 23:14:53.75546648 +0000 UTC    auto-generated new config at torrents.ini
[NFO] 2017-08-08 23:14:53.759523296 +0000 UTC   loaded config torrents.ini
[NFO] 2017-08-08 23:14:53.761184967 +0000 UTC   generated peer id -XD0050-WL%17%E6%D7%D5%D6%A2%87r%F9%8C
[NFO] 2017-08-08 23:14:53.762417834 +0000 UTC   create new i2p session with 127.0.0.1:7656
[NFO] 2017-08-08 23:14:53.765337932 +0000 UTC   opening i2p session
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x55b3d13c5bd8]

goroutine 9 [running]:
github.com/majestrate/XD/vendor/xd/lib/network/i2p.(*samSession).Close(0xc4200fc540, 0x0, 0x0)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/network/i2p/sam.go:26 +0x28
github.com/majestrate/XD/vendor/xd/lib/network/i2p.(*samSession).Open(0xc4200fc540, 0x13, 0x0)
        /root/go/src/github.com/majestrate/XD/vendor/xd/lib/network/i2p/sam.go:231 +0xa8
github.com/majestrate/XD/vendor/xd/cmd/xd.Run.func3(0xc420052e40, 0x55b3d1a8af80, 0xc4200fc540)
        /root/go/src/github.com/majestrate/XD/vendor/xd/cmd/xd/xd.go:98 +0x66
created by github.com/majestrate/XD/vendor/xd/cmd/xd.Run
        /root/go/src/github.com/majestrate/XD/vendor/xd/cmd/xd/xd.go:110 +0x6e9
majestrate commented 7 years ago

should be fixed in https://github.com/majestrate/XD/commit/73306ee58c7184cfdb60ec7c1a592e95728f5c23