|
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 issue 7244.
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+135 lines, -20 lines) |
Patch |
 |
M |
include/link.h
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
src/cmd/5g/gsubr.c
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/6g/gsubr.c
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/8g/gsubr.c
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/closure.c
|
View
|
1
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/go.h
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/pgen.c
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/ld/textflag.h
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/liblink/obj5.c
|
View
|
1
|
5 chunks |
+8 lines, -6 lines |
0 comments
|
Download
|
 |
M |
src/liblink/obj6.c
|
View
|
1
|
7 chunks |
+18 lines, -8 lines |
0 comments
|
Download
|
 |
M |
src/liblink/obj8.c
|
View
|
1
|
5 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/asm_386.s
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/asm_amd64.s
|
View
|
1
|
1 chunk |
+40 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/asm_amd64p32.s
|
View
|
1
|
1 chunk |
+40 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/asm_arm.s
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
Total messages: 8
|