diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/util/session.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 3b6f8e460a31..04d1e33f4592 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
| @@ -300,6 +300,11 @@ int machine__resolve_callchain(struct machine *self, | |||
| 300 | 300 | ||
| 301 | callchain_cursor_reset(&callchain_cursor); | 301 | callchain_cursor_reset(&callchain_cursor); |
| 302 | 302 | ||
| 303 | if (chain->nr > PERF_MAX_STACK_DEPTH) { | ||
| 304 | pr_warning("corrupted callchain. skipping...\n"); | ||
| 305 | return 0; | ||
| 306 | } | ||
| 307 | |||
| 303 | for (i = 0; i < chain->nr; i++) { | 308 | for (i = 0; i < chain->nr; i++) { |
| 304 | u64 ip; | 309 | u64 ip; |
| 305 | struct addr_location al; | 310 | struct addr_location al; |
| @@ -318,7 +323,14 @@ int machine__resolve_callchain(struct machine *self, | |||
| 318 | case PERF_CONTEXT_USER: | 323 | case PERF_CONTEXT_USER: |
| 319 | cpumode = PERF_RECORD_MISC_USER; break; | 324 | cpumode = PERF_RECORD_MISC_USER; break; |
| 320 | default: | 325 | default: |
| 321 | break; | 326 | pr_debug("invalid callchain context: " |
| 327 | "%"PRId64"\n", (s64) ip); | ||
| 328 | /* | ||
| 329 | * It seems the callchain is corrupted. | ||
| 330 | * Discard all. | ||
| 331 | */ | ||
| 332 | callchain_cursor_reset(&callchain_cursor); | ||
| 333 | return 0; | ||
| 322 | } | 334 | } |
| 323 | continue; | 335 | continue; |
| 324 | } | 336 | } |
