[PATCH 1/3] tlsf: dump stack on assertion failure
Ahmad Fatoum
a.fatoum at pengutronix.de
Sat Jan 8 09:14:24 PST 2022
We only support AddressSanitizer on ARM, ARM64 and sandbox. For other
platforms TLSF assertions may detect some nconsistency, like some double
frees. Make the reports more useful by dumping stack in that case.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
include/tlsf.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/tlsf.h b/include/tlsf.h
index 7015de0eb525..161176d5ac84 100644
--- a/include/tlsf.h
+++ b/include/tlsf.h
@@ -42,9 +42,12 @@
extern "C" {
#endif
+#include <printk.h>
+
#define tlsf_assert(expr) do { \
if (unlikely(!(expr))) { \
printf(#expr "%s %d\n", __FILE__, __LINE__); \
+ dump_stack(); \
} \
} while (0)
--
2.30.2
More information about the barebox
mailing list