diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-05-23 08:27:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-05-24 09:03:08 +0200 |
commit | d08f27e2ca9535471b547e1928a3199983aac712 (patch) | |
tree | 7a3196a1e289d8cd291bdf936040bccf73089cc3 /common/tlsf.c | |
parent | 29344918a24791ebd149d6980dc3ed68cba55603 (diff) | |
download | barebox-d08f27e2ca9535471b547e1928a3199983aac712.tar.gz barebox-d08f27e2ca9535471b547e1928a3199983aac712.tar.xz |
test: self: add basic testing for malloc()
Surprisingly, the TLSF allocator is prone to overflow. Add some tests
that trigger this behavior. These tests run to success with dlmalloc,
but some of them fail under tlsf when compiled for 32-bit:
test_malloc:40: unexpectedly succeeded to malloc(SIZE_MAX)
test_malloc:61: unexpectedly succeeded to (tmp = realloc(p, 0xf0000000))
test_malloc:63: unexpectedly succeeded to tmp = realloc(p, SIZE_MAX)
ERROR: malloc: failed 3 out of 12 tests
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220523062756.774153-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/tlsf.c')
0 files changed, 0 insertions, 0 deletions