summaryrefslogtreecommitdiffstats
path: root/breakpad
diff options
context:
space:
mode:
authorthestig@google.com <thestig@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 21:24:56 +0000
committerthestig@google.com <thestig@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 21:24:56 +0000
commit5553532e3a5d3b0ee3a1b364debd1224a41f84f3 (patch)
treea6e86e559d3cf15ad06a306fcb4501c0dfcb3405 /breakpad
parent7cb7a312c5410b618a87e3093235de354e9a9a82 (diff)
downloadchromium_src-5553532e3a5d3b0ee3a1b364debd1224a41f84f3.zip
chromium_src-5553532e3a5d3b0ee3a1b364debd1224a41f84f3.tar.gz
chromium_src-5553532e3a5d3b0ee3a1b364debd1224a41f84f3.tar.bz2
In Linux Breakpad, point the child stack at the top-most address rather than the bottom-most address before calling clone().
BUG=none TEST=Official builds on Linux should be able to dump/upload reliably when running with --crash-test. Review URL: http://codereview.chromium.org/115955 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'breakpad')
-rw-r--r--breakpad/linux/exception_handler.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/breakpad/linux/exception_handler.cc b/breakpad/linux/exception_handler.cc
index fe72f2f..ad7a11d 100644
--- a/breakpad/linux/exception_handler.cc
+++ b/breakpad/linux/exception_handler.cc
@@ -79,6 +79,7 @@
#include <sys/wait.h>
#include <unistd.h>
+#include "breakpad/linux/linux_libc_support.h"
#include "breakpad/linux/linux_syscall_support.h"
#include "breakpad/linux/memory.h"
#include "breakpad/linux/minidump_writer.h"
@@ -266,8 +267,14 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
callback_context_))
return true;
+ static const unsigned kChildStackSize = 8000;
PageAllocator allocator;
- void* const stack = allocator.Alloc(8000);
+ uint8_t* stack = (uint8_t*) allocator.Alloc(kChildStackSize);
+ if (!stack)
+ return false;
+ // clone() needs the top-most address. (scrub just to be safe)
+ stack += kChildStackSize;
+ my_memset(stack - 16, 0, 16);
ThreadArgument thread_arg;
thread_arg.handler = this;