summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-07-16 10:24:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-16 10:24:44 -0700
commit0246f8f6f6e4b9ebee7d683a48ce37728ea39340 (patch)
treed318679efab527865ac8a60687a19c8bb31260c5 /debuggerd
parent3884a9b252c1852e88a2ad75c22b042d25a633f4 (diff)
parenta570312a56938f6ebfcadc3ec9830ab8a2407654 (diff)
downloadcore-0246f8f6f6e4b9ebee7d683a48ce37728ea39340.tar.gz
core-0246f8f6f6e4b9ebee7d683a48ce37728ea39340.tar.bz2
core-0246f8f6f6e4b9ebee7d683a48ce37728ea39340.zip
am a570312a: am f265426f: am 596ee9ea: Merge "Improve the crasher stack-overflow command."
* commit 'a570312a56938f6ebfcadc3ec9830ab8a2407654': Improve the crasher stack-overflow command.
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/crasher.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/debuggerd/crasher.c b/debuggerd/crasher.c
index 8c225cb1f..5ecb1a556 100644
--- a/debuggerd/crasher.c
+++ b/debuggerd/crasher.c
@@ -47,17 +47,19 @@ static int smash_stack(int i) {
// Unless there's a "big enough" buffer on the stack, gcc
// doesn't bother inserting checks.
char buf[8];
- // If we don't write something relatively unpredicatable
+ // If we don't write something relatively unpredictable
// into the buffer and then do something with it, gcc
// optimizes everything away and just returns a constant.
*(int*)(&buf[7]) = (uintptr_t) &buf[0];
return *(int*)(&buf[0]);
}
+static void* global = 0; // So GCC doesn't optimize the tail recursion out of overflow_stack.
+
__attribute__((noinline)) static void overflow_stack(void* p) {
- fprintf(stderr, "p = %p\n", p);
void* buf[1];
buf[0] = p;
+ global = buf;
overflow_stack(&buf);
}