forked from apache/incubator-pegasus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 26 additions & 4 deletions
30
...race-check-frame-size-threshold-for.patch → thirdparty/fix_gperftools-generic_fp.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
From 8a8d6a378232b2f813ef31a8729820dad5d758e8 Mon Sep 17 00:00:00 2001 | ||
From f74212f40055d78d54cadf473907c7f0fbe1b6d1 Mon Sep 17 00:00:00 2001 | ||
From: Yikai Zhao <[email protected]> | ||
Date: Mon, 25 Sep 2023 19:04:23 +0800 | ||
Subject: [PATCH] generic_fp stacktrace: check frame size threshold for initial | ||
frame | ||
|
||
Fix result overflow in generic_fp stacktrace | ||
|
||
In the 'with ucontext' case, the `skip_count` would be reset to 0, and | ||
`max_depth` should not be modified. Otherwise the result array would overflow. | ||
--- | ||
src/stacktrace_generic_fp-inl.h | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
src/stacktrace_generic_fp-inl.h | 10 +++++++--- | ||
1 file changed, 7 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/src/stacktrace_generic_fp-inl.h b/src/stacktrace_generic_fp-inl.h | ||
index aa32bc5..1412a68 100644 | ||
index aa32bc5..91fedef 100644 | ||
--- a/src/stacktrace_generic_fp-inl.h | ||
+++ b/src/stacktrace_generic_fp-inl.h | ||
@@ -123,8 +123,6 @@ int capture(void **result, int max_depth, int skip_count, | ||
int *sizes) { | ||
int i = 0; | ||
|
||
- max_depth += skip_count; | ||
- | ||
if (initial_pc != nullptr) { | ||
// This is 'with ucontext' case. We take first pc from ucontext | ||
// and then skip_count is ignored as we assume that caller only | ||
@@ -137,6 +135,8 @@ int capture(void **result, int max_depth, int skip_count, | ||
i++; | ||
} | ||
|
||
+ max_depth += skip_count; | ||
+ | ||
constexpr uintptr_t kTooSmallAddr = 16 << 10; | ||
constexpr uintptr_t kFrameSizeThreshold = 128 << 10; | ||
|
||
@@ -156,6 +156,7 @@ int capture(void **result, int max_depth, int skip_count, | ||
constexpr uintptr_t kAlignment = 16; | ||
#endif | ||
|
36 changes: 0 additions & 36 deletions
36
thirdparty/fix_gpertools-Fix-result-overflow-in-generic_fp-stacktrace.patch
This file was deleted.
Oops, something went wrong.