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
go/types: data race in computeInterfaceTypeSet since 2022-08-18 #54653
Comments
The first failure in the logs appears to have been at CL 422235 (attn @mdempsky), although it's not obvious to me whether that was the change that triggered the race. (The dashboard appears to be missing |
I suspect the issue is the unified importer isn't calling Interface.Complete. |
Change https://go.dev/cl/425360 mentions this issue: |
Change https://go.dev/cl/425362 mentions this issue: |
To support concurrent use of the go/types API, importers need to call Interface.Complete on constructed interfaces before returning. There's an issue that the interfaces may contain embedded defined types, whose underlying type isn't known yet. This issue will eventually go away once CL 424876 lands, but that CL needs to wait for CL 424854 to re-land, which needs to wait for CL 421879 to land... In the mean time, this CL implements the same solution used by the indexed importer: maintaining a list of constructed interfaces, and calling Interface.Complete on them after the SetUnderlying loop and just before returning the imported package. Updates #54653. Change-Id: I0f42c915a4b7d28c628bbab7ac2eab2415c7858f Reviewed-on: https://go-review.googlesource.com/c/go/+/425360 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Change https://go.dev/cl/425365 mentions this issue: |
For "type T interface{ M() }", go/types users expect T's underlying interface type to specify T as the receiver parameter type (#49906). The unified importer handles this by cloning the interface to rewrite the receiver parameters before calling SetUnderlying. I missed in CL 425360 that these interfaces would need to have Complete called too. Manually tested to confirm that this actually fixes "go test -race golang.org/x/tools/go/analysis/internal/checker" now (when both CLs are ported to the x/tools importer). Updates #54653. Change-Id: I51e6db925db56947cd39dbe880230f14734ca01c Reviewed-on: https://go-review.googlesource.com/c/go/+/425365 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
To support concurrent use of the go/types API, importers need to call Interface.Complete on constructed interfaces before returning. There's an issue that the interfaces may contain embedded defined types, whose underlying type isn't known yet. This issue will eventually go away once CL 424876 lands, but that CL needs to wait for CL 424854 to re-land, which needs to wait for CL 421879 to land... In the mean time, this CL implements the same solution used by the indexed importer: maintaining a list of constructed interfaces, and calling Interface.Complete on them after the SetUnderlying loop and just before returning the imported package. Updates golang#54653. Change-Id: I0f42c915a4b7d28c628bbab7ac2eab2415c7858f Reviewed-on: https://go-review.googlesource.com/c/go/+/425360 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
For "type T interface{ M() }", go/types users expect T's underlying interface type to specify T as the receiver parameter type (golang#49906). The unified importer handles this by cloning the interface to rewrite the receiver parameters before calling SetUnderlying. I missed in CL 425360 that these interfaces would need to have Complete called too. Manually tested to confirm that this actually fixes "go test -race golang.org/x/tools/go/analysis/internal/checker" now (when both CLs are ported to the x/tools importer). Updates golang#54653. Change-Id: I51e6db925db56947cd39dbe880230f14734ca01c Reviewed-on: https://go-review.googlesource.com/c/go/+/425365 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
https://build.golang.org/log/9184c4923ea696b86ecb0f0889fe952915f63b9f:
greplogs -l -e 'Previous write at .* by goroutine \d+:\n\s+go/types\.computeInterfaceTypeSet\(\)' --since=2022-07-01 --details
2022-08-24T16:06:46-587a153-2fc21b5/freebsd-amd64-race
2022-08-24T16:06:46-587a153-2fc21b5/linux-amd64-race
2022-08-24T16:06:46-587a153-2fc21b5/windows-amd64-newcc-race
2022-08-24T16:06:46-587a153-2fc21b5/windows-amd64-race
2022-08-24T16:00:07-587a153-3083529/freebsd-amd64-race
2022-08-24T16:00:07-587a153-3083529/linux-amd64-race
2022-08-24T16:00:07-587a153-3083529/windows-amd64-newcc-race
2022-08-24T16:00:07-587a153-3083529/windows-amd64-race
2022-08-24T15:37:38-587a153-d5aa088/freebsd-amd64-race
2022-08-24T15:37:38-587a153-d5aa088/linux-amd64-race
2022-08-24T15:37:38-587a153-d5aa088/windows-amd64-newcc-race
2022-08-24T15:37:38-587a153-d5aa088/windows-amd64-race
2022-08-24T14:31:08-587a153-f983a93/freebsd-amd64-race
2022-08-24T14:31:08-587a153-f983a93/linux-amd64-race
2022-08-24T14:31:08-587a153-f983a93/windows-amd64-newcc-race
2022-08-24T14:31:08-587a153-f983a93/windows-amd64-race
2022-08-24T12:12:12-587a153-b5a9459/freebsd-amd64-race
2022-08-24T12:12:12-587a153-b5a9459/linux-amd64-race
2022-08-24T12:12:12-587a153-b5a9459/windows-amd64-newcc-race
2022-08-24T12:12:12-587a153-b5a9459/windows-amd64-race
2022-08-24T08:17:52-587a153-1ab6b79/freebsd-amd64-race
2022-08-24T08:17:52-587a153-1ab6b79/linux-amd64-race
2022-08-24T08:17:52-587a153-1ab6b79/windows-amd64-newcc-race
2022-08-24T08:17:52-587a153-1ab6b79/windows-amd64-race
2022-08-24T05:40:28-587a153-1a8dfad/freebsd-amd64-race
2022-08-24T05:40:28-587a153-1a8dfad/linux-amd64-race
2022-08-24T05:40:28-587a153-1a8dfad/windows-amd64-newcc-race
2022-08-24T05:40:28-587a153-1a8dfad/windows-amd64-race
2022-08-24T02:54:32-587a153-75cdd2c/freebsd-amd64-race
2022-08-24T02:54:32-587a153-75cdd2c/linux-amd64-race
2022-08-24T02:54:32-587a153-75cdd2c/windows-amd64-newcc-race
2022-08-24T02:54:32-587a153-75cdd2c/windows-amd64-race
2022-08-24T02:23:58-587a153-7ee220c/freebsd-amd64-race
2022-08-24T02:23:58-587a153-7ee220c/linux-amd64-race
2022-08-24T02:23:58-587a153-7ee220c/windows-amd64-newcc-race
2022-08-24T02:23:58-587a153-7ee220c/windows-amd64-race
2022-08-23T23:17:55-587a153-1dcef7b/freebsd-amd64-race
2022-08-23T23:17:55-587a153-1dcef7b/linux-amd64-race
2022-08-23T23:17:55-587a153-1dcef7b/windows-amd64-newcc-race
2022-08-23T23:17:55-587a153-1dcef7b/windows-amd64-race
2022-08-23T23:11:53-587a153-aa42997/freebsd-amd64-race
2022-08-23T23:11:53-587a153-aa42997/linux-amd64-race
2022-08-23T23:11:53-587a153-aa42997/windows-amd64-newcc-race
2022-08-23T23:11:53-587a153-aa42997/windows-amd64-race
2022-08-23T22:44:18-587a153-ab8a2c5/freebsd-amd64-race
2022-08-23T22:44:18-587a153-ab8a2c5/linux-amd64-race
2022-08-23T22:44:18-587a153-ab8a2c5/windows-amd64-newcc-race
2022-08-23T22:44:18-587a153-ab8a2c5/windows-amd64-race
2022-08-23T22:01:05-587a153-0765da5/freebsd-amd64-race
2022-08-23T22:01:05-587a153-0765da5/linux-amd64-race
2022-08-23T22:01:05-587a153-0765da5/windows-amd64-newcc-race
2022-08-23T22:01:05-587a153-0765da5/windows-amd64-race
2022-08-23T21:24:14-587a153-60ad3c4/freebsd-amd64-race
2022-08-23T21:24:14-587a153-60ad3c4/linux-amd64-race
2022-08-23T21:24:14-587a153-60ad3c4/windows-amd64-newcc-race
2022-08-23T21:24:14-587a153-60ad3c4/windows-amd64-race
2022-08-23T21:04:06-587a153-790d605/freebsd-amd64-race
2022-08-23T21:04:06-587a153-790d605/linux-amd64-race
2022-08-23T21:04:06-587a153-790d605/windows-amd64-newcc-race
2022-08-23T21:04:06-587a153-790d605/windows-amd64-race
2022-08-22T15:51:31-587a153-b4c124a/freebsd-amd64-race
2022-08-22T15:51:31-587a153-b4c124a/linux-amd64-race
2022-08-22T15:51:31-587a153-b4c124a/windows-amd64-newcc-race
2022-08-22T15:51:31-587a153-b4c124a/windows-amd64-race
2022-08-22T15:41:53-587a153-db3e915/freebsd-amd64-race
2022-08-22T15:41:53-587a153-db3e915/windows-amd64-newcc-race
2022-08-22T15:41:53-587a153-db3e915/windows-amd64-race
2022-08-22T15:36:25-587a153-bdecfcb/freebsd-amd64-race
2022-08-22T15:36:25-587a153-bdecfcb/linux-amd64-race
2022-08-22T15:36:25-587a153-bdecfcb/windows-amd64-newcc-race
2022-08-22T15:36:25-587a153-bdecfcb/windows-amd64-race
2022-08-22T15:01:45-587a153-fc34fdb/freebsd-amd64-race
2022-08-22T15:01:45-587a153-fc34fdb/linux-amd64-race
2022-08-22T15:01:45-587a153-fc34fdb/windows-amd64-newcc-race
2022-08-22T15:01:45-587a153-fc34fdb/windows-amd64-race
2022-08-22T14:48:53-587a153-6bdca82/freebsd-amd64-race
2022-08-22T14:48:53-587a153-6bdca82/linux-amd64-race
2022-08-22T14:48:53-587a153-6bdca82/windows-amd64-newcc-race
2022-08-22T14:48:53-587a153-6bdca82/windows-amd64-race
2022-08-22T11:49:45-587a153-761db3e/freebsd-amd64-race
2022-08-22T11:49:45-587a153-761db3e/linux-amd64-race
2022-08-22T11:49:45-587a153-761db3e/windows-amd64-newcc-race
2022-08-22T11:49:45-587a153-761db3e/windows-amd64-race
2022-08-22T11:46:15-587a153-9a9aad4/freebsd-amd64-race
2022-08-22T11:46:15-587a153-9a9aad4/linux-amd64-race
2022-08-22T11:46:15-587a153-9a9aad4/windows-amd64-newcc-race
2022-08-22T11:46:15-587a153-9a9aad4/windows-amd64-race
2022-08-20T00:56:30-587a153-8d57f4d/freebsd-amd64-race
2022-08-20T00:56:30-587a153-8d57f4d/linux-amd64-race
2022-08-20T00:56:30-587a153-8d57f4d/windows-amd64-newcc-race
2022-08-20T00:56:30-587a153-8d57f4d/windows-amd64-race
2022-08-20T00:18:04-587a153-28afa5b/freebsd-amd64-race
2022-08-20T00:18:04-587a153-28afa5b/linux-amd64-race
2022-08-20T00:18:04-587a153-28afa5b/windows-amd64-newcc-race
2022-08-20T00:18:04-587a153-28afa5b/windows-amd64-race
2022-08-19T23:07:11-587a153-d05ce23/freebsd-amd64-race
2022-08-19T23:07:11-587a153-d05ce23/linux-amd64-race
2022-08-19T23:07:11-587a153-d05ce23/windows-amd64-newcc-race
2022-08-19T23:07:11-587a153-d05ce23/windows-amd64-race
2022-08-19T21:29:19-587a153-f3563bc/freebsd-amd64-race
2022-08-19T21:29:19-587a153-f3563bc/linux-amd64-race
2022-08-19T21:29:19-587a153-f3563bc/windows-amd64-newcc-race
2022-08-19T21:29:19-587a153-f3563bc/windows-amd64-race
2022-08-19T20:56:43-587a153-5f0170f/freebsd-amd64-race
2022-08-19T20:56:43-587a153-5f0170f/linux-amd64-race
2022-08-19T20:56:43-587a153-5f0170f/windows-amd64-newcc-race
2022-08-19T20:56:43-587a153-5f0170f/windows-amd64-race
2022-08-19T20:04:40-587a153-2e06019/freebsd-amd64-race
2022-08-19T20:04:40-587a153-2e06019/linux-amd64-race
2022-08-19T20:04:40-587a153-2e06019/windows-amd64-newcc-race
2022-08-19T20:04:40-587a153-2e06019/windows-amd64-race
2022-08-19T19:39:53-587a153-dbc3b44/freebsd-amd64-race
2022-08-19T19:39:53-587a153-dbc3b44/linux-amd64-race
2022-08-19T19:39:53-587a153-dbc3b44/windows-amd64-newcc-race
2022-08-19T19:39:53-587a153-dbc3b44/windows-amd64-race
2022-08-19T19:35:55-587a153-bc69ad3/freebsd-amd64-race
2022-08-19T19:35:55-587a153-bc69ad3/linux-amd64-race
2022-08-19T19:35:55-587a153-bc69ad3/windows-amd64-newcc-race
2022-08-19T19:35:55-587a153-bc69ad3/windows-amd64-race
2022-08-19T18:39:56-587a153-bf4e35b/freebsd-amd64-race
2022-08-19T18:39:56-587a153-bf4e35b/linux-amd64-race
2022-08-19T18:39:56-587a153-bf4e35b/windows-amd64-newcc-race
2022-08-19T18:39:56-587a153-bf4e35b/windows-amd64-race
2022-08-19T18:26:38-587a153-a73808e/freebsd-amd64-race
2022-08-19T18:26:38-587a153-a73808e/linux-amd64-race
2022-08-19T18:26:38-587a153-a73808e/windows-amd64-newcc-race
2022-08-19T18:26:38-587a153-a73808e/windows-amd64-race
2022-08-19T17:47:49-e55fb40-a73808e/freebsd-amd64-race
2022-08-19T17:47:49-e55fb40-a73808e/linux-amd64-race
2022-08-19T17:47:49-e55fb40-a73808e/windows-amd64-newcc-race
2022-08-19T17:47:49-e55fb40-a73808e/windows-amd64-race
2022-08-19T17:28:00-e55fb40-0a1da09/freebsd-amd64-race
2022-08-19T17:28:00-e55fb40-0a1da09/linux-amd64-race
2022-08-19T17:28:00-e55fb40-0a1da09/windows-amd64-newcc-race
2022-08-19T17:28:00-e55fb40-0a1da09/windows-amd64-race
2022-08-19T17:03:55-e55fb40-dc8e2a6/freebsd-amd64-race
2022-08-19T17:03:55-e55fb40-dc8e2a6/linux-amd64-race
2022-08-19T17:03:55-e55fb40-dc8e2a6/windows-amd64-newcc-race
2022-08-19T17:03:55-e55fb40-dc8e2a6/windows-amd64-race
2022-08-19T16:55:03-e55fb40-7dad1d2/freebsd-amd64-race
2022-08-19T16:55:03-e55fb40-7dad1d2/linux-amd64-race
2022-08-19T16:55:03-e55fb40-7dad1d2/windows-amd64-newcc-race
2022-08-19T16:55:03-e55fb40-7dad1d2/windows-amd64-race
2022-08-19T16:45:08-e55fb40-48297f1/freebsd-amd64-race
2022-08-19T16:45:08-e55fb40-48297f1/linux-amd64-race
2022-08-19T16:33:22-e55fb40-f65ded5/freebsd-amd64-race
2022-08-19T16:33:22-e55fb40-f65ded5/linux-amd64-race
2022-08-19T16:33:22-e55fb40-f65ded5/windows-amd64-newcc-race
2022-08-19T16:33:22-e55fb40-f65ded5/windows-amd64-race
2022-08-19T16:27:36-e55fb40-fe196a0/linux-amd64-race
2022-08-19T16:27:36-e55fb40-fe196a0/windows-amd64-newcc-race
2022-08-19T16:27:36-e55fb40-fe196a0/windows-amd64-race
2022-08-19T16:17:50-e55fb40-5729419/freebsd-amd64-race
2022-08-19T16:17:50-e55fb40-5729419/linux-amd64-race
2022-08-19T16:17:50-e55fb40-5729419/windows-amd64-newcc-race
2022-08-19T16:17:50-e55fb40-5729419/windows-amd64-race
2022-08-19T16:12:50-e55fb40-3204e62/linux-amd64-race
2022-08-19T16:12:50-e55fb40-3204e62/windows-amd64-newcc-race
2022-08-19T16:12:50-e55fb40-3204e62/windows-amd64-race
2022-08-19T16:04:12-e55fb40-f15761b/freebsd-amd64-race
2022-08-19T16:04:12-e55fb40-f15761b/linux-amd64-race
2022-08-19T16:04:12-e55fb40-f15761b/windows-amd64-newcc-race
2022-08-19T16:04:12-e55fb40-f15761b/windows-amd64-race
2022-08-19T15:53:47-e55fb40-f324355/freebsd-amd64-race
2022-08-19T15:53:47-e55fb40-f324355/linux-amd64-race
2022-08-19T15:53:47-e55fb40-f324355/windows-amd64-newcc-race
2022-08-19T15:53:47-e55fb40-f324355/windows-amd64-race
2022-08-19T03:32:27-e55fb40-6001c04/freebsd-amd64-race
2022-08-19T03:32:27-e55fb40-6001c04/linux-amd64-race
2022-08-19T03:32:27-e55fb40-6001c04/windows-amd64-newcc-race
2022-08-19T03:32:27-e55fb40-6001c04/windows-amd64-race
2022-08-19T03:09:05-e55fb40-a409356/freebsd-amd64-race
2022-08-19T03:09:05-e55fb40-a409356/linux-amd64-race
2022-08-19T03:09:05-e55fb40-a409356/windows-amd64-newcc-race
2022-08-19T03:09:05-e55fb40-a409356/windows-amd64-race
2022-08-19T03:01:14-e55fb40-55ecc3a/freebsd-amd64-race
2022-08-19T03:01:14-e55fb40-55ecc3a/linux-amd64-race
2022-08-19T03:01:14-e55fb40-55ecc3a/windows-amd64-newcc-race
2022-08-19T03:01:14-e55fb40-55ecc3a/windows-amd64-race
2022-08-19T01:34:22-e55fb40-ee833ed/freebsd-amd64-race
2022-08-19T01:34:22-e55fb40-ee833ed/linux-amd64-race
2022-08-19T01:34:22-e55fb40-ee833ed/windows-amd64-newcc-race
2022-08-19T01:34:22-e55fb40-ee833ed/windows-amd64-race
2022-08-19T00:29:18-e55fb40-a719a78/freebsd-amd64-race
2022-08-19T00:29:18-e55fb40-a719a78/linux-amd64-race
2022-08-19T00:29:18-e55fb40-a719a78/windows-amd64-newcc-race
2022-08-19T00:29:18-e55fb40-a719a78/windows-amd64-race
2022-08-18T22:53:59-e55fb40-833367e/freebsd-amd64-race
2022-08-18T22:53:59-e55fb40-833367e/linux-amd64-race
2022-08-18T22:53:59-e55fb40-833367e/windows-amd64-newcc-race
2022-08-18T22:53:59-e55fb40-833367e/windows-amd64-race
(191 matching logs)
The text was updated successfully, but these errors were encountered: