Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10173)

Unified Diff: breakpad/linux/exception_handler.cc

Issue 115955: Point the child stack at the top-most address rather than the bottom-most add... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: breakpad/linux/exception_handler.cc
===================================================================
--- breakpad/linux/exception_handler.cc (revision 17348)
+++ breakpad/linux/exception_handler.cc (working copy)
@@ -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 @@
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698