Index: uspace/lib/c/generic/stacktrace.c
===================================================================
--- uspace/lib/c/generic/stacktrace.c	(revision 2965d181ff4a61d9c12722159b0950b6d2c4e87a)
+++ uspace/lib/c/generic/stacktrace.c	(revision 1c398db2b6550c5d1519f899db5d82cfc422fbc1)
@@ -41,4 +41,6 @@
 #include <io/kio.h>
 
+#define STACK_FRAMES_MAX 20
+
 static errno_t stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
 
@@ -56,4 +58,5 @@
     uintptr_t pc)
 {
+	int cnt = 0;
 	stacktrace_t st;
 	uintptr_t nfp;
@@ -63,5 +66,5 @@
 	st.ops = ops;
 
-	while (stacktrace_fp_valid(&st, fp)) {
+	while (cnt++ < STACK_FRAMES_MAX && stacktrace_fp_valid(&st, fp)) {
 		ops->printf("%p: %p()\n", (void *) fp, (void *) pc);
 		rc =  stacktrace_ra_get(&st, fp, &pc);
