-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weak: TestIssue69210 failures #70455
Comments
Found new dashboard test flakes for:
2024-11-19 23:01 gotip-linux-amd64-longtest-race go@6f519476 weak.TestIssue69210 [ABORT] (log)
|
CC @mknyszek |
Oh that's fun. Thanks for the CC! |
There's also #70048, which at first glance seems to be reporting a data race from when it was internal/weak, but maybe that is something else or maybe already resolved? |
They're definitely related. The data race doesn't make any sense unless That also lines up with the failure here: there's an erroneously freed (and then marked) value. |
I closed that issue so copying over the one failure that's in there: 2024-10-25 04:52 gotip-linux-amd64-longtest-race go@2ef8e41f internal/weak.TestIssue69210 (log) |
I do think it's interesting that this has only happened in race mode. I wonder if the race instrumentation is breaking any of the assumptions the weak->strong conversion code makes. More likely though is that it's a more general bug but race mode is just good at reproducing the timing. We only have two data points after all. |
Having both of these failures is also very useful because it suggests that https://go.dev/cl/623615 is not involved. It landed on November 1st. |
It took a couple minutes of execution under |
Here's a theory: |
This would specifically be an issue because in the "successful |
I have a fix, assuming this is the issue. I don't have a good way to validate this, so I'm just going to let the test run under |
I have been running the test for far longer than it took to reproduce the issue, and it's not failing anymore. I'll keep it running, but I think this is it. |
@gopherbot Please open a backport issue for Go 1.23. This bug causes rare and subtle crashes when using weak pointers (so, anything using |
Backport issue(s) opened: #70469 (for 1.23). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/630315 mentions this issue: |
Change https://go.dev/cl/630277 mentions this issue: |
Change https://go.dev/cl/630316 mentions this issue: |
This is similar to the weak handle bug in #70455. In short, there's a window where a heap-allocated value is only visible through a special that has not been made visible to the GC yet. For #70455. Change-Id: Ic2bb2c60d422a5bc5dab8d971cfc26ff6d7622bc Reviewed-on: https://go-review.googlesource.com/c/go/+/630277 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
…getOrAddWeakHandle getOrAddWeakHandle is very careful about keeping its input alive across the operation, but not very careful about keeping the heap-allocated handle it creates alive. In fact, there's a window in this function where it is *only* visible via the special. Specifically, the window of time between when the handle is stored in the special and when the special actually becomes visible to the GC. (If we fail to add the special because it already exists, that case is fine. We don't even use the same handle value, but the one we obtain from the attached GC-visible special, *and* we return that value, so it remains live.) For #70455. Fixes #70469. Change-Id: Iadaff0cfb93bcaf61ba2b05be7fa0519c481de82 Reviewed-on: https://go-review.googlesource.com/c/go/+/630316 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
…getOrAddWeakHandle getOrAddWeakHandle is very careful about keeping its input alive across the operation, but not very careful about keeping the heap-allocated handle it creates alive. In fact, there's a window in this function where it is *only* visible via the special. Specifically, the window of time between when the handle is stored in the special and when the special actually becomes visible to the GC. (If we fail to add the special because it already exists, that case is fine. We don't even use the same handle value, but the one we obtain from the attached GC-visible special, *and* we return that value, so it remains live.) For golang#70455. Fixes golang#70469. Change-Id: Iadaff0cfb93bcaf61ba2b05be7fa0519c481de82 Reviewed-on: https://go-review.googlesource.com/c/go/+/630316 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Issue created automatically to collect these failures.
Example (log):
— watchflakes
The text was updated successfully, but these errors were encountered: