Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Issue 2602263002: Lend LSan a hand and clear out singleton static persistents first. (Closed)

Created:
3 years, 11 months ago by sof
Modified:
3 years, 11 months ago
Reviewers:
oilpan-reviews, haraken
CC:
chromium-reviews, oilpan-reviews, Mads Ager (chromium), blink-reviews, kinuko+watch, kouhei+heap_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Lend LSan a hand and clear out singleton static persistents first. To prepare for LSan's determination of leaking objects, the main thread will GC its heap, finalizing objects with references to off-heap ones. This must also encompass heap objects that are held onto by static persistents, so we arrange for all of those singletons to be released. Releasing the static persistents leaves them in an invalid, null state, so any object that becomes garbage by the release of a static persistent must not attempt to access any of these singletons while being subsequently finalized. This is a restriction that's hard to work around should it turn out to strike, so instead the singletons are attempted cleared first. That will make the objects they retain eligible for garbage collection (and finalization) earlier, avoiding the problem of touching singletons backed by (now-released) persistent references. R= BUG=677684

Patch Set 1 #

Total comments: 2

Patch Set 2 : experiment: disable LSan-GCing during shutdown.. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -38 lines) Patch
M third_party/WebKit/Source/platform/heap/Persistent.h View 1 4 chunks +50 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/PersistentNode.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/PersistentNode.cpp View 1 chunk +17 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/ThreadState.h View 1 1 chunk +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/ThreadState.cpp View 1 2 chunks +12 lines, -19 lines 0 comments Download

Messages

Total messages: 12 (6 generated)
sof
please take a look. Somewhat of a blind fix, as I've not been able to ...
3 years, 11 months ago (2017-01-02 09:03:44 UTC) #4
haraken
https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp File third_party/WebKit/Source/platform/heap/ThreadState.cpp (right): https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp#newcode340 third_party/WebKit/Source/platform/heap/ThreadState.cpp:340: clearStaticPersistentNodes(); Hmm, I'm not quite sure if this helps. ...
3 years, 11 months ago (2017-01-02 09:26:44 UTC) #6
sof
https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp File third_party/WebKit/Source/platform/heap/ThreadState.cpp (right): https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp#newcode340 third_party/WebKit/Source/platform/heap/ThreadState.cpp:340: clearStaticPersistentNodes(); On 2017/01/02 09:26:44, haraken wrote: > > Hmm, ...
3 years, 11 months ago (2017-01-02 09:37:17 UTC) #7
haraken
On 2017/01/02 09:37:17, sof wrote: > https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp > File third_party/WebKit/Source/platform/heap/ThreadState.cpp (right): > > https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp#newcode340 > ...
3 years, 11 months ago (2017-01-02 10:44:58 UTC) #10
sof
On 2017/01/02 10:44:58, haraken wrote: > On 2017/01/02 09:37:17, sof wrote: > > > https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/platform/heap/ThreadState.cpp ...
3 years, 11 months ago (2017-01-02 13:34:19 UTC) #11
sof
3 years, 11 months ago (2017-01-04 08:52:28 UTC) #12
On 2017/01/02 13:34:19, sof wrote:
> On 2017/01/02 10:44:58, haraken wrote:
> > On 2017/01/02 09:37:17, sof wrote:
> > >
> >
>
https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/p...
> > > File third_party/WebKit/Source/platform/heap/ThreadState.cpp (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2602263002/diff/1/third_party/WebKit/Source/p...
> > > third_party/WebKit/Source/platform/heap/ThreadState.cpp:340:
> > > clearStaticPersistentNodes();
> > > On 2017/01/02 09:26:44, haraken wrote:
> > > > 
> > > > Hmm, I'm not quite sure if this helps.
> > > > 
> > > > In my understanding, LSan on a renderer process runs before
> blink::shutdown
> > > > getting called. See
> > > >
> > >
> >
>
https://cs.chromium.org/chromium/src/content/renderer/renderer_main.cc?sq=pac...
> > > > 
> > > > __lsan_do_leak_check() is called before RenderProcessImpl's object gets
> > > > destructed, in which blink::shutdown is called.
> > > > 
> > > 
> > > Hmm, that doesn't make a lot of sense, given the trouble that LSan has
given
> > us
> > > in the past by not clearing up and GCing first.
> > 
> > Yeah, I was thinking that LSan is running after blink::shutdown being
called.
> > However, while working on https://codereview.chromium.org/2309153002, I
> noticed
> > that that is not the case (at least in a normal renderer process; the
> situation
> > might be different in some tests).
> 
> Those explicit LSan leak checks have been there for some time, before we added
> the extra GCs on the Oilpan side.
> 
> We can try to take them out and see if anything breaks.

https://codereview.chromium.org/2604413002 appears to have settled in just fine;
good. Closing this.

Powered by Google App Engine
This is Rietveld 408576698