Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/c/generic/assert.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -41,5 +41,17 @@
 static atomic_t failed_asserts = {0};
 
-void assert_abort(const char *cond, const char *file, unsigned int line)
+void __helenos_assert_quick_abort(const char *cond, const char *file, unsigned int line)
+{
+	/*
+	 * Send the message safely to kio. Nested asserts should not occur.
+	 */
+	kio_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
+	    cond, file, line);
+	
+	/* Sometimes we know in advance that regular printf() would likely fail. */
+	abort();
+}
+
+void __helenos_assert_abort(const char *cond, const char *file, unsigned int line)
 {
 	/*
Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/c/generic/malloc.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -33,4 +33,6 @@
 /** @file
  */
+
+#define _HELENOS_SOURCE
 
 #include <malloc.h>
@@ -196,20 +198,5 @@
 static futex_t malloc_futex = FUTEX_INITIALIZER;
 
-#ifndef NDEBUG
-
-#define malloc_assert(expr) \
-	do { \
-		if (!(expr)) {\
-			heap_unlock(); \
-			assert_abort(#expr, __FILE__, __LINE__); \
-		} \
-	} while (0)
-
-#else /* NDEBUG */
-
-#define malloc_assert(expr)
-
-#endif /* NDEBUG */
-
+#define malloc_assert(expr) safe_assert(expr)
 
 #ifdef FUTEX_UPGRADABLE
Index: uspace/lib/c/include/assert.h
===================================================================
--- uspace/lib/c/include/assert.h	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/c/include/assert.h	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -34,8 +34,20 @@
  */
 
+// XXX: The definition of `assert()` is not guarded.
+// One must not use `#pragma once` in this header.
+// This is in accordance with the C standard.
+
 #ifndef LIBC_ASSERT_H_
 #define LIBC_ASSERT_H_
 
 #define static_assert(expr)	_Static_assert(expr, "")
+
+extern void __helenos_assert_abort(const char *, const char *, unsigned int)
+    __attribute__((noreturn));
+
+extern void __helenos_assert_quick_abort(const char *, const char *, unsigned int)
+    __attribute__((noreturn));
+
+#endif
 
 /** Debugging assert macro
@@ -49,22 +61,23 @@
  */
 
+#undef assert
+
 #ifndef NDEBUG
+	#define assert(expr) ((expr) ? (void) 0 : __helenos_assert_abort(#expr, __FILE__, __LINE__))
+#else
+	#define assert(expr) ((void) 0)
+#endif
 
-#define assert(expr) \
-	do { \
-		if (!(expr)) \
-			assert_abort(#expr, __FILE__, __LINE__); \
-	} while (0)
+#ifdef _HELENOS_SOURCE
 
-#else /* NDEBUG */
+#undef safe_assert
 
-#define assert(expr)
+#ifndef NDEBUG
+	#define safe_assert(expr) ((expr) ? (void) 0 : __helenos_assert_quick_abort(#expr, __FILE__, __LINE__))
+#else
+	#define safe_assert(expr) ((void) 0)
+#endif
 
-#endif /* NDEBUG */
-
-extern void assert_abort(const char *, const char *, unsigned int)
-    __attribute__((noreturn));
-
-#endif
+#endif /* _HELENOS_SOURCE */
 
 /** @}
Index: uspace/lib/posix/include/posix/assert.h
===================================================================
--- uspace/lib/posix/include/posix/assert.h	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2011 Jiri Zarevucky
- * 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 libposix
- * @{
- */
-/** @file Program assertion.
- */
-
-/* NO include guard on purpose. */
-
-#include "libc/assert.h"
-
-#undef assert
-
-#ifndef NDEBUG
-	#define assert(expr) ((expr) ? (void) 0 : assert_abort(#expr, __FILE__, __LINE__))
-#else
-	#define assert(expr) ((void) 0)
-#endif
-
-/** @}
- */
Index: uspace/lib/posix/source/fnmatch.c
===================================================================
--- uspace/lib/posix/source/fnmatch.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/fnmatch.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -49,5 +49,5 @@
 #include "posix/string.h"
 #include "posix/stdlib.h"
-#include "posix/assert.h"
+#include <assert.h>
 
 #include "internal/common.h"
Index: uspace/lib/posix/source/pwd.c
===================================================================
--- uspace/lib/posix/source/pwd.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/pwd.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -40,5 +40,5 @@
 #include "posix/string.h"
 #include <errno.h>
-#include "posix/assert.h"
+#include <assert.h>
 
 static bool entry_read = false;
Index: uspace/lib/posix/source/stdio.c
===================================================================
--- uspace/lib/posix/source/stdio.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/stdio.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -40,5 +40,5 @@
 #include "posix/stdio.h"
 
-#include "posix/assert.h"
+#include <assert.h>
 
 #include <errno.h>
Index: uspace/lib/posix/source/stdio/scanf.c
===================================================================
--- uspace/lib/posix/source/stdio/scanf.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/stdio/scanf.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -36,5 +36,5 @@
 #define __POSIX_DEF__(x) posix_##x
 
-#include "posix/assert.h"
+#include <assert.h>
 
 #include <errno.h>
Index: uspace/lib/posix/source/stdlib/strtold.c
===================================================================
--- uspace/lib/posix/source/stdlib/strtold.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/stdlib/strtold.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -40,5 +40,5 @@
 #include "posix/stdlib.h"
 
-#include "posix/assert.h"
+#include <assert.h>
 #include "posix/ctype.h"
 #include "posix/stdint.h"
Index: uspace/lib/posix/source/string.c
===================================================================
--- uspace/lib/posix/source/string.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/string.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -40,5 +40,5 @@
 #include "posix/string.h"
 
-#include "posix/assert.h"
+#include <assert.h>
 
 #include <errno.h>
Index: uspace/lib/posix/source/sys/wait.c
===================================================================
--- uspace/lib/posix/source/sys/wait.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/sys/wait.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -41,5 +41,5 @@
 
 #include "libc/task.h"
-#include "posix/assert.h"
+#include <assert.h>
 
 #include <errno.h>
Index: uspace/lib/posix/source/time.c
===================================================================
--- uspace/lib/posix/source/time.c	(revision 13dc048ab1b8dfe020d96582cf64de71305f3834)
+++ uspace/lib/posix/source/time.c	(revision e8d3c6f55fdb9a5a1e2e4d95612cb04c4ea82652)
@@ -45,5 +45,5 @@
 
 #include "posix/signal.h"
-#include "posix/assert.h"
+#include <assert.h>
 
 #include "libc/async.h"
