Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision d1617158721960329b52442af00925269a6224a3)
+++ uspace/lib/c/Makefile	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -113,5 +113,6 @@
 	generic/arg_parse.c \
 	generic/sort.c \
-	generic/stats.c
+	generic/stats.c \
+	generic/assert.c \
 
 SOURCES = \
Index: uspace/lib/c/arch/ia32/include/config.h
===================================================================
--- uspace/lib/c/arch/ia32/include/config.h	(revision d1617158721960329b52442af00925269a6224a3)
+++ uspace/lib/c/arch/ia32/include/config.h	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -36,6 +36,9 @@
 #define LIBC_ia32_CONFIG_H_
 
-#define PAGE_WIDTH	12
-#define PAGE_SIZE	(1 << PAGE_WIDTH)
+#define PAGE_WIDTH  12
+#define PAGE_SIZE   (1 << PAGE_WIDTH)
+
+#define USER_ADDRESS_SPACE_START_ARCH  UINT32_C(0x00000000)
+#define USER_ADDRESS_SPACE_END_ARCH    UINT32_C(0x7fffffff)
 
 #endif
Index: uspace/lib/c/arch/ia32/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/ia32/src/stacktrace.c	(revision d1617158721960329b52442af00925269a6224a3)
+++ uspace/lib/c/arch/ia32/src/stacktrace.c	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -35,16 +35,16 @@
  */
 
+#include <libarch/config.h>
 #include <sys/types.h>
 #include <bool.h>
-
 #include <stacktrace.h>
 
-#define FRAME_OFFSET_FP_PREV	0
-#define FRAME_OFFSET_RA		4
+#define FRAME_OFFSET_FP_PREV  0
+#define FRAME_OFFSET_RA       4
 
 bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
 {
 	(void) st;
-	return fp != 0;
+	return (fp != 0) && (fp <= USER_ADDRESS_SPACE_END_ARCH);
 }
 
Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
+++ uspace/lib/c/generic/assert.c	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stacktrace.h>
+
+void assert_abort(const char *cond, const char *file, unsigned int line)
+{
+	printf("Assertion failed (%s) in file \"%s\", line %u.\n",
+	    cond, file, line);
+	stacktrace_print();
+	abort();
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision d1617158721960329b52442af00925269a6224a3)
+++ uspace/lib/c/generic/async.c	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -102,4 +102,6 @@
 #include <arch/barrier.h>
 #include <bool.h>
+#include <stdlib.h>
+#include <malloc.h>
 #include "private/async.h"
 
Index: uspace/lib/c/generic/stacktrace.c
===================================================================
--- uspace/lib/c/generic/stacktrace.c	(revision d1617158721960329b52442af00925269a6224a3)
+++ uspace/lib/c/generic/stacktrace.c	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -61,9 +61,11 @@
 	stacktrace_prepare();
 	stacktrace_print_fp_pc(stacktrace_fp_get(), stacktrace_pc_get());
+	
 	/*
 	 * Prevent the tail call optimization of the previous call by
 	 * making it a non-tail call.
 	 */
-	(void) stacktrace_fp_get();
+	
+	printf("-- end of stack trace --\n");
 }
 
Index: uspace/lib/c/include/assert.h
===================================================================
--- uspace/lib/c/include/assert.h	(revision d1617158721960329b52442af00925269a6224a3)
+++ uspace/lib/c/include/assert.h	(revision 7da90cd8fa7928635efe129eb2f8a9b8238e6a1a)
@@ -40,5 +40,5 @@
  *
  * If NDEBUG is not set, the assert() macro
- * evaluates expr and if it is false prints 
+ * evaluates expr and if it is false prints
  * error message and terminate program.
  *
@@ -47,16 +47,10 @@
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-
 #ifndef NDEBUG
 
 #define assert(expr) \
 	do { \
-		if (!(expr)) { \
-			printf("Assertion failed (%s) at file '%s', " \
-			    "line %d.\n", #expr, __FILE__, __LINE__); \
-			abort(); \
-		} \
+		if (!(expr)) \
+			assert_abort(#expr, __FILE__, __LINE__); \
 	} while (0)
 
@@ -67,4 +61,7 @@
 #endif /* NDEBUG */
 
+extern void assert_abort(const char *, const char *, unsigned int)
+    __attribute__((noreturn));
+
 #endif
 
