]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Stop backtrace when we make no more progress.
authorUlrich Drepper <drepper@redhat.com>
Thu, 30 Jul 2009 23:53:52 +0000 (16:53 -0700)
committerPetr Baudis <pasky@suse.cz>
Fri, 18 Sep 2009 14:48:28 +0000 (16:48 +0200)
(cherry picked from commit 2dec6007d183aa51abedbbb048382973129f3935)

ChangeLog
sysdeps/ia64/backtrace.c

index 637b91b263450b42a8eec4ca586e9b0a118015db..64b35cafebe380e48a0ac238a9cec7ecd8dd7181 100644 (file)
--- 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]
index 423fed80a83bca5bb49dcc4e78feb1bffdea6da6..5cefb86ae46e447513eec9897e26d10fff3ade01 100644 (file)
@@ -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;