summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-03Ignore memory from elf on /memfd:android10-tests-releaseandroid10-tests-devandroid10-qpr3-s1-releaseandroid10-qpr3-releaseandroid10-qpr2-s4-releaseandroid10-qpr2-s3-releaseandroid10-qpr2-s2-releaseandroid10-qpr2-s1-releaseandroid10-qpr2-releaseandroid10-qpr1-releaseandroid10-qpr1-mainline-releaseandroid10-qpr1-d-releaseandroid10-qpr1-c-s1-releaseandroid10-qpr1-c-releaseandroid10-qpr1-b-s1-releaseandroid10-qpr1-b-releaseandroid10-mainline-media-releaseandroid10-devandroid10-d4-s1-releaseandroid10-d4-releaseandroid10-c2f2-s2-releaseandroid10-c2f2-s1-releaseandroid10-c2f2-releaseChristopher Ferris
In ART, some of the maps are /memfd:/jit-cache and it triggers the warning about unreadable elf files. Do not set the elf from memory not file flag in this case. Bug: 131909548 Test: New unit tests pass. Test: No warnings dumping stacks with this change done. Change-Id: Ifba5e65da609525ded75430da173c614f6e4801e (cherry picked from commit 98aaf4cf086e2492796b11116e69e0ff01093663)
2019-04-19Add indicator that an elf is memory backed.Christopher Ferris
Modify the unwinder library to indicate that at least one of the stack frames contains an elf file that is unreadable. Modify debuggerd to display a note about the unreadable frame and a possible way to fix it. Bug: 129769339 Test: New unit tests pass. Test: Ran an app that crashes and has an unreadable file and verified the Test: message is displayed. Then setenforce 0 and verify the message is Test: not displayed. Change-Id: Ibc4fe1d117e9b5840290454e90914ddc698d3cc2 Merged-In: Ibc4fe1d117e9b5840290454e90914ddc698d3cc2 (cherry picked from commit 4ae266ccbddbd0a6529248ecd1b324feab261c0d)
2019-04-15Fix pc/function name for signal handler frame.Christopher Ferris
This refactors the step function slightly to split it up into distinct pieces since the code needs to handle a signal handler versus normal step slightly differently. Add a new error for an invalid elf. Modify libbacktrace code to handle new error code. Bug: 130302288 Test: libbacktrace/libunwindstack unit tests. Change-Id: I3fb9b00c02d2cf2cc5911541bba0346c6f39b8e6 Merged-In: I3fb9b00c02d2cf2cc5911541bba0346c6f39b8e6 (cherry picked from commit d11ed86d65e870c5ea0d4918693376d474dbfe7d)
2019-04-12Revert "Check for data races when reading JIT/DEX entries."David Srbecky
This reverts commit e7caa05786371df54cba2038588d4f5465e9d476. Reason for revert: Breaks ART tests, reverting to investigate. Exempt-From-Owner-Approval: Revert. (cherry picked from commit b9cc4fbb268652744c812415cb2e5d1fbe04879a) Bug: 130406806 Change-Id: I634e37060b97484d627fc544e3b406fd90aaa784
2019-04-04Fix off by one reading build id.Christopher Ferris
Update unit tests and add new build id displaying in offline unwinds. Bug: 129873279 Test: All unit tests pass. Test: Verify that debuggerd displays build id properly. Change-Id: I97f4a204842447a20c812f535a458155b937d5e1 Merged-In: I97f4a204842447a20c812f535a458155b937d5e1 (cherry picked from commit 1760b45709df4d925c3a131db0b443b585837703)
2019-04-03Merge "Check for data races when reading JIT/DEX entries."David Srbecky
am: 68c533b233 Change-Id: I64832ce6d28f0dd0c9036e48031ce3b9faae8dac
2019-04-03Merge "Check for data races when reading JIT/DEX entries."David Srbecky
2019-04-02Merge "Add minimal support for Dwarf 5."Christopher Ferris
am: e44bf1a4a2 Change-Id: I7cac4a4fbc8d5e77c9642cf2909c962bb12bad7c
2019-04-01Add minimal support for Dwarf 5.Christopher Ferris
This is not full support for dwarf 5, this merely treats a Dwarf 5 version as Dwarf 4. There are new dwarf ops that are not supported yet, but this minimally support should allow unwinding to work if those ops are not present. Bug: 127355724 Test: New Unit tests pass. Change-Id: I35b24fbcb15a64acd49e1e0b6890dff4456ee6fd
2019-03-29Merge "Remove sequential search from DwarfEhFrameWithHdr."Christopher Ferris
am: cab97bc6eb Change-Id: I7663f76ca8ccbd7c36bd7b586a91dd78377cab9a
2019-03-29Remove sequential search from DwarfEhFrameWithHdr.Christopher Ferris
Since there has never been a time that a sequential search has been necessary, simply remove the sequential code and allow the DwarfEhFrame object to be used in that case. If this does come up regularly, I'm not sure that it wouldn't be more performant to use the DwarfEhFrame object regardless. Bug: 129550015 Test: libunwindstack unit tests, libbacktrace unit tests. Change-Id: I738e81accb9bc1e182168cddc9c0c22823e3369b
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
2019-03-26Merge "Add BuildId to frame information."Christopher Ferris
am: 3da5fcbf70 Change-Id: I8168b1d2ae61280423ef6ec6ff598772aaafabd5
2019-03-26Add BuildId to frame information.Christopher Ferris
Update debuggerd to print BuildId information by default. Bug: 120975492 Test: New unit tests pass. Test: debuggerd -b <PID> shows build id information. Test: tombstones include build id information. Change-Id: I019b031113d0b77385516223c63455b868924440
2019-03-25Merge "[libbacktrace] Modernize code to use override keyword"Yi Kong
am: 9b1f1ee4cc Change-Id: I22432cdea88210e32f4f5b5cc83cdd275f1cd0cd
2019-03-25[libbacktrace] Modernize code to use override keywordYi Kong
Generated by clang-tidy. Test: m checkbuild Change-Id: I4506a9624002250117148413ea6990749cc1a4da
2019-03-14Merge "Add support for displaying soname in an apk."Christopher Ferris
am: 4886a5bd59 Change-Id: Id99d7d57656cc841d35162f37aa70f36f77db65c
2019-03-13Add support for displaying soname in an apk.Christopher Ferris
Changes: - Change GetSoname to always returns a std::string. - Added new unit tests for the soname printing. - Modify the GetElf() function to save the same elf when we see rosegment linkers that split the read-only and read-write across a map. This avoids creating multiple elf objects for each map. - Fixed a few offline unwind tests. Bug: 29218999 Test: Unit tests pass. Change-Id: Iad7c38b5c2957a8c5fd4ba94ebec335bafcad57d
2019-03-13Merge "Fix missing offset for apk."Christopher Ferris
am: 9a00f596d3 Change-Id: Ie4a9074591aef5869479dc6f872bff8ae1d54dee
2019-03-12Fix missing offset for apk.Christopher Ferris
The elf_start_offset field in a map_info was not set in one path. Added new offline test for this, and update a few unit tests. Bug: 128442792 Test: New unit tests pass. Change-Id: I2c6ac1b5271a99aa0e8c4b6342a5970199185112
2019-03-11Merge "Add missing override keyword"Casey Dahlin
am: 8a1fb91e14 Change-Id: I830ffece013b56785a26f6b5463c401fb66a2eb1
2019-03-11Add missing override keywordCasey Dahlin
Fuchsia builds with Clang, and it's a bit pickier about always using override when it's appropriate. Test: None
2019-03-09Merge "Add unistd.h to includes in Regs.h"Christopher Ferris
am: fdfb9a0113 Change-Id: I983d1df827a6f4dccdb3cfd4a240a2451c21882b
2019-03-08Add unistd.h to includes in Regs.hCasey Dahlin
This is required to use pid_t, but by luck nobody noticed its absence until the Fuchsia build. Test: Code now builds inside Fuchsia
2019-03-06Merge "Fix copy / move behaviour of Maps object."Florian Mayer
am: 30c898f1ca Change-Id: I7912a4c29393b7e0fb0e1e26c09160989f8544f2
2019-03-05Fix copy / move behaviour of Maps object.Florian Mayer
Currently, moving or copying a Maps object leads to double free of MapInfo. Even moving a Maps object did not prevent this, as after a move the object only has to be in an "unspecified but valid state", which can be the original state for a vector of raw pointers (but not for a vector of unique_ptrs). Changing to unique_ptrs is the most failsafe way to make sure we never accidentally destruct MapInfo. Test: atest libuwindstack_test Failed LocalUnwinderTest#unwind_after_dlopen which also fails at master. Change-Id: Id1c9739b334da5c1ba532fd55366e115940a66d3
2019-02-26Merge "Fix libdexfile dependencies to avoid direct dependency on ↵Martin Stjernholm
libdexfile_external." am: 21c29cfade Change-Id: I1526f70910aa0ecd49d303bc848a3d08e4aa7a76
2019-02-24Fix libdexfile dependencies to avoid direct dependency on libdexfile_external.Martin Stjernholm
It should be dlopen'ed lazily by libdexfile_support now. Also change debuggerd_test to not link libunwindstack and its dependencies statically - the static libs can overlap with the dynamic ones. Test: mmma system/core/debuggerd/ Test: atest debuggerd_test Test: mmma system/core/{libunwindstack,libbacktrace}, run host gtests (cannot get atest to work) Bug: 124827589 Bug: 123186083 Change-Id: I9e7bf9bcbae499af4e1be4c9854bce441e2a7b55
2019-02-15Merge "procinfo: Read inode number from /proc/<pid>/maps"Sandeep Patil
am: 81767b1d3d Change-Id: I7a87a5b6f6b8bcc01b4eb324ffd6a16d8013ade1
2019-02-11procinfo: Read inode number from /proc/<pid>/mapsSandeep Patil
Adjust all callbacks to include the inode number as well. Fixes: 123532375 Test: libprocinfo_test Test: libdmabufinfo_test Test: libmeminfo_test Change-Id: I71fd75d90d5ee44585011c5ae654a1dd7e185458 Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-30Merge "Avoid signed extension of chars for build ids."Christopher Ferris
am: d451f39245 Change-Id: Ia9145e164bc4e959c93618cd130b7337186a6e01
2019-01-30Avoid signed extension of chars for build ids.Christopher Ferris
Added a unit test that fails before the change and passes afterwards. Bug: 120606663 Test: All unit tests pass. Change-Id: I054c7eac0c55abc3babe1d48a041f5819ad9db81
2019-01-29Merge "Fix bug in unwind_info display of exidx frame."Christopher Ferris
am: 5852c31cf7 Change-Id: If0db919392c6a83ab82fd3845e621f5dfac1f76a
2019-01-29Merge "Fix bug in unwind_info display of exidx frame."Christopher Ferris
2019-01-29Merge "Allow to move frames out of Unwinder."Florian Mayer
am: e6f25c4536 Change-Id: I02d888bed24ba754f6b8449676ec7d90ee279f4b
2019-01-29Merge "Allow to move frames out of Unwinder."Treehugger Robot
2019-01-28Fix bug in unwind_info display of exidx frame.Christopher Ferris
The rosegment changed the load segments and broke the unwind_info printing of unwind information for the arm exidx frame. Test: Fixed and verified by dumping the arm exidx frame. Change-Id: I7270175e4dcb7fee2b96a16d168880ebd09f19b1
2019-01-28Allow to move frames out of Unwinder.Florian Mayer
This saves a copy for every unwind we do in heapprofd. Change-Id: Ife7aa1ce68831729d96ccd4c3e54ca531f98b6bc
2019-01-25Merge "Add GetPrintableBuildID()."Christopher Ferris
am: 77487d1092 Change-Id: If23b529363e07473a498896ef493565f7a4cecb5
2019-01-26Merge "Add GetPrintableBuildID()."Christopher Ferris
2019-01-25Merge "Add a few leak check tests."Christopher Ferris
am: 2cab74a18c Change-Id: Icae3c879ca1abbd556a08d494556da14e92f2c12
2019-01-26Merge "Add a few leak check tests."Christopher Ferris
2019-01-25Add GetPrintableBuildID().Christopher Ferris
The GetBuildID() function returns the raw build id data, so add a function to get the printable hex version of the data. Bug: 120606663 Test: New unit tests pass. Change-Id: Ia5aefc97457efb08bbd30ea96cbb2d47ae59f954
2019-01-25Add a few leak check tests.Christopher Ferris
These tests are meant to replace the leak check tests from libbacktrace. Bug: 120606663 Test: Ran tests on host and target. Change-Id: I928b199304afc36b4bac78e9a2cd688b6f2910b9
2019-01-24Merge "Fix crash in libunwindstack."Florian Mayer
am: 8d10158c82 Change-Id: Iead0e058dd15d70ac9ccc58794119283df41c419
2019-01-25Merge "Fix crash in libunwindstack."Treehugger Robot
2019-01-24Fix crash in libunwindstack.Florian Mayer
Bug: 122657596 Test: New unit test that crashes without this change. Change-Id: I5d978530a833345def94a58805d7ee93b23382bb
2019-01-24Merge "libunwindstack: Move DwarfOp callback table to rodata section"Vic Yang
am: 4c1798b6c1 Change-Id: I7329c156b6a18c3728ec23b58eab2433f0808f81
2019-01-24libunwindstack: Move DwarfOp callback table to rodata sectionVic Yang
There are currently two copies of DwarfOp callback tables in data.rel.ro section, and that is 16KB of dirty memory per process on a 64-bit platform. To reduce memory usage, we introduce a layer of indirection so that all instances of DwarfOp can share a single callback table. We also get rid of the pointers for op names in the callback table so that the entire table can be placed in rodata section. Test result shows 1MB saving on cuttlefish, and 750KB saving on a Go device (32-bit ARM). Bug: 112073665 Test: Boot on cuttlefish and a Go device. Change-Id: Idf90a513f37534ab1ef30d5742a9d3ea779f3661
2019-01-24Merge "Fix memory leak in UnwinderFromPid object."Christopher Ferris
am: 3c1d6b836a Change-Id: Ib56d1540c6a9835cb05084ddf66abfbfe44881da