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(&c, big.NewInt(1))
> fmt.Println(b.String())
> fmt.Println(c.String())
> fmt.Println(a.String())
> }
>
>
> reproducible code. don't know what causing it tho :(
Minimised:
https://go.dev/play/p/oL17vkcjaEl
This is happening because the sum in a doesn't result in a
normalisation of b,
https://go.dev/play/p/cIBDbRXFnAT (in this
situation where the abs field represents a zero, it should be zero
length).
Given that this can happen without a race or unsafe modifications it
might be worth filing a issue for.