mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/ld: clear unused ctxt before morestack
For non-closure functions, the context register is uninitialized on entry and will not be used, but morestack saves it and then the garbage collector treats it as live. This can be a source of memory leaks if the context register points at otherwise dead memory. Avoid this by introducing a parallel set of morestack functions that clear the context register, and use those for the non-closure functions. I hope this will help with some of the finalizer flakiness, but it probably won't. Fixes #7244. LGTM=dvyukov R=khr, dvyukov CC=golang-codereviews https://golang.org/cl/71030044
This commit is contained in:
parent
542415c9df
commit
c2dd33a46f
15 changed files with 135 additions and 20 deletions
|
|
@ -356,7 +356,7 @@ struct Link
|
|||
LSym* sym_divu;
|
||||
LSym* sym_mod;
|
||||
LSym* sym_modu;
|
||||
LSym* symmorestack[10];
|
||||
LSym* symmorestack[20];
|
||||
LSym* gmsym;
|
||||
LSym* plan9tos;
|
||||
Prog* curp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue