summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/DexFilesTest.cpp
AgeCommit message (Collapse)Author
2020-10-16Remove libprocinfo, libbacktrace, libunwindstackBaligh Uddin
These projects have moved to a different location. platform/system/core [libprocinfo] -> platform/system/libprocinfo platform/system/core [libbacktrace] -> platform/system/unwinding [libbacktrace] platform/system/core [libunwindstack] -> platform/system/unwinding [libunwindstack] BUG: 163786882 Test: Local build + TH Change-Id: Id6d278d917236df0ffd40b5c32593856e112cb5b
2020-01-21Fix global finding logic.Christopher Ferris
Recently, the maps for an elf in memory might show up looking like: f0000-f1000 0 r-- /system/lib/libc.so f1000-f2000 0 --- f2000-f3000 1000 r-x /system/lib/libc.so f3000-f4000 2000 rw- /system/lib/libc.so That empty map was confusing the logic when looking for a global variable. Now this case is handled properly. New unit test added for this case. Bug: 147910661 Test: Ran unit tests. Test: Ran original failing test 137-cfi. Change-Id: Ida2e96d1da5e1bf61f41646949fe5a2d405c0d61
2019-12-03Fix support finding global variables.Christopher Ferris
The code was not properly getting the variable addresses and using the offset and address fields of the .data section. Fix all of that, and update the tests. Bug: 145162678 Test: Unit tests pass. Test: ./art/test/run-test --dex2oat-jobs 4 --host --prebuild --compact-dex-level fast --jit --no-relocate --runtime-option -Xcheck:jni 137-cfi Test: ./art/test/testrunner/testrunner.py -t 137 --host Change-Id: Ic61c4487334fd2273cda9c56eb1a3b525a03edb7
2019-04-05Revert "Check for data races when reading JIT/DEX entries."David Srbecky
This reverts commit 85b5fecec920208ec43b42488f08d4c2e5aaeda2. Reason for revert: Breaks ART tests, reverting to investigate. Change-Id: I1bb905407e87cbd4f832646651133a9caf6fcfc8
2019-03-29Check for data races when reading JIT/DEX entries.David Srbecky
Update the entries only when the list is modified by the runtime. Check that the list wasn't concurrently modified when being read. Bug: 124287208 Test: libunwindstack_test Test: art/test.py -b --host -r -t 137-cfi Change-Id: I87ba70322053a01b3d5be1fdf6310e1dc21bb084
2018-10-29Verify that the elf matches the expected arch.Christopher Ferris
To avoid a case where a malicious app might try and trick the system to create an elf and register object that mismatches, always verify that they are the same arch. Test: Ran unit tests. Change-Id: I66978e9e02f8e4f396856912e7019528ead4838e
2018-10-17Fix which maps to search for globals.Christopher Ferris
If multiple threads are unwinding at the same time, new maps that contain the global variables for dex files and jit information are created. This leads to threads creating more new maps that then get searched, then more maps, then more searching until virtual address space exhaustion. Fix this so that we only search maps that have a corresponding rw map that could contain the global memory. Small refactor to combine the code to search for global variables into one class that both classes inherit from. Modify unit tests for the new pattern checking. Bug: 117761427 Test: Ran unit tests for libunwindstack/libbacktrace/simpleperf. Test: Ran art 004-ThreadStress that used to fail. Change-Id: I837ca6b9d0383100079de090bc7d019598e0cdfe
2018-10-08Fix handling of globals for new linker.Christopher Ferris
The new linker base map is read-only, but the global handling code for jit and dex information assumed the base map was a read-execute one. Relax that requirement to search read-only maps. Adjust the unit tests for this case. Bug: 117293117 Test: Passes unit tests. Test: Passes art cfi tests with and without llvm linker. Change-Id: I31a765d51847d0b8d778ace9cbaa29f42073f4d9
2018-02-16Adjust DEX file reading to follow layout changes in ART.David Srbecky
I have changed the root DEX debug descriptor in ART to more closely follow the JIT debug descriptor. Add the appropriate offsets to correctly fetch the linked list head for DEX files. Test: testrunner.py -t 137 Test: libunwindstack_test Change-Id: I90402befc88fec42658f7330d51ee79756a7f872
2018-02-02Load dex files from ART-specific data structure.Christopher Ferris
Fixes cdex which was recently changed to have shared data section, which means the DEX PC cannot be used to find the right symbol, as the bytecode is no longer within the dex file, and in-fact, we might have to scan multiple dex files to find the method. Bug: 72520014 Test: testrunner.py --host --cdex-none -t 137 Test: testrunner.py --host --cdex-fast -t 137 Test: All unit tests pass. Change-Id: I80265d05ad69dd9cefbe3f8a75e4cd349002af5e