summaryrefslogtreecommitdiff
path: root/debug/tst-backtrace5.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug/tst-backtrace5.c')
-rw-r--r--debug/tst-backtrace5.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/debug/tst-backtrace5.c b/debug/tst-backtrace5.c
index 0b85e4482e..57b7dee0f6 100644
--- a/debug/tst-backtrace5.c
+++ b/debug/tst-backtrace5.c
@@ -88,6 +88,18 @@ handle_signal (int signum)
}
/* Symbol names are not available for static functions, so we do not
check do_test. */
+
+ /* Check that backtrace does not return more than what fits in the array
+ (bug 25423). */
+ for (int j = 0; j < NUM_FUNCTIONS; j++)
+ {
+ n = backtrace (addresses, j);
+ if (n > j)
+ {
+ FAIL ();
+ return;
+ }
+ }
}
NO_INLINE int