summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-01-13 17:04:12 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-01-14 08:52:44 +0100
commit32a699ef11325c322ccd6045de1169f670ae976e (patch)
tree1b864e5a8b10efbfee17562e3037c405e3837a64 /include
parent133fc03a8aac694d2d96d8e1de30467930a67bc9 (diff)
downloadbarebox-32a699ef11325c322ccd6045de1169f670ae976e.tar.gz
barebox-32a699ef11325c322ccd6045de1169f670ae976e.tar.xz
tlsf: dump stack on assertion failure
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@pengutronix.de> Link: https://lore.barebox.org/20220113160414.3943151-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/tlsf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/tlsf.h b/include/tlsf.h
index 7015de0eb5..161176d5ac 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)