OSDN Git Service

Flush the CFG visualizer output after writing to it.
authorRoland Levillain <rpl@google.com>
Tue, 1 Nov 2016 14:48:47 +0000 (14:48 +0000)
committerRoland Levillain <rpl@google.com>
Tue, 1 Nov 2016 14:48:47 +0000 (14:48 +0000)
commitb0103ca545c285f07e30ba5fd1cc007332fef66b
treeb9adcb3e16c9e9bc2de17571b3f03b6fd583ca61
parentb9b8cab87a275fad382fefbddd18daf495a58772
Flush the CFG visualizer output after writing to it.

This fixes test failures exposed by the ART Buildbot in
608-checker-unresolved-lse (AOT) on the hammerhead-ndebug
configuration.  The test used to fail because the CFG file
dumped by second invocation of dex2oat on device would be
truncated (at the beginning of the disassembly section
of the second compiled Dex file's contents) because of
dex2oat's fast exit.

Interestingly enough, this is the only case where this
failure has been observed, which seems to be due to a
combination of:
- targeting (32-bit) ARM;
- using a secondary Dex file (used to create an unresolved
  access for that test);
- compiling that secondary Dex file with dex2oat (ndebug
  mode) instead of dex2oatd;
- supporting multithread CFG graph dumping (by having the
  write-to-file operation in a critical section) since
  https://android-review.googlesource.com/#/c/296224/.

Test: art/test/run-test -O --debuggable 608-checker-unresolved-lse
Change-Id: Ifc1a23a3708b8645fd36c148312074bb9fe00cfc
compiler/optimizing/optimizing_compiler.cc
test/etc/run-test-jar