[go/release-branch.go1.26] [release-branch.go1.26] internal/poll: move rsan to heap on windows

0 views
Skip to first unread message

Carlos Amedee (Gerrit)

unread,
12:45 PM (7 hours ago) 12:45 PM
to Ian Chen, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Cherry Mui, Mark Freeman, Go LUCI, Quim Muntal, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com

Carlos Amedee submitted the change

Change information

Commit message:
[release-branch.go1.26] internal/poll: move rsan to heap on windows

According to https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsarecvfrom,
the memory pointed to by lpFromlen must remain available during the
overlapped I/O, and therefore cannot be allocated on the stack.

CL 685417 moved the rsan field out of the operation struct and placed
it on stack, which violates the above requirement and causes stack
corruption.

Unfortunately, it is no longer possible to cleanly revert CL 685417.
Instead of attempting to revert it, this CL bundles rsan together
with rsa in the same sync.Pool. The new wsaRsa struct is still in the
same size class, so no additional overhead is introduced by this
change.

Fixes #78041.
Change-Id: I5ffbccb332515116ddc03fb7c40ffc9293cad2ab
Reviewed-by: Quim Muntal <quimm...@gmail.com>
Reviewed-by: Cherry Mui <cher...@google.com>
Commit-Queue: Cherry Mui <cher...@google.com>
Reviewed-by: Damien Neil <dn...@google.com>
Reviewed-by: Mark Freeman <markf...@google.com>
Files:
  • M src/internal/poll/fd_windows.go
Change size: M
Delta: 1 file changed, 59 insertions(+), 35 deletions(-)
Branch: refs/heads/release-branch.go1.26
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Cherry Mui, +2 by Quim Muntal, +1 by Mark Freeman
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: release-branch.go1.26
Gerrit-Change-Id: I5ffbccb332515116ddc03fb7c40ffc9293cad2ab
Gerrit-Change-Number: 753480
Gerrit-PatchSet: 2
Gerrit-Owner: Ian Chen <databa...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Quim Muntal <quimm...@gmail.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages