Commit 32f4f17b authored by kaiwang@chromium.org's avatar kaiwang@chromium.org Committed by Commit Bot

Try not to inline tcmalloc::Abort() so we can find it in stack trace.

BUG=724399,b:70905156

Review URL: https://chromiumcodereview.appspot.com/10535049

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141295 0039d316-1c4b-4281-b951-d872f2087c98
(cherry picked from commit 49e4b033)
Signed-off-by: default avatarGabriel Marin <gmx@chromium.org>

Change-Id: I5a22ef15a79748fb123609c793c96acbdbe903e1
Reviewed-on: https://chromium-review.googlesource.com/1130778
Commit-Queue: Gabriel Marin <gmx@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578433}
parent 06ea4ca7
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/abort.h"
#include "base/basictypes.h"
namespace tcmalloc {
// Try not to inline so we can find Abort() call from stack trace.
ATTRIBUTE_NOINLINE void Abort() {
// Make a segmentation fault to force abort. Writing to a specific address
// so it's easier to find on crash stacks.
*(reinterpret_cast<volatile char*>(NULL) + 57) = 0x2001;
}
} // namespace tcmalloc
......@@ -6,29 +6,14 @@
// On some platforms abort() is implemented in a way that Chrome's crash
// reporter treats it as a normal exit. See issue:
// http://code.google.com/p/chromium/issues/detail?id=118665
// So we replace abort with a
// segmentation fault, that crash reporter can always detect.
// So we replace abort with a segmentation fault, then crash reporter can
// always detect.
#ifndef BASE_ABORT_H_
#define BASE_ABORT_H_
#if defined(TCMALLOC_USE_SYSTEM_ABORT)
#include <stdlib.h>
namespace tcmalloc {
inline void Abort() {
abort();
}
void Abort();
} // namespace tcmalloc
#else
namespace tcmalloc {
inline void Abort() {
// Make a segmentation fault to force abort.
*reinterpret_cast<volatile int*>(NULL) = 0x2001;
}
} // namespace tcmalloc
#endif
#endif // BASE_ABORT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment