task_mem_map_used_get() keep decreasing even when free unallocated blocks #1972
Labels
area: Kernel
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
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)
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)
The text was updated successfully, but these errors were encountered: