On Tue, 2024-02-13 at 21:35 -0800, Poonai wrote: > big int panics during text conversion randomly > > stack trace: > > panic: runtime error: index out of range [1] with length 1 > > goroutine 2088184 [running]: > math/big.nat.itoa({0xc01db71500, 0x1, 0x199?}, 0x0, 0xa) > /usr/local/go/src/math/big/natconv.go:340 +0x3d2 > math/big.(*Int).Text(...) > /usr/local/go/src/math/big/intconv.go:25 > math/big.(*Int).String(...) > /usr/local/go/src/math/big/intconv.go:40 > > It shows up randomly, help me debug
I think you have probably ended up with a zero big.Int with a non-zero length abs field. This is likely either from unsafe manipulation or a race. The crash can be replicated thus https://go.dev/play/p/WV78xvsbn4m -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/887305154dab7b435f14d8e5e1278742aa62deb7.camel%40kortschak.io.