Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 3bd1d7d463320209e0e6c9b13b10246ec05805c8)
+++ uspace/lib/c/generic/assert.c	(revision 8751cf3e7ba3d98f4a12483149400b8dfe1040b6)
@@ -49,4 +49,6 @@
 	    cond, file, line);
 
+	stacktrace_kio_print();
+
 	/* Sometimes we know in advance that regular printf() would likely fail. */
 	abort();
@@ -60,4 +62,6 @@
 	kio_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
 	    cond, file, line);
+
+	stacktrace_kio_print();
 
 	/*
Index: uspace/lib/c/generic/stacktrace.c
===================================================================
--- uspace/lib/c/generic/stacktrace.c	(revision 3bd1d7d463320209e0e6c9b13b10246ec05805c8)
+++ uspace/lib/c/generic/stacktrace.c	(revision 8751cf3e7ba3d98f4a12483149400b8dfe1040b6)
@@ -39,9 +39,16 @@
 #include <stdint.h>
 #include <errno.h>
+#include <io/kio.h>
 
 static errno_t stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
 
 static stacktrace_ops_t basic_ops = {
-	.read_uintptr = stacktrace_read_uintptr
+	.read_uintptr = stacktrace_read_uintptr,
+	.printf = printf,
+};
+
+static stacktrace_ops_t kio_ops = {
+	.read_uintptr = stacktrace_read_uintptr,
+	.printf = kio_printf,
 };
 
@@ -57,5 +64,5 @@
 
 	while (stacktrace_fp_valid(&st, fp)) {
-		printf("%p: %p()\n", (void *) fp, (void *) pc);
+		ops->printf("%p: %p()\n", (void *) fp, (void *) pc);
 		rc =  stacktrace_ra_get(&st, fp, &pc);
 		if (rc != EOK)
@@ -71,4 +78,17 @@
 {
 	stacktrace_print_generic(&basic_ops, NULL, fp, pc);
+}
+
+void stacktrace_kio_print(void)
+{
+	stacktrace_prepare();
+	stacktrace_print_generic(&kio_ops, NULL, stacktrace_fp_get(), stacktrace_pc_get());
+
+	/*
+	 * Prevent the tail call optimization of the previous call by
+	 * making it a non-tail call.
+	 */
+
+	kio_printf("-- end of stack trace --\n");
 }
 
Index: uspace/lib/c/include/stacktrace.h
===================================================================
--- uspace/lib/c/include/stacktrace.h	(revision 3bd1d7d463320209e0e6c9b13b10246ec05805c8)
+++ uspace/lib/c/include/stacktrace.h	(revision 8751cf3e7ba3d98f4a12483149400b8dfe1040b6)
@@ -43,4 +43,5 @@
 typedef struct {
 	errno_t (*read_uintptr)(void *, uintptr_t, uintptr_t *);
+	int (*printf)(const char *, ...);
 } stacktrace_ops_t;
 
@@ -51,4 +52,5 @@
 
 extern void stacktrace_print(void);
+extern void stacktrace_kio_print(void);
 extern void stacktrace_print_fp_pc(uintptr_t, uintptr_t);
 extern void stacktrace_print_generic(stacktrace_ops_t *, void *, uintptr_t,
