diff options
author | Hans Boehm <hboehm@google.com> | 2018-01-23 11:05:38 -0800 |
---|---|---|
committer | Hans Boehm <hboehm@google.com> | 2018-01-31 10:24:59 -0800 |
commit | 00846d8293d2efd1d339ca6b99fd5a2d08d8c058 (patch) | |
tree | f80d7750037d2bebe3e71cb48eef83f5b98ed11b /annotations/generate_annotated_java_files.py | |
parent | 7fb5183a51cac4eec6ec7ec6f4a7aa561ab86c3f (diff) |
Have CloseGuard report by default
"Enabling" CloseGuards now controls capture of the initial stack
trace, tracking, and routing of messages to the reporter. We now
log a warning for leaked objects, even if CloseGuard is disabled.
Since creation of a CloseGuard always allocates a finalizable
object, we were paying most of the cost of checking anyway, but
throwing away the benefit. The messages generated by default are
not currently easily actionable, but do indicate a problem. And they
can be made more actionable by passing a more informative "closer"
string or by enabling CloseGuard stack capture.
Always-on reporting is highly desirable since warnIfOpen() calls
are commonly combined with close() calls in the same finalizer.
Typically, this is 100% safe in the presence of dead reference
elimination by the compiler only if there is an explicit close()
call. Otherwise CloseGuard finalization may, with very unlikely
scheduling, be invoked while another method on the object is still
running. In the unlikely case this happens, we really want a
record of it in the log.
Make Tracker semantics consistent, instead of conditionally invoking
it on open and unconditionally on close.
Fix all-caps non-constants.
Fix CloseGuardTest to reflect the new expectations.
This was split off from go/aog/554024.
Bug: 70906684
Test: Build and boot AOSP.
cts-tradefed run singleCommand cts -m CtsLibcoreTestCases -t libcore.dalvik.system.CloseGuardTest
cts-tradefed run singleCommand cts -m CtsLibcoreTestCases -t libcore.dalvik.system.CloseGuardSupportTest
Change-Id: I8a1cfeac963cb5f51fdd27fdf1eb9c0beb309aa4
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions