summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-09-03Add a logging handler on timeout.marshmallow-mr1-devmarshmallow-dr1.5-releasemarshmallow-dr1.5-devmarshmallow-dr-releasemarshmallow-dr-devChristopher Ferris
If the signal handler doesn't fire in the given time when trying to unwind a thread, put on a logging handler. This prevents crashes if the signal does eventually fire. Bug: 23783762 (cherry picked from commit d7226f9a1485ba19f714369fd7f8b444d66feb61) Change-Id: Ib990a06733cc93717752ab4998f4ae26afd7e249
2015-08-20am 802ae55f: Display the map offset for each frame.Christopher Ferris
* commit '802ae55fd1454226b1d76e4a311b2b937d1e0dd9': Display the map offset for each frame.
2015-08-20Display the map offset for each frame.marshmallow-devChristopher Ferris
The dlopen of a shared library in an apk results in large map offsets. Unfortunately, the current way that the frame data is printed, it's impossible to tell what the relative pc is relative to. With the addition of the offset, it's possible to figure out what the relative pc actually references. Bug: 23348999 Change-Id: Ia51b669ea3f810158cfd0d71d9ae89bf9a3170d3
2015-06-15merge in mnc-release history after reset to mnc-devThe Android Automerger
2015-06-12Remove PtraceRead error message.Christopher Ferris
This error message has no meaning and makes it look like an unwinding failure occurred. These messages are showing up more often now that a lot more of debuggerd is using the ReadWord and Read calls. If a higher level function wants to indicate there is an error, then it can add a more meaningful error. Bug: 21818730 (cherry picked from commit 35c8136d96a6007ac83f828ac02cc6b75d3f5cc0) Change-Id: Ie6e20fbc18702fde935f2cf8cbf1b297fda43282
2015-06-01Modify the code to avoid potential deadlocks.Christopher Ferris
If the signal to dump a thread is never delivered, then it's possible for a deadlock. The signal handler is responsible for unlocking and deleting the ThreadEntry created for the pid/tid combination. This means if the signal is lost, the ThreadEntry gets stuck locked and never deleted. If a second attempt to get a backtrace of this thread occurs, there is a deadlock. Also, decrease the timeout from 10 seconds to 5 seconds. The original 10 seconds was because the unwind was actually done in the signal handler. Now the signal handler does nothing but copy the ucontext structure and let the caller do the unwind. Bug: 21086132 (cherry picked from commit 2d09171758b7d98c77f27e439a4caf35dd84c311) Change-Id: I414c500eb08983a5017caf3fce4f499465575a9d
2015-05-15Prevent crashes if a map cannot be created.Christopher Ferris
Under some conditions, /proc/<pid>/maps might return nothing. If we try and unwind in this case, we'll crash. Check this case and fail the unwind. Add checks that no other functions try and use map_ without checking for nullptr. Add logging when an unwind fails so it's clear what happened. Bug: 21162746 Change-Id: I56ce51dda0cfc9db20475a441f118108196aa07c (cherry picked from commit 30c942cf1024bf791c28ab9b67a1f752de72248c)
2015-05-13Add tests for elf unwinding in memory.Christopher Ferris
Bug: 19517541 (cherry picked from commit 67aba6881d8857d3017e11695207eb2ade45a274) Change-Id: I914636ccd814e041475b6b2d81119cac1745a9ff
2015-05-13Remove libbacktrace definition of gettid.Dan Albert
Also simplifies the Darwin implementation of gettid, because apparently libbacktrace had a better way of doing it. Bug: 19517541 (cherry picked from commit 23f750b068ddf5b20fb5d153a798b22562368992) Change-Id: I2f888e8ed7a2f5719973786cbcbb399a81867ee9
2015-05-06Fix small ptrace reads.Christopher Ferris
The BacktracePtrace::Read function crashes if the number of bytes to read is less than the number of bytes needed to align the read to a word_t boundary. Fix this and add a test for this case. Change-Id: I50808849ece44928f65dba1d25309e3885c829a2 (cherry picked from commit 944f417ccb86441060ffb670b4bdc2975fda08fc)
2015-05-06Add offset to map data.Christopher Ferris
Also, print the offset in the maps section. Bug: 20864928 Change-Id: I71f005726e5ef73cf75bbcb8f829fd5127cb9d61 (cherry picked from commit 5c8856854de4ae7836fc1073d534f4b7b7a03eb9)
2015-05-01Add load base to map for relocation packing.Christopher Ferris
The new linker relocation packing support uses non-zero load bases, so we better handle them properly. Also print out the load base for a map if it's non-zero. Bug: 20687795 Change-Id: Iec2d1db2051e7b4a278c1dfa57d745128a7f2974
2015-04-15Remove libunwind-ptrace dependency.Christopher Ferris
Change-Id: Iae4a73546f672c208ffe1b224e8d9a9e693f95f0
2015-04-02Update the test for better output on error.Christopher Ferris
Change-Id: Id3b0b96a33441ce5d908aac38e639ac3598a7a89
2015-04-01Discards frames for code within library.Christopher Ferris
When doing a local unwind, do not include the frames that come from either libunwind or libbacktrace. Bug: 11518609 Change-Id: I0ec8d823aebbfa0903e61b16b7e5663f3fd65e78
2015-03-31Merge "Refactor the code."Christopher Ferris
2015-03-31Merge "Add -Wno-inline-asm to Clang flags."Stephen Hines
2015-03-31Refactor the code.Christopher Ferris
The object hierarchy was confusing and convoluted. This removes a lot of unnecessary code, and consolidates the BacktraceCurrent and BacktraceThread code into BacktraceCurrent. Change-Id: I01c8407d493712a48169df49dd3ff46db4a7c3ae
2015-03-31Add -Wno-inline-asm to Clang flags.Stephen Hines
The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists. This is a problem for libraries that are attempting to save all register state. Change-Id: I1ce80530f8be85fd74e949d0c65b60080e0aaf2a
2015-03-27Merge "Remove uses of libcxx.mk."Dan Albert
2015-03-27Remove uses of libcxx.mk.Dan Albert
This is a no-op. Change-Id: Iecbcd5f6d818abbf98767a2e996c10f454b652e4
2015-03-26Libbacktrace: Use frame-pointer on hostAndreas Gampe
Otherwise it may have problems unwinding over itself. Change-Id: I9b0d108018ae3f5d98b9ae6fb62d0af83a77d18e
2015-03-17Merge "Add variable length read to Backtrace."Christopher Ferris
2015-03-17Add variable length read to Backtrace.Christopher Ferris
Included tests for this new feature. Changed the NULLs to nullptr in backtrace_test. Changed UniquePtr to std::unique_ptr in backtrace_test. Change-Id: I92375465b8f8ba84589834cc162db5915bf1be81
2015-02-06am c9c401e6: Merge "Move map data into backtrace data proper."Christopher Ferris
* commit 'c9c401e64ba00e8fa295cae30b2b0035fae1183a': Move map data into backtrace data proper.
2015-02-06Move map data into backtrace data proper.Christopher Ferris
The backtrace structure used to include a pointer to a backtrace_map_t that represented the map data for a particular pc. This introduced a race condition where the pointer could be discarded, but the backtrace structure still contained a pointer to garbage memory. Now all of the map information is right in the structure. Bug: 19028453 Change-Id: If7088a73f3c6bf1f3bc8cdd2bb4b62e7cab831c0
2015-02-06am 62894122: Merge "Remove link to gccdemangle."Christopher Ferris
* commit '6289412222bfe26ebeef2ea9c422e828c11ffc30': Remove link to gccdemangle.
2015-02-05Remove link to gccdemangle.Christopher Ferris
Bug: 18930951 Change-Id: Ib7fd332b6e02241c0676ef33d2fa210a72efe1b1
2014-12-12am e2f95f45: Merge "Cleanup libbacktrace Android.mk"Elliott Hughes
* commit 'e2f95f453531e26c7ed4f78c226b344f16d7882b': Cleanup libbacktrace Android.mk
2014-12-12Merge "Cleanup libbacktrace Android.mk"Elliott Hughes
2014-12-12Cleanup libbacktrace Android.mkTrevor Drake
Removed unnecessary libbacktrace_c_includes variable Change-Id: I2ef29dc9810f7d9a7dcf5c232e9e85d2fc2fd5e8
2014-11-14resolve merge conflicts of bc137cf to lmp-mr1-dev-plus-aosp.Christopher Ferris
Change-Id: I9b542a0b1a2ae52c954b6b6995e6836c0c6713d3
2014-11-14am dc569c84: Merge "Convert futex to cond wait."Christopher Ferris
* commit 'dc569c84ebda7b0cfc9130b345f7debb92df7fc0': Convert futex to cond wait.
2014-11-14Merge "Convert futex to cond wait."lollipop-wear-releaseChristopher Ferris
2014-11-14Convert futex to cond wait.Christopher Ferris
Switch to the better supported pthread_cond to handle the Wait/Wake functions. Also, increase the number of simultaneous threads in the thread tests. Bug: 18381207 (cherry picked from commit db44538387b08f367fc2419653639866f4c2fbd6) Change-Id: Id326a7a7b92cb61573def3f761597c40f3ef2f4b
2014-11-13Convert futex to cond wait.lollipop-mr1-wfc-releaselollipop-mr1-fi-releaselollipop-mr1-devChristopher Ferris
Switch to the better supported pthread_cond to handle the Wait/Wake functions. Also, increase the number of simultaneous threads in the thread tests. Bug: 18381207 Change-Id: I63240208e8b7f641b3f35a3fc0bb1acf80dc796e
2014-11-13am 874990bc: Merge "Add LOCAL_MULTILIB := both to Darwin libbacktrace."Dan Albert
* commit '874990bc47aa42114c8353148b7dd6bf1ce4a023': Add LOCAL_MULTILIB := both to Darwin libbacktrace.
2014-11-13Merge "Add LOCAL_MULTILIB := both to Darwin libbacktrace."Dan Albert
2014-11-13Add LOCAL_MULTILIB := both to Darwin libbacktrace.Dan Albert
This was previously set for libbacktrace_libc++, but apparently never was for libbacktrace. Change-Id: I85dc44b356710c6367f5cea3bc0a4d6c817ca202
2014-11-12am ca1797ae: Merge "Remove the stlport linked libbacktrace."Dan Albert
* commit 'ca1797ae00d3b5bf2eb4d1cad5bb68cef0074346': Remove the stlport linked libbacktrace.
2014-11-11Remove the stlport linked libbacktrace.Dan Albert
Rename the libc++ linked libbacktrace to the normal name. Bug: 15193147 Change-Id: I75caf1ee527e3703825e0db757497fb8fa3dd122
2014-11-03am 4b970895: am 07b82470: DO NOT MERGE Restore libcorkscrew unwinding. ↵Christopher Ferris
automerge: 7f80f37 -s ours automerge: 2f5267e -s ours automerge: 56bf9d8 -s ours * commit '56bf9d8e6028f9466e5fee5c709e783a3dd5a97c':
2014-11-03DO NOT MERGE Restore libcorkscrew unwinding. automerge: 7f80f37 -s oursChristopher Ferris
automerge: 2f5267e -s ours * commit '2f5267ebf6d7e801b6bffd0438b198c441d4fd6d':
2014-10-29am aad358fb: Merge commit \'b2042f7263c7bbacc5115de4a42c5a96b64a06f2\' into HEADBill Yi
* commit 'aad358fbc19592cefc37160fb7e3901f732dc033': Revert "DO NOT MERGE Libnativebridge: Temporarily change back to late dlopen"
2014-10-24DO NOT MERGE Restore libcorkscrew unwinding.Christopher Ferris
automerge: 7f80f37 -s ours * commit '7f80f37da0ce0141d241bab624a7c77aae250ddd': DO NOT MERGE Restore libcorkscrew unwinding.
2014-10-07am af162c8b: am 63e6fe92: am 7958ca37: am 7f80f37d: (-s ours) DO NOT MERGE ↵Christopher Ferris
Restore libcorkscrew unwinding. * commit 'af162c8b80269781e3602fd0b0e79611ce041f93': DO NOT MERGE Restore libcorkscrew unwinding.
2014-10-07am 7958ca37: am 7f80f37d: (-s ours) DO NOT MERGE Restore libcorkscrew unwinding.Christopher Ferris
* commit '7958ca37a9a1816e51eeafaeb319ace8bf11205c': DO NOT MERGE Restore libcorkscrew unwinding.
2014-10-07am 7f80f37d: (-s ours) DO NOT MERGE Restore libcorkscrew unwinding.studio-1.1-releaselollipop-releaselollipop-devlollipop-cts-releaseChristopher Ferris
* commit '7f80f37da0ce0141d241bab624a7c77aae250ddd': DO NOT MERGE Restore libcorkscrew unwinding.
2014-08-05am 3905ef76: Add uncached argument to BacktraceMap::Create on darwinBrian Carlstrom
* commit '3905ef7643498df09fd3ebe7f2ef3b14e05538cf': Add uncached argument to BacktraceMap::Create on darwin
2014-08-05am 2ea89b63: am 30d12d05: Merge "Add uncached argument to ↵Brian Carlstrom
BacktraceMap::Create on darwin" * commit '2ea89b631d58ecd8edd7165ed8840d1e1047aa72': Add uncached argument to BacktraceMap::Create on darwin