insane-adding-machines / frosted

Frosted: Free POSIX OS for tiny embedded devices
GNU General Public License v2.0
215 stars 39 forks source link

[malloc] corrupted malloc_block list #49

Closed danielinux closed 8 years ago

danielinux commented 8 years ago

possibly due to concurrency, the malloc_block[] list array may end up containing invalid entries in the tail (wrong last ->next pointer?)

danielinux commented 8 years ago

@maximevince cannot find the root cause. Seems to happen on both kernel and user pool. Somewhat an internal operation is corrupting the "->next" pointer for the last block. Workaround for now is checking if blk->magic is valid while visiting the list.

brabo commented 8 years ago

Workaround is not working on my end. (F429i-disco)

danielinux commented 8 years ago

@maximevince is investigating on the issue. Perhaps we can change the malloc design a bit (e.g. do we need f_compact after every free?). Most likely there is a critical section we are not taking into account in one of the operations (free, split, merge, compact).

danielinux commented 8 years ago

Fixed in eed4d79

brabo commented 8 years ago

:+1: