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

Issue 996923003: Dart: Better handle leak checks. close() is async. (Closed)

Created:
5 years, 9 months ago by zra
Modified:
5 years, 9 months ago
Reviewers:
jamesr, Elliot Glaysher, sky
CC:
mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, Cutch, koda
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Dart: Better handle leak checks. close() is async. This change adds tracking of MojoHandle creation and closing in Debug mode, and makes it possible to emit a log of leaked handles on Mojo app shutdown. If any handles are leaked, causing the finalizer to need to close a handle, an error message is emitted with LOG(ERROR). All of the handles created by an isolate are also closed on an unhandled exception. This should prevent hangs. To aid tracking handles, close() now returns a Future in most cases. This is because a call to close() will generally send a command to the handle watcher, and so the actual close() of the underlying handle happens asynchronously. In particular when the future for a call to close() on an Application resolves, we should be able to do: assert(MojoHandle.reportLeakedHandles()); This change also fixes analyzer warnings and removes the special case to ignore warnings from the analyzer's wrapper script. BUG= R=erg@chromium.org, sky@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/b7959afdc4fa4acb65c67cafa6985394633138c8

Patch Set 1 #

Patch Set 2 : #

Total comments: 3

Patch Set 3 : Fix regexes #

Total comments: 13

Patch Set 4 : #

Patch Set 5 : Merge #

Patch Set 6 : Fix ASAN failure #

Total comments: 1

