aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-30 16:53:52 -0700
committerPetr Baudis <pasky@suse.cz>2009-09-18 16:48:28 +0200
commitb1cc14cb09c03318a0c1ce2a29519999fde7b7c0 (patch)
tree0debc11b0fd5c9aa4e95e9e1c1a7a4b504d88094
parentaa152ec6ad1bcc84a53f3c02810c7d968d1b8216 (diff)
downloadglibc-b1cc14cb09c03318a0c1ce2a29519999fde7b7c0.tar
glibc-b1cc14cb09c03318a0c1ce2a29519999fde7b7c0.tar.gz
glibc-b1cc14cb09c03318a0c1ce2a29519999fde7b7c0.tar.bz2
glibc-b1cc14cb09c03318a0c1ce2a29519999fde7b7c0.zip
Stop backtrace when we make no more progress.
(cherry picked from commit 2dec6007d183aa51abedbbb048382973129f3935)
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/ia64/backtrace.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 637b91b263..64b35cafeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-30 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/ia64/backtrace.c (backtrace_helper): Stop backtrace when
+ we make no more progress.
+
2009-07-25 Ulrich Drepper <drepper@redhat.com>
[BZ #10448]
diff --git a/sysdeps/ia64/backtrace.c b/sysdeps/ia64/backtrace.c
index 423fed80a8..5cefb86ae4 100644
--- a/sysdeps/ia64/backtrace.c
+++ b/sysdeps/ia64/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state.
- Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -61,7 +61,13 @@ backtrace_helper (struct _Unwind_Context *ctx, void *a)
/* We are first called with address in the __backtrace function.
Skip it. */
if (arg->cnt != -1)
- arg->array[arg->cnt] = (void *) unwind_getip (ctx);
+ {
+ arg->array[arg->cnt] = (void *) unwind_getip (ctx);
+
+ /* Check whether we make any progress. */
+ if (arg->cnt > 0 && arg->array[arg->cnt - 1] == arg->array[arg->cnt])
+ return _URC_END_OF_STACK;
+ }
if (++arg->cnt == arg->size)
return _URC_END_OF_STACK;
return _URC_NO_REASON;