-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
math/big: panic during block validation #616
Comments
I just downgraded to go1.4.2 to keep my node from crashing. |
I'd suggest 1.5.2 if you really want to be sure. I should note though that nobody else has seen this, so we're not sure yet if it's just a one-off hardware error that caused it. |
The bug in math/big was reported on the go project as well with other crypto software. I'm running on an Intel NUC with i3-3217U CPU @ 1.80GHz 16GB RAM and a 256GB SSD. I'll change to 1.5.2 thanks. |
I would not recommend 1.5.2. That version also has bugs in the big.Int.Exp function, but your program will silently continue with incorrect results. Panicking is better here. That bug was also the cause of CVE-2015-8618, and while I don't believe it will affect btcd, other Go programs may be vulnerable if you install it system wide. |
I've also been running tip (1.6) without any issue, but mostly just to make sure there won't be any surprises when it is released. But I wouldn't recommend that to most users unless they are prepared to encounter and then report any bugs. I also have not compared the 1.6 big.Int code against 1.5.3 to know if there is any difference and whether this bug will appear there either. I think the safest version to use in production right now is, unfortunately, 1.4.3. |
Also, I believe @davecgh mentioned that he and @jimmysong are working on other code that would remove all of the big.Int usage in btcec, and that this issue wouldn't affect block processing for us after. Is that correct? |
I'd also be willing to add a recover in the signature verification code so we could do something nicer here than just quitting the process. In particular, we should get the transaction being verified and the previous inputs. This should help with creating a reproducible test case that we can send to the Go devs. |
In addition to being able to fix this by changing the Go version, this will be fixed under all Go versions by #621 once it's finalized and merged. |
+1 I am also seeing this error. go version go1.5.3 linux/amd64 This panic I know happened on testnet. I saw it happen on my mainnet chain too. Here is the testnet panic http://pastebin.com/vWZjv75K |
For reference, Go 1.6 was just released and this issue is fixed with it. That said, I'm going to leave this open until #621 is finalized and merged because that will not only provide the associated speed enhancements, it will fix it under all Go versions since it will remove the dependency on the Go runtime's math/big package for EC math entirely. |
Seeing this on
go version go1.5.3 linux/amd64
with latestbtcd
on testnet. Seems to be an instance of golang/go#13973The text was updated successfully, but these errors were encountered: