FNET mempool corruption

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FNET mempool corruption

514 Views
paul1962
Contributor I

Hello,

 

I've had problems with corruption of the fnet mempool when all the memory gets allocated.

I managed to recreate the problem by doing the following...

 

1. initialise the mempool with a small amount of memory 16 byte aligned
2. The 1st call to fnet_mempool_free_mem_status returns 992
3. malloc 800 bytes
4. The 2nd call to fnet_mempool_free_mem_status returns 176 as expected.
5. allocate 160 bytes, it returns a valid pointer
6. The 3rd call to fnet_mempool_free_mem_status returns 176 which is wrong as there isn't any memory left
7. Free the memory allocated in step 3
8. The 4th call to fnet_mempool_free_mem_status returns 992 which is wrong because the memory allocated in step 5 is still allocated.

 

I only noticed this as I had to drastically cut back on the amount of memory available to FNET on my test system.

 

Before I start digging deeper I wondered if anyone else experienced the above ?

 

(The rest of the stack isn't running during the above test)

 

Thanks

Dec

Labels (1)
0 Kudos
1 Reply

372 Views
paul1962
Contributor I

Above has been traced to a fault in the alloc/free routines in fnet_mempool.c

Maybe it's only a problem for those with limited memory.

If anyone is interested I'll post details when I'm next back at work.

0 Kudos