summaryrefslogtreecommitdiff
path: root/patchoat
AgeCommit message (Collapse)Author
2018-10-02Remove patchoat.Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Bug: 77856493 Change-Id: I6686ce9d23e02aa8b8ef4081b302dbd860d07718
2018-09-18ART: Fix tidy warnings in patchoat (again)Andreas Gampe
Fix performance-faster-string-find warning. Bug: 32619234 Test: WITH_TIDY=1 mmma art/patchoat Change-Id: Ic8678d140cd8aa9b5c26bcbc48d3e4e326d4e56f
2018-09-07ART: Continue adding override annotationsAndreas Gampe
Use Clang-tidy's modernize-use-override to add more annotations. Ignore inferred annotations on destructors. Bug: 32619234 Test: mmma art Change-Id: Ic432c928e398d44df9171e42db04ee19946e6887
2018-09-06ART: Remove utils.h's ParseUint & ParseIntAndreas Gampe
Use the versions from libbase, instead. Removes a runtime-int warning. Bug: 32619234 Test: mmma art Change-Id: I5a9a9e2647b1d93eee6d9ea2bf37cc09390e8c16
2018-09-06ART: Fix tidy warning in patchoatAndreas Gampe
Fix performance-faster-string-find. Bug: 32619234 Test: mmma art Change-Id: I59c25232af69c66d5b94abc9dd5f53bfa82a36ba
2018-09-04Remove PIC option from oat files.Vladimir Marko
dex2oat has been producing only PIC code for some time, so there's no need to record it in the oat file anymore. Also get rid of the now unnecessary relocation logic that was using the flag. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Bug: 77856493 Change-Id: I070071ca5a808371f67883f4ae93d633a76231d0
2018-08-28Use 'final' and 'override' specifiers directly in ART.Roland Levillain
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
2018-08-21Remove unnecessary indirection from MemMap.Vladimir Marko
Avoid plain MemMap pointers being passed around by changing the MemMap to moveable and return MemMap objects by value. Previously we could have a valid zero-size MemMap but this is now forbidden. MemMap::RemapAtEnd() is changed to avoid the explicit call to munmap(); mmap() with MAP_FIXED automatically removes old mappings for overlapping regions. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Change-Id: I12bd453c26a396edc20eb141bfd4dad20923f170
2018-07-23Merge "Move .art.rel data to a section in .art, part 2."Vladimir Marko
2018-07-20Merge changes I87f2999f,I8af0e845Vladimir Marko
* changes: Remove ArtMethod's declaring class state checks. ObjPtr<>-ify ArtMethod and mirror::Method.
2018-07-20Move .art.rel data to a section in .art, part 2.Vladimir Marko
And change the encoding to reduce the size of the data. Keep the checksum in the .art.rel file, it shall be removed later together with patchoat. Boot image sizes for aosp_taimen-userdebug: - before: arm/boot*.art: 9216000 arm/boot*.art.rel: 700767 arm64/boot*.art: 11399168 arm64/boot*.art.rel: 700808 oat/arm64/services.art: 192512 - after: arm/boot*.art: 9499351 (+276.7KiB) arm/boot*.art.rel: 480 (-683.9KiB) arm64/boot*.art: 11750203 (+342.8KiB) arm64/boot*.art.rel: 480 (-683.9KiB) oat/arm64/services.art: 202466 (+9.7KiB) Note that the new section is currently uncompressed in the boot image but we have the ability to compress it in the future using the same compression as the heap data. The extra data we now encode in app images is unused so far but it shall permit fast in-memory patching without looking at object types. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 77856493 Change-Id: I20c9bed9797ce0f23f39c2fb0d64320b457e18d4
2018-07-19ObjPtr<>-ify ArtMethod and mirror::Method.Vladimir Marko
And clean up some forgotten things after old CLs. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I8af0e845c24d674d0efab21d80c29949b1cc0593
2018-07-19Move .art.rel data to a section in .art, part 1.Vladimir Marko
Refactor the code so that we can collect all relocation offsets while writing the image. Test: Manually verify that the aosp_taimen-userdebug boot image is identical before and after this change; using WIP follow-up code, check that we record the same locations as the patchoat-generated .rel files. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 77856493 Change-Id: Id8c78e417e77e859a82a680504253f41e84560d6
2018-07-03ART: Do not use std::<container>::at().Vladimir Marko
These functions are specified as throwing std::out_of_range and we do not use exceptions. Test: m Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I67c365ed6d779c101a18b9f386c751c48ca76e16
2018-06-11Merge "Revert^2 "Remove support for Valgrind in ART.""Roland Levillain
2018-06-11Revert^2 "Remove support for Valgrind in ART."Roland Levillain
- Disable test configuration art-gtest-valgrind64 (art-gtest-valgrind32 was already disabled). - Remove Makefile logic regarding testing with Valgrind. - Remove occurrences of `TEST_DISABLED_FOR_MEMORY_TOOL_VALGRIND`. - Replace occurrences of `TEST_DISABLED_FOR_MEMORY_TOOL_ASAN` with `TEST_DISABLED_FOR_MEMORY_TOOL`. - Replace the potentially dynamically evaluated `RUNNING_ON_MEMORY_TOOL` expression with constant `kRunningOnMemoryTool`. - Simplify and fold the logic of `art::ArenaAllocatorMemoryToolCheckImpl` and `art::ArenaAllocatorMemoryToolCheck` into `art::ArenaAllocatorMemoryTool`. - Adjust comments regarding memory tools. - Remove Valgrind suppression files. - Remove `--callgrind` option from tools/art. This reverts commit 8b362a87d52a6668ffd2283ef6ffc274315f41c8. Change-Id: I23c76845e6ccf766f19b22b58a0d5161f60842a9 Test: art/test.py Test: art/test/testrunner/run_build_test_target.py art-asan Bug: 77856586 Bug: 29282211
2018-06-06Merge "Fix patchoat_test for heap poisoning"Treehugger Robot
2018-06-06Fix patchoat_test for heap poisoningDavid Srbecky
The test was disabled for heap poisoning; keep it disabled. The TEST_DISABLED_FOR_HEAP_POISONING macro is in fact just a conditional return, and I didn't account for it properly. Bug: 109677607 Test: test-art-host-gtest-patchoat_test ART_HEAP_POISONING=true Change-Id: I40266d0a06102e4d8bc52357b884b0e7d9fd2630
2018-06-06Merge "Add check to CheckImageIdenticalToOriginalExceptForRelocation"Treehugger Robot
2018-06-06Add check to CheckImageIdenticalToOriginalExceptForRelocationDavid Srbecky
Add defensive check which fails gracefully if the relocation offset is larger than the image size. Add tests. Bug: 109677607 Test: test-art-host-gtest-patchoat_test SANITIZE_HOST=address Change-Id: Ic989d5b7c77fd66e77b9e8ba90df1bf490a46e43
2018-06-04Use pre-allocated Throwables from the boot image.Vladimir Marko
The pre-allocated OOMEs and NoClassDefFoundError were stored in the boot image but they were not used, we instead used to allocate and use new objects. This change adds references to the image roots, so that these Throwables can be used when starting the runtime using the boot image. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 77947463 Change-Id: I2079344dee61242bf0bef5c32770c33ac8a6b7a4
2018-05-25Remove static GcRoot<>s from Field, Method, Constructor.Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I648b88339995761fb81180286ef48a42bbd2f83d
2018-05-22Merge "Revert "Remove support for Valgrind in ART.""Treehugger Robot
2018-05-22Revert "Remove support for Valgrind in ART."Andreas Gampe
This reverts commit 8268cb677bd92bfbcfec7e803775c29687494e53. Reason for revert: ASAN failures Change-Id: I7e66d3f3fb461ae4f6dea6ec7d506b7dface3402 Test: SANITIZE_HOST=address m test-art-host Bug: 77856586 Bug: 29282211
2018-05-22Merge "Remove support for Valgrind in ART."Roland Levillain
2018-05-16Move ArtDexFileLoader to libdexfileDavid Sehr
Adds a dependency from libdexfile on libartbase, but allows the use of MemMap loaders, etc. Bug: 78652467 Test: make -j 40 checkbuild Change-Id: I15cf33893ca9192050762f8350a3cc1e39f88dc5
2018-05-14Remove support for Valgrind in ART.Roland Levillain
- Disable test configuration art-gtest-valgrind64 (art-gtest-valgrind32 was already disabled). - Remove Makefile logic regarding testing with Valgrind. - Remove occurrences of `TEST_DISABLED_FOR_MEMORY_TOOL_VALGRIND`. - Replace occurrences of `TEST_DISABLED_FOR_MEMORY_TOOL_ASAN` with `TEST_DISABLED_FOR_MEMORY_TOOL`. - Replace the potentially dynamically evaluated `RUNNING_ON_MEMORY_TOOL` expression with constant `kRunningOnMemoryTool`. - Simplify and fold the logic of `art::ArenaAllocatorMemoryToolCheckImpl` and `art::ArenaAllocatorMemoryToolCheck` into `art::ArenaAllocatorMemoryTool`. - Adjust comments regarding memory tools. - Remove Valgrind suppression files. - Remove `--callgrind` option from tools/art. Test: art/test.py Bug: 77856586 Bug: 29282211 Change-Id: Ifdcbfccc1830104c455760457df66ede4a4cd135
2018-05-11Prepare to move ArtDexFileLoader to libdexfileDavid Sehr
Move file_utils and friends to libartbase so that ArtDexFileLoader can be moved to libdexfile. This will clean up duplication and complexity with zip file handling. Bug: 78652467 Test: make -j 40 test-art-host-gtest Change-Id: Ia5eac1f93caf3fa918b4b48803cbfd842035e29e
2018-04-12Add extra output when patchoat_test fails.Vladimir Marko
Print up to 16 bytes of the data from the first difference. Test: m test-art-host-gtest-patchoat_test Bug: 70918261 Change-Id: Icd0247c3a745bfca0bc9745c8756452cd9b89feb
2018-04-06patchoat: Move nullptr CHECKGreg Kaiser
We now check 'out' for nullptr prior to dereferencing it. Test: Treehugger Change-Id: I4b0f871a24894107b895789a1b73b95847438dcc
2018-03-09ART: Make patchoat more resistantAndreas Gampe
Disable relocation, disallow dex-file fallback. These are unwelcome when patching. Refactor to have one set of options. Bug: 73887870 Test: m test-art-host Test: Flash-wipe device, boot Change-Id: Ic7698cb83d1a8b4bb318af472f388dc88981c49c
2018-03-05Move most of runtime/base to libartbase/baseDavid Sehr
Enforce the layering that code in runtime/base should not depend on runtime by separating it into libartbase. Some of the code in runtime/base depends on the Runtime class, so it cannot be moved yet. Also, some of the tests depend on CommonRuntimeTest, which itself needs to be factored (in a subsequent CL). Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
2018-02-28Header library to remove dependence on runtime/David Sehr
Add a new header library to remove libdexfile and others' dependence on runtime (typically runtime/base) includes in libdexfile. Also a small step to tease dexlayout and profman away from relying on these as well. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest Change-Id: I38e2fe399a75f4bc6318c77a71954c00ea73ec2b
2018-02-20patchoat: take directories instead of filenamesChris Morin
patchoat was already ignoring the basename part of the filename passed to it for both --output-image-file and --output-image-relocation-file. We can therefore just pass in the directories instead. Bug: 72828459 Test: make test-art-host-gtest-patchoat_test Change-Id: I1a699d1f6746f068078ae768d30690431578d84e
2018-02-16Have patchoat --verify verify symlinksChris Morin
patchoat --verify now verifies that the vdex and oat symlinks in /data/dalvik-cache point to the correct vdex and oat files in /system/. This is to protect attacks that would change the symlink targets. Refactoring of patchoat code was done too. Bug: 66697305 Test: make test-art-host-gtest-patchoat_test Test: remove a symlink and ensure patchoat verification fails Test: modify a symlink and ensure patchoat verification fails Change-Id: I18e8f9f6363cf18ad8fa879aeb4d8c7badf679a7
2018-01-26ART: patchoat compilation fix for mac sdkOrion Hodson
Updates format strings for int64_t value. Bug: 66697305 Test: m -j32 Change-Id: Icc460724264acacdbdadb691a17f187813877412
2018-01-25patchoat: add ability to verify relocated .art filesChris Morin
Patchoat can verify that a relocated .art file hasn't been modified after generation using the --verify flag. Test: adb shell /system/bin/patchoat --verify \ --input-image-location=/system/framework/boot.art \ --output-image-file=/data/dalvik-cache/arm64/system@framework@boot.art \ --instruction-set=arm64 Bug: 66697305 Change-Id: If6ea02a0527381c520078cd6f3ae2c275a8a8ab1
2018-01-18Reland: Enable patchoat to write image relocation filesAlex Klyubin
This adds an off by default feature to patchoat whereby it can write image relocation information (i.e., which offsets are patched up by patchoat) to .rel files. .rel file writing is enabled by specifying the name of boot.art.rel file using command-line parameter --output-image-relocation-file=... The currently intended use case is to make the Android build process store these files on the system image next to boot*.art files. At boot time, in follow-up commits, these .rel files will then be used to verify that all differences between /system boot*.art and /data/dalvik-cache boot*.art files can be explained by relocation. The goal is to mitigate /data/dalvik-cache boot*.art being a persistence vector. Test: ./art/test/testrunner/run_build_test_target.py art-gtest-debug-gc Test: make test-art-host-gtest-patchoat_test Test: ART_HEAP_POISONING=true make test-art-host-gtest-patchoat_test Test: make test-art-target-gtest-patchoat_test Test: ANDROID_ROOT=out/target/product/sailfish/system \ ANDROID_DATA=out/target/product/sailfish/dex_bootjars/system/framework/arm64/ \ out/host/linux-x86/bin/patchoat \ --input-image-location=<full path to>/out/target/product/sailfish/dex_bootjars/system/framework/boot.art \ --output-image-file=out/target/product/sailfish/dex_bootjars/system/framework/arm64/boot.art \ --instruction-set=arm64 --base-offset-delta=0x10000000 produces same boot*.art files as prior to this change Test: ANDROID_ROOT=out/target/product/sailfish/system \ ANDROID_DATA=out/target/product/sailfish/dex_bootjars/system/framework/arm64/ \ out/host/linux-x86/bin/patchoat \ --input-image-location=<full path to>/out/target/product/sailfish/dex_bootjars/system/framework/boot.art \ --output-image-relocation-file=out/target/product/sailfish/dex_bootjars/system/framework/arm64/boot.art.rel \ --instruction-set=arm64 --base-offset-delta=0x10000000 produces no boot*.art files, but produces expected boot.art.rel files Bug: 66697305 Change-Id: Ia6b548c61429c61a62706d4021f8e6f22c49082e
2018-01-11Revert "Enable patchoat to write image relocation files"Mathieu Chartier
This reverts commit fbe5f2f85244bf57707afb5520b2f9aa189d9d55. Test is failing very often on the buildbots. Bug: 66697305 Change-Id: I9be7471b1c988bdddeca732c39b9323125e4384d
2018-01-10Enable patchoat to write image relocation filesAlex Klyubin
This adds an off by default feature to patchoat whereby it can write image relocation information (i.e., which offsets are patched up by patchoat) to .rel files. .rel file writing is enabled by specifying the name of boot.art.rel file using command-line parameter --output-image-relocation-file=... The currently intended use case is to make the Android build process store these files on the system image next to boot*.art files. At boot time, in follow-up commits, these .rel files will then be used to verify that all differences between /system boot*.art and /data/dalvik-cache boot*.art files can be explained by relocation. The goal is to mitigate /data/dalvik-cache boot*.art being a persistence vector. Test: ./art/test/testrunner/run_build_test_target.py art-gtest-debug-gc Test: make test-art-host-gtest-patchoat_test Test: make test-art-target-gtest-patchoat_test Test: ANDROID_ROOT=out/target/product/sailfish/system \ ANDROID_DATA=out/target/product/sailfish/dex_bootjars/system/framework/arm64/ \ out/host/linux-x86/bin/patchoat \ --input-image-location=<full path to>/out/target/product/sailfish/dex_bootjars/system/framework/boot.art \ --output-image-file=out/target/product/sailfish/dex_bootjars/system/framework/arm64/boot.art \ --instruction-set=arm64 --base-offset-delta=0x10000000 produces same boot*.art files as prior to this change Test: ANDROID_ROOT=out/target/product/sailfish/system \ ANDROID_DATA=out/target/product/sailfish/dex_bootjars/system/framework/arm64/ \ out/host/linux-x86/bin/patchoat \ --input-image-location=<full path to>/out/target/product/sailfish/dex_bootjars/system/framework/boot.art \ --output-image-relocation-file=out/target/product/sailfish/dex_bootjars/system/framework/arm64/boot.art.rel \ --instruction-set=arm64 --base-offset-delta=0x10000000 produces no boot*.art files, but produces expected boot.art.rel files Bug: 66697305 Change-Id: If18814f03dba3d72ae15981625473f4da303b1d6
2017-12-19Test all .art files in patchoat testAlex Klyubin
This augments the patchoat test to check all .art files produced by dex2oat and patchoat, rather than just the main one -- boot.art. For context, the test currently produces two .art files: boot.art and boot-core-libart-hostdex.art. Test: ./art/test/testrunner/run_build_test_target.py art-gtest-debug-gc Test: make test-art-host-gtest-patchoat_test Test: make test-art-target-gtest-patchoat_test Bug: 66697305 Change-Id: I8a90e70811ac8b98a7c2de5bfe6a388ca884e259
2017-12-15Revert^4 "Add patchoat test"Alex Klyubin
This reverts commit 1fb8d5ee6c7f03269cf08b18a0af5b4e25924a27. Skip the patchoat test on the build server where the build is not using read barriers. Read barriers (or CMS/MS garbage collector) are required for the --force-determinism feature used by the test. Test: ./art/test/testrunner/run_build_test_target.py art-gtest-debug-gc Test: make test-art-host-gtest-patchoat_test Test: make test-art-target-gtest-patchoat_test Bug: 66697305 Change-Id: I99da0111ca0e34d32473dfe721b7a2f49289e850
2017-12-14Revert "Revert "Revert "Add patchoat test"""Alex Klyubin
This reverts commit 203010a86542b16991ede122085b07eea6c55bec. Reason for revert: This test is breaking on a build server -- no idea why as no output can be seen. Change-Id: Ibb93d84e673c45e13ba81b1f045eb7c8d31494fd
2017-12-13Revert "Revert "Add patchoat test""Alex Klyubin
This reverts commit 5dd08acd0b568bb05e2e75fc02d8a6d3d7aa6f8e. This attempt removes any remaining non-determinism, by passing in --force-determinism to dex2oat in the test. As a result, the test now passes both host-side and device-side. Test: make test-art-host-gtest-patchoat_test Test: make test-art-target-gtest-patchoat_test Bug: 66697305 Change-Id: I8192ced68cec9f270b004488eb264f429bf7ab60
2017-12-12Merge "Revert "Add patchoat test""Nicolas Geoffray
2017-12-12Revert "Add patchoat test"Nicolas Geoffray
Bug: 66697305 Fails on device This reverts commit 14e895ed419fcb67c16be1387d248a4e973cf940. Change-Id: Id817d738be32f44c5dfc97d2646b0090824dc404
2017-12-12Merge "Add patchoat test"Treehugger Robot
2017-12-11Add patchoat testAlex Klyubin
The test checks that relocating an image using dex2oat and patchoat yields the same ART file, except for OAT checksum and patch offset delta. Test: make test-art-host-gtest-patchoat_test Bug: 66697305 Change-Id: I80f8b996bc8fc88ef798dceac9fd9ecd629045a3
2017-12-07ART: Remove base/logging from heap-inl.hAndreas Gampe
Hide the single uncommon VLOG and remove the include. Fix up transitive includes. Test: m Change-Id: I917df597cb62c57040c1fb0e0079df4d95e5a658
2017-11-08cpplint: Cleanup errorsIgor Murashkin
Cleanup errors from upstream cpplint in preparation for moving art's cpplint fork to upstream tip-of-tree cpplint. Test: cd art && mm Bug: 68951293 Change-Id: I15faed4594cbcb8399850f8bdee39d42c0c5b956