Skip to content
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

plugin: variable not initialized properly [1.21 backport] #62505

Closed
gopherbot opened this issue Sep 7, 2023 · 2 comments
Closed

plugin: variable not initialized properly [1.21 backport] #62505

gopherbot opened this issue Sep 7, 2023 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link

@cherrymui requested issue #62430 to be considered for backport to the next 1.21 minor release.

@gopherbot please backport this to Go 1.21. This is a regression that causes valid programs to run incorrectly.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Sep 7, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Sep 7, 2023
@gopherbot gopherbot added this to the Go1.21.2 milestone Sep 7, 2023
@gopherbot
Copy link
Author

Change https://go.dev/cl/526575 mentions this issue: cmd/link: avoid deadcode of global map vars for programs using plugins

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Sep 20, 2023
gopherbot pushed a commit that referenced this issue Sep 20, 2023
…or programs using plugins

If a program imports the plugin package, the mechanisms in place for
detecting and deleting unused global map variables are no longer safe,
since it's possibly for a given global map var to be unreferenced in
the main program but referenced by a plugin. This patch changes the
linker to test for plugin use and to avoid removing any unused global
map variables if the main program could possibly load up a plugin.

Fixes #62505.
Updates #62430.

Change-Id: Ie00b18b681cb0d259e3c859ac947ade5778cd6c8
(cherry picked from commit 660620d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/526575
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot
Copy link
Author

Closed by merging 556e9c3 to release-branch.go1.21.

bradfitz pushed a commit to tailscale/go that referenced this issue Sep 25, 2023
…or programs using plugins

If a program imports the plugin package, the mechanisms in place for
detecting and deleting unused global map variables are no longer safe,
since it's possibly for a given global map var to be unreferenced in
the main program but referenced by a plugin. This patch changes the
linker to test for plugin use and to avoid removing any unused global
map variables if the main program could possibly load up a plugin.

Fixes golang#62505.
Updates golang#62430.

Change-Id: Ie00b18b681cb0d259e3c859ac947ade5778cd6c8
(cherry picked from commit 660620d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/526575
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

3 participants
@dmitshur @gopherbot and others