With concurrent sweeping finc if modified by runfinq and queuefinalizer concurrently.
Fixes crashes like this one:
http://build.golang.org/log/
6ad7b59ef2e93e3c9347eabfb4c4bd66df58fd5a
Fixes #7324.
Update #7396
LGTM=rsc
R=golang-codereviews, minux.ma, rsc
CC=golang-codereviews, khr
https://golang.org/cl/
67980043
if(framecap < framesz) {
runtime·free(frame);
// The frame does not contain pointers interesting for GC,
- // all not yet finalized objects are stored in finc.
+ // all not yet finalized objects are stored in finq.
// If we do not mark it as FlagNoScan,
// the last finalized object is not collected.
frame = runtime·mallocgc(framesz, 0, FlagNoScan|FlagNoInvokeGC);
f->ot = nil;
}
fb->cnt = 0;
+ runtime·lock(&gclock);
fb->next = finc;
finc = fb;
+ runtime·unlock(&gclock);
}
runtime·gc(1); // trigger another gc to clean up the finalized objects, if possible
}