Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash trying to delete #2

Closed
FrancYescO opened this issue Dec 7, 2016 · 5 comments
Closed

Crash trying to delete #2

FrancYescO opened this issue Dec 7, 2016 · 5 comments

Comments

@FrancYescO
Copy link

I just tried a "deldata 1" on an unmagnetized torrent (was shown with a red bar and with the hash in the web GUI) and i got this crash

panic: runtime error: index out of range

goroutine 202 [running]:
panic(0x667400, 0xc420012100)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.head(0x26b45191, 0xc420380000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4204460b0, 0x0, ...)
/root/go/src/github.com/pyed/transmission-telegram/transmission-telegram.go:434 +0xe92
created by main.main
/root/go/src/github.com/pyed/transmission-telegram/transmission-telegram.go:254 +0x78b

After a restart of the bin I got the message from the bot that the torrent was deleted with his data

@pyed
Copy link
Owner

pyed commented Dec 7, 2016

I see that the panic is pointing to the head function, what I believe happened is that you sent the command head and it hug half way through then you sent deldata 1, head knew that there's at least one torrent and it tried to access it, but deldata 1 was faster.

@FrancYescO
Copy link
Author

yep you are probably right, here the full conv with the bot:
http://i.imgur.com/GyNvi8N.png

@pyed
Copy link
Owner

pyed commented Dec 7, 2016

actually it is a bug, it's not about timing, it's just that head will always expect to find at least 1 torrent if it get executed before deleting the last one, because it keeps updating the message, it should check with every iteration to make sure that we have at least one torrent.

@FrancYescO
Copy link
Author

what about just stop updating the old message if another one received? this will also allow to avoid update the message endless

pyed pushed a commit that referenced this issue Dec 7, 2016
@pyed
Copy link
Owner

pyed commented Dec 7, 2016

thank you!

@pyed pyed closed this as completed Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants