On Wed, 2024-02-14 at 12:24 +0100, Jan Mercl wrote:
> On Wed, Feb 14, 2024 at 12:14 PM 'Dan Kortschak' via golang-nuts
> wrote:
>
> > Given that this can happen without a race or unsafe modifications
> > it
> > might be worth filing a issue for.
>
> I think this is expected. Quoting from the
On Wed, Feb 14, 2024 at 12:14 PM 'Dan Kortschak' via golang-nuts
wrote:
> Given that this can happen without a race or unsafe modifications it
> might be worth filing a issue for.
I think this is expected. Quoting from the big.Int docs
https://pkg.go.dev/math/big#Int
To "copy" an Int
On Wed, 2024-02-14 at 02:07 -0800, Poonai wrote:
> Thanks all,
>
> figured out the issue:
>
> func main() {
> a := big.NewInt(1)
> b := *a
> c := *a
> c.Sub(, big.NewInt(1))
> fmt.Println(b.String())
> fmt.Println(c.String())
> fmt.Println(a.String())
> }
>
>
>
Thanks all,
figured out the issue:
func main() {
a := big.NewInt(1)
b := *a
c := *a
c.Sub(, big.NewInt(1))
fmt.Println(b.String())
fmt.Println(c.String())
fmt.Println(a.String())
}
reproducible code. don't know what causing it tho :(
On Wednesday, February 14, 2024
Have you tried running your entire code under the race detector?
https://go.dev/blog/race-detector
On Wednesday 14 February 2024 at 06:02:02 UTC Kurtis Rader wrote:
> Maybe provide a minimal reproducible example (
> https://stackoverflow.com/help/minimal-reproducible-example)?
>
> While it is
Maybe provide a minimal reproducible example (
https://stackoverflow.com/help/minimal-reproducible-example)?
While it is theoretically possible there is a bug in the `big` package that
could result in such panics it is much more likely the bug is in your code.
So showing us how you are using the
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)
>
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(...)