summaryrefslogtreecommitdiffstats
path: root/runtime/stack-x86_64.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-04-13 17:50:45 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-04-13 17:50:45 -0400
commitf7e07777e033e580351dc6886ab7dbdddd9839fe (patch)
tree07c4878e3eaf77801d5104c2f6c498cfff9e3bbd /runtime/stack-x86_64.c
parenta9f3ab125303a2e89dd3c17b39f26e1d2c428fa5 (diff)
downloadsystemtap-steved-f7e07777e033e580351dc6886ab7dbdddd9839fe.tar.gz
systemtap-steved-f7e07777e033e580351dc6886ab7dbdddd9839fe.tar.xz
systemtap-steved-f7e07777e033e580351dc6886ab7dbdddd9839fe.zip
runtime backtrace: stop infinite loops by checking for full print buffer
2008-04-13 Frank Ch. Eigler <fche@elastic.org> * print.c (_stp_pbuf_full): New function to note full print buffer. * stack-{i386,x86_64}.c: Use it in all stack-searching loops, to impose another limit against unbounded iteration.
Diffstat (limited to 'runtime/stack-x86_64.c')
-rw-r--r--runtime/stack-x86_64.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/stack-x86_64.c b/runtime/stack-x86_64.c
index ae8e446d..9915c594 100644
--- a/runtime/stack-x86_64.c
+++ b/runtime/stack-x86_64.c
@@ -12,7 +12,8 @@
static void _stp_stack_print_fallback(unsigned long stack, int verbose)
{
unsigned long addr;
- while (stack & (THREAD_SIZE - 1)) {
+ while (stack & (THREAD_SIZE - 1) &&
+ !_stp_pbuf_full()) {
if (unlikely(_stp_read_address(addr, (unsigned long *)stack, KERNEL_DS))) {
/* cannot access stack. give up. */
return;