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
scheduler: fix panic when preempting and evicting allocs #6792
Sorry about the noisy review. I search/replaced all the noErr helpers to
In ProposedAllocs the proposed alloc slice was being copied while its
The fix is to not copy the proposed alloc slice and pass the slice
Fixes #6787 In ProposedAllocs the proposed alloc slice was being copied while its contents were not. Since RemoveAllocs nils elements of the proposed alloc slice and is called twice, it could panic on the second call when erroneously accessing a nil'd alloc. The fix is to not copy the proposed alloc slice and pass the slice returned by the 1st RemoveAllocs call to the 2nd call, thus maintaining the trimmed length.
The bug has existed since 0.9.0-beta1, so it's somewhat rare to hit thankfully.
I pushed a docs update to document it. It's a bit of a funky place to mention it, but I can't think of anywhere else more appropriate.