Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Elephant
Beginner
139 Views

free() Doesn't Work with TCMalloc Library

Hi,

I was wondering if anyone was having memory leak issues because of the TCMalloc library?  If so, how did you resolve the issue?  Basically, I created a basic ecall function to test the malloc feature and looped to that ecall function multiple times, after some loops, I couldn't allocate anymore.  So I think the free() function doesn't really free the enclave heap.

void ecall_test_function()
{
    uint8_t *data = (uint8_t *)malloc(1024*16);
    if (!data) return -1;
    printf("data successfully allocated.");
    free(data);  // this has the same effect when it is commented out
}

My max heap size is set to 0xF00000, and I just had to loop to this function ~500 times to hit the error condition.

Are there similar experiences?  

Kind Regards,
- Elephant

 


 

0 Kudos
2 Replies
139 Views

What SGX + OS versions are you seeing this issue in?

Thanks,
Francisco

Elephant
Beginner
139 Views

@Francisco C., sorry for replying a bit too late, but I did not use the TCMalloc for the time being because of this issue.  But, the SDK version I was using was 2.5 and I am seeing this issue in both Ubuntu 16.04 and Ubuntu 18.04.

 

- elephant

Reply