Hang on pvPortMalloc()

My application is crashing on pvPortMalloc at
configASSERT( ( ( ( sizet ) pxNewBlockLink ) & portBYTEALIGNMENTMASK ) == 0 ); I double checked and there is still availble heap to allocate from, hwoever for some reason everything hangs at mentioned assert. I’m using heap4 alloc scheme. Are there any particular reasons why this might be happening?

Hang on pvPortMalloc()

This assert doesn’t check for an exhausted heap, it checks that your allocator satisfies the alignment requirement of the processor achitecture used. You should check check portmacro.h::portBYTEALIGNMENT and the resulting portable.h::portBYTEALIGNMENT_MASK vs. your allocator implementation.

Hang on pvPortMalloc()

I’ve checked it and it’s correct, I would assume in this case that newBlock (this is inside condition that splits blocks) is not aligned properly this condition occurs after several calls to pvPortMalloc. First few calls are ok but later on it hangs. To be honest I have no idea what’s going on. I would avoid using dynamic allocation but I have no other options in this case… Any ideas where to go next?

Hang on pvPortMalloc()

make sure you’re not calling from an ISR (including timerTick)
On Dec 20, 2016, at 2:09 PMEST, Chris conkerkh@users.sf.net wrote: I’ve checked it and it’s correct, I would assume in this case that newBlock (this is inside condition that splits blocks) is not aligned properly this condition occurs after several calls to pvPortMalloc. First few calls are ok but later on it hangs. To be honest I have no idea what’s going on. I would avoid using dynamic allocation but I have no other options in this case… Any ideas where to go next? Hang on pvPortMalloc() https://sourceforge.net/p/freertos/discussion/382005/thread/ba211d48/?limit=25#29a7 Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/ https://sourceforge.net/p/freertos/discussion/382005/ To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

Hang on pvPortMalloc()

I examined memory and turns out there was memory leak after writing to previously allocated memory. Which was the result of misalignment. Anyway thanks for help:)

Hang on pvPortMalloc()

Hello Chris, I am having same problem that you described. How you have got rid of this ? How to find memory leak? How/why misalignment is created?

Hang on pvPortMalloc()

You can track memory allocations and frees using the FreeRTOS+Trace tool.