Patch Set 7 : Merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -309 lines) Patch
M examples/dart/console_example/main.dart View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M examples/dart/hello_world/hello/main.dart View 1 2 3 4 5 6 2 chunks +7 lines, -1 line 0 comments Download
M examples/dart/hello_world/world/main.dart View 1 2 3 4 5 6 2 chunks +7 lines, -1 line 0 comments Download
M examples/dart/wget/main.dart View 1 2 3 4 5 6 1 chunk +4 lines, -3 lines 0 comments Download
M mojo/dart/apptest/apptest/apptest.dart View 1 2 3 4 5 6 2 chunks +8 lines, -3 lines 0 comments Download
M mojo/dart/embedder/dart_controller.cc View 1 2 3 4 5 6 2 chunks +8 lines, -0 lines 0 comments Download
M mojo/dart/embedder/isolate_data.h View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M mojo/dart/embedder/mojo_natives.cc View 1 2 3 4 5 6 5 chunks +28 lines, -5 lines 0 comments Download
M mojo/dart/embedder/test/run_dart_tests.cc View 1 2 3 4 5 2 chunks +4 lines, -4 lines 0 comments Download
M mojo/dart/embedder/test/validation_unittest.cc View 1 2 3 4 5 1 chunk +7 lines, -9 lines 0 comments Download
M mojo/dart/test/bindings_generation_test.dart View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download
D mojo/dart/test/interface_test.dart View 1 2 3 4 5 6 1 chunk +0 lines, -195 lines 0 comments Download
M mojo/dart/test/validation_test.dart View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/dart/src/application.dart View 3 chunks +13 lines, -6 lines 0 comments Download
M mojo/public/dart/src/application_connection.dart View 2 chunks +14 lines, -6 lines 0 comments Download
M mojo/public/dart/src/codec.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/dart/src/event_stream.dart View 4 chunks +39 lines, -16 lines 0 comments Download
M mojo/public/dart/src/handle.dart View 1 2 3 4 3 chunks +69 lines, -12 lines 0 comments Download
M mojo/public/dart/src/handle_watcher.dart View 10 chunks +48 lines, -32 lines 0 comments Download
M mojo/public/dart/src/stub.dart View 5 chunks +9 lines, -2 lines 0 comments Download
M mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl View 1 chunk +1 line, -1 line 0 comments Download
M services/dart/dart_apptests/main.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M services/dart/test/echo/main.dart View 1 2 3 4 5 6 2 chunks +5 lines, -2 lines 0 comments Download
M services/dart/test/pingpong/main.dart View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M services/dart/test/pingpong_target/main.dart View 1 2 3 4 5 6 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 17 (2 generated)
zra
https://codereview.chromium.org/996923003/diff/20001/mojo/dart/embedder/test/run_dart_tests.cc File mojo/dart/embedder/test/run_dart_tests.cc (left): https://codereview.chromium.org/996923003/diff/20001/mojo/dart/embedder/test/run_dart_tests.cc#oldcode124 mojo/dart/embedder/test/run_dart_tests.cc:124: TEST(DartTest, interface_test) { This test doesn't make sense anymore ...
5 years, 9 months ago (2015-03-10 20:59:45 UTC) #2
zra
+johnmccutchan
5 years, 9 months ago (2015-03-10 21:00:15 UTC) #3
Elliot Glaysher
lgtm (I was JUST about to send out https://codereview.chromium.org/998693004/ , which is a subset of ...
5 years, 9 months ago (2015-03-10 21:11:02 UTC) #4
zra
Thanks! https://codereview.chromium.org/996923003/diff/20001/mojo/public/tools/dart_analyze.py File mojo/public/tools/dart_analyze.py (right): https://codereview.chromium.org/996923003/diff/20001/mojo/public/tools/dart_analyze.py#newcode24 mojo/public/tools/dart_analyze.py:24: r'^[0-9]+ errors( and [0-9]+ warnings)* found.') On 2015/03/10 ...
5 years, 9 months ago (2015-03-10 21:28:38 UTC) #5
sky
Is there a reason close needs to be async? It's sync on the C++ side ...
5 years, 9 months ago (2015-03-10 21:44:56 UTC) #6
zra
On 2015/03/10 21:44:56, sky wrote: > Is there a reason close needs to be async? ...
5 years, 9 months ago (2015-03-10 23:12:16 UTC) #7
sky
On 2015/03/10 23:12:16, zra wrote: > On 2015/03/10 21:44:56, sky wrote: > > Is there ...
5 years, 9 months ago (2015-03-11 16:04:46 UTC) #8
zra
On 2015/03/11 16:04:46, sky wrote: > What do you mean by response messages? The stuff ...
5 years, 9 months ago (2015-03-11 16:13:58 UTC) #9
sky
https://codereview.chromium.org/996923003/diff/40001/mojo/dart/embedder/isolate_data.h File mojo/dart/embedder/isolate_data.h (left): https://codereview.chromium.org/996923003/diff/40001/mojo/dart/embedder/isolate_data.h#oldcode9 mojo/dart/embedder/isolate_data.h:9: #include <string.h> AFAIK if you use std::string then you ...
5 years, 9 months ago (2015-03-11 17:17:57 UTC) #10
zra
https://codereview.chromium.org/996923003/diff/40001/mojo/dart/embedder/isolate_data.h File mojo/dart/embedder/isolate_data.h (left): https://codereview.chromium.org/996923003/diff/40001/mojo/dart/embedder/isolate_data.h#oldcode9 mojo/dart/embedder/isolate_data.h:9: #include <string.h> On 2015/03/11 17:17:57, sky wrote: > AFAIK ...
5 years, 9 months ago (2015-03-11 18:58:20 UTC) #11
sky
LGTM https://codereview.chromium.org/996923003/diff/40001/mojo/public/dart/src/handle.dart File mojo/public/dart/src/handle.dart (right): https://codereview.chromium.org/996923003/diff/40001/mojo/public/dart/src/handle.dart#newcode115 mojo/public/dart/src/handle.dart:115: return true; On 2015/03/11 18:58:20, zra wrote: > ...
5 years, 9 months ago (2015-03-11 19:17:24 UTC) #12
zra
+jamesr The ASAN try bot is failing on dart unit tests. I have been unable ...
5 years, 9 months ago (2015-03-11 20:55:54 UTC) #14
jamesr
How much memory does this test consume on your machine? I'm not sure off the ...
5 years, 9 months ago (2015-03-11 21:28:52 UTC) #15
zra
https://codereview.chromium.org/996923003/diff/100001/mojo/public/dart/src/handle.dart File mojo/public/dart/src/handle.dart (right): https://codereview.chromium.org/996923003/diff/100001/mojo/public/dart/src/handle.dart#newcode108 mojo/public/dart/src/handle.dart:108: assert(false); I narrowed the problem down to here. Dart ...
5 years, 9 months ago (2015-03-11 23:04:38 UTC) #16
zra
5 years, 9 months ago (2015-03-12 16:18:26 UTC) #17
Message was sent while issue was closed.
Committed patchset #7 (id:120001) manually as
b7959afdc4fa4acb65c67cafa6985394633138c8 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698