Age | Commit message (Collapse) | Author |
|
If the underlying local map changes, it's possible for multiple
threads to try and modify the map data associated with the UnwindLocalMap
object. Add a lock when generating the local map to avoid this problem.
In addition, add a read lock whenever any caller gets the maps iterator.
Updated all iterator callers to make this lock.
Bug: 29387050
Bug: 31067025
(cherry picked from commit 3a14004c7f521cf2ca6dfea182fa7441e77c97e7)
Change-Id: Id00116f156a24b36085c0d5dfc3dde4d2ac55194
|
|
As device may not have libbacktrace_offline shared library, simpleperf
no longer rely on it. So there is no reason to keep libbacktrace_offline
shared library.
Bug: 28152982
Change-Id: If8e31b1434646dbbfed60264eb25f034bc5d6946
(cherry picked from commit 51e607056dd0db93ef683d05349dd98648c47e47)
|
|
Bug: 26962895
Change-Id: I009080f26e7323247c3ab24eea614eec4432ca6a
(cherry picked from commit b791a76ed76442a74c466c6116787c73ceea2170)
|
|
am: 0fb3191
* commit '0fb3191840680f7e084aa9ee53a1906074a16b68':
Don't demangle symbol names.
|
|
am: 4cb2ba2
* commit '4cb2ba20883580153c4abd3760a510be63a12e2f':
Don't demangle symbol names.
|
|
Bug: http://b/27299236
Change-Id: I26ef47f80d4d6048a316ba51e83365ff65d70439
|
|
Bug: http://b/26987366
(cherry picked from commit 19c30e95167e4879c79007d42ea9c32c4eaa8979)
Change-Id: I5e4568292c0b4bbd2daefc0abd3d36c691622eb4
|
|
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.
Bug: 27449879
(cherry picked from commit 206a3b9798e3622c906a3cafdb113c271c1c927c)
Change-Id: If9e7cfeb6eb7b122679a734c1a9eacee8354ef18
|
|
This reverts commit 4265ed7cc897c54c55bb18bb341859b5df0f4966.
Workaround in libunwind instead: change-id I98be5754cc4de4071616db334dc0c9862d3a2504
Bug: 27391690
(cherry picked from commit 04dcb00ab7ee73c1b6e75fe6d4e02d1f854cd4cd)
Change-Id: Id77dc081b655dc0fcb513ad0ee95221d91a301f9
|
|
Bug: 27391690
(cherry picked from commit 4265ed7cc897c54c55bb18bb341859b5df0f4966)
Change-Id: I88a49537544b507a3b0bfa61eafc27400a05281b
|
|
When creating an UnwindMapLocal fails in the Build() function call,
the destructor for UnwindMap is called. Unfortunately, the map_cursor_
member variable has not been initialized, so the call to destroy it
winds up operating on garbage data.
Part of this is a result of a bad class hierarchy, so this refactors
the classes slightly, and properly initializes the map_cursor_ member
variable in the base class.
Bug: 26931578
Change-Id: I885596bf65e4ef63559cee2c56cd41576d5ecc1b
|
|
Bug: 26900419
Change-Id: Ifefd017f4b62ecfb2521bd1c38dbb3b09054f205
|
|
BacktraceOffline is the only code that uses libLLVM. Create
a new shared library, backtrace_offline.so, that references this
so that including libbacktrace.so doesn't wind up pulling in libLLVM.
Change-Id: I90c502d833f6c464c3810dffde52a0c6da241cce
|
|
The check_unreadble_elf_* tests only create a readable map. I changed
libunwind to disallow unwinding through non-executable maps, so make
the maps executable too.
Bug: 26589772
Change-Id: Idbe6426ac4d3243779b819c8f1aebdcdacb0669f
|
|
Bug: 25194400
Change-Id: If6e60585673226392d38fab9ad14bd7b94261316
|
|
On host build, libbacktrace relies on libcutils to provide gettid()
function.
Change-Id: Iad83384ea699ca024b71b73cef26755287c9e6fe
|
|
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
|
|
Before, an anonymous map wound up printing the pc as relative.
Unfortunately, this meant that it was impossible to tell the actual
pc. The new code prints the map name as <anonymous:map_start> and
still prints the pc as relative.
In addition, add the start of the map for map names that begin with a
'[' character.
Bug: 25844836
Change-Id: Ie0b6149dde258fe13f0e5a3e5739d85374512f4b
|
|
Change-Id: Ib2783bf5d145599ffed822eec0a2d9f7df2fddf5
|
|
|
|
This change makes sure -fno-omit-frame-pointer flag is not
overrided by flags set in $(LLVM_HOST_BUILD_MK).
Change-Id: I53037b0eab6bd1272cec0f5c9caa058ad1a55419
|
|
(This might want to be unified with the very similar code in bionic, but
that's a job for another day.)
Change-Id: I5dade498f781305fa9909ee01f1f4bebc537c169
|
|
backtracing.""""
This reverts commit 82806f875c87273bc115a764af37f77926975f6d.
Change-Id: Ie06465c89a5fc115517130f9f2904cc855973155
|
|
This reverts commit fd992c3b949924c0804e359c0e3d482436c099b1.
Change-Id: Ic1824afac6c32f1087b66de9d6368a561f235d13
|
|
This reverts commit 5c0b797cfc7e1297895e66db8d3de4a924e9f463.
And statically link llvm libraries on host to remove dependency
on 32-bit llvm shared library which is not included in the prebuilt.
Bug: 22229391
Change-Id: I8210687655ee1809fd820ab2a6ca5dfaf3f9096d
|
|
Using llvm makes libbacktrace stops building for 32 bit on linux host x86_64.
This reverts commit 08853d2a5dbfd04f23b3a537cb91e8b4242b4737.
Change-Id: Ieb807db881d7bb3132cd09e25fd08c28766ca0a8
|
|
It is used by simpeleprf for stack unwinding.
Bug: 22229391
Change-Id: I26d698610ccdc9545da837bc5a8a9ec787f27a6b
|
|
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
|
|
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
Change-Id: Ib7abb36b71d079a7043117697c41b535319586fd
|
|
* commit '802ae55fd1454226b1d76e4a311b2b937d1e0dd9':
Display the map offset for each frame.
|
|
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
(cherry picked from commit 802ae55fd1454226b1d76e4a311b2b937d1e0dd9)
Change-Id: I950f92c1cb29ee05eed777f47453efa03318cf3e
|
|
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
|
|
Upstream clang has a new diagnostic, '-Wmismatched-new-delete' to
generate a warning (that becomes an error with -Werror) when delete is
used to deallocate pointers created with 'new[]'. This patch fixes
'delete's that trigger this warning/error.
Change-Id: I7551e856b4b13bfae4cb78b5664d8652322683cf
|
|
Change-Id: Ic68ac15b2676e4f475330c8e7bb34e0d48783686
|
|
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
|
|
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
Change-Id: I83aca9cf241aee99e7425059b1b6e0d229c08a5e
|
|
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
|
|
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
Change-Id: Idc735dbf6147ec879d35bd4f034c5d227e26a98d
|
|
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)
|
|
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
|
|
Bug: 19517541
(cherry picked from commit 67aba6881d8857d3017e11695207eb2ade45a274)
Change-Id: I914636ccd814e041475b6b2d81119cac1745a9ff
|
|
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
|
|
Bug: 19517541
Change-Id: Ib42360a82934ff7103e2ccb64c1105c59aa3fdea
|
|
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)
|
|
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
|
|
Also, print the offset in the maps section.
Bug: 20864928
Change-Id: I71f005726e5ef73cf75bbcb8f829fd5127cb9d61
(cherry picked from commit 5c8856854de4ae7836fc1073d534f4b7b7a03eb9)
|
|
Also, print the offset in the maps section.
Bug: 20864928
Change-Id: I71f005726e5ef73cf75bbcb8f829fd5127cb9d61
|
|
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
(cherry picked from commit 82188a0bcce9d31d91f018790c4851b6fdd4768a)
Change-Id: Ibc37d8c8bb032820dca4e7531184349ba6d402d2
|
|
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
|
|
Change-Id: Ie90f7f32b5bd1496bd663c969d729ea3f96d2588
|