Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

free() Doesn't Work with TCMalloc Library

Elephant
Beginner
1,055 Views

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
Francisco_C_Intel
1,055 Views

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

Thanks,
Francisco

0 Kudos
Elephant
Beginner
1,055 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

0 Kudos
Reply