Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: possible pointer-to-random-memory during hashmap evacuate #21459
Probably since the GC cared about invalid pointers (1.6?).
It's a very hard bug to trigger. You'd have to be evacuating to the last bucket in an array of map buckets, or an overflow bucket, be evacuating just the right number of elements, and get interrupted at just the right time.
But if it did trigger it would be one of those annoying and hard to track down "sweep increased allocation count" bugs.
The fix is super simple.
We pushed the overflow pointer to the end of the bucket a while ago to solve exactly this sort of problem, so this actually isn't a bug. Even if the pointer points past the end of the value array, it doesn't point past the end of the bucket.
After the key and value arrays, we have an overflow pointer. So there's no way a past-the-end key or value pointer could point past the end of the containing bucket. So we don't need this additional protection. Update #21459 Change-Id: I7726140033b06b187f7a7d566b3af8cdcaeab0b0 Reviewed-on: https://go-review.googlesource.com/56772 Run-TryBot: Keith Randall <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Martin Möhrmann <email@example.com> Reviewed-by: Josh Bleecher Snyder <firstname.lastname@example.org> Reviewed-by: Avelino <email@example.com>