Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Using tcmalloc library in enclave

MYEONGSU__KIM
Beginner
242 Views

Hi,

I'm trying to use tcmalloc library in enclave. I also saw the references and succeed to build enclave

But, I think free() does not work well... Is there any version that free() does not work well? I use 2.7 version of sdk

Also, I wonder that  what is difference between sgx_tcmalloc.a and sdk/gperftools/tcmalloc.a ? I just saw sgx_tcmalloc.a in references..

Thanks.!

0 Kudos
3 Replies
JesusG_Intel
Moderator
242 Views

Hello Kim,

There is no difference between sgx_tcmalloc and gperftools tcmalloc. Did you follow these instructions for Linux?  Please explain why you think that free() does not work well.

Regards,

Jesus

MYEONGSU__KIM
Beginner
242 Views

 int * resultarray = (int*)malloc(4 * 250000);

free(resultarray);

 

Upon code is the summary of my code, and I increase max heap,stack size to 0x2000000. The program runs normally for about 11 times ,but after that , segmentation fault is occured. and somtimes sgx_error 0x0003(out of mem)

 

Here is somepart of Makefile. I also insert tcmalloc before "start group" things...

-Wl,--whole-archive -l$(SGX_TRTS) -Wl,--no-whole-archive \
        -Wl,--whole-archive -lsgx_tcmalloc -Wl,--no-whole-archive \                                         
        -Wl,--whole-archive -lsgx_tsgxssl -Wl,--no-whole-archive \

MYEONGSU__KIM
Beginner
242 Views

Oops.. I'm really sorry... That was totally my fault...
Thank you for your help!!!

Reply