-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Reported by Sharron LIU:
In extensive test against task_mem_map_used_get(), below four cases were checked, failed in case #4.
case #1: verify mmap used get after allocation succeed
case #2: verify mmap used get after allocation failed (e.g. no free blocks)
case #3: verify mmap used get after free allocated blocks
case #4: verify mmap used get after free un-allocated blocks (e.g. freed blocks are free again)
how-to-reproduce (attached test case)
# source zephyr-env.sh
# make -C test_mmap_api_used_get pristine
# make -C test_mmap_api_used_get flash
verify test case failed at main@103 "mmap: used get failed after free unallocated blocks".
user impact
Zephyr application run in multi-thread contexts, and memory alloc/free can be done from different threads. And it likely happen that app try to request memory when no free blocks are available, or a memory block is freed twice or more. "task_mem_map_used_get()" should report correct status in the above two cases, and grantee successive alloc/free are handled with correct "amount of used blocks". Or at least make it convenient for debugging, raise an assertion when app try to free an un-allocated block.
(Imported from Jira ZEP-418)