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

Triggering Ecall multiple times results Segmentation fault on 2.1.3/2.3 sdk

New Contributor I

In 2.1.3/2.3 sdk , observed that if I trigger a ecall multiple times by external application ( 20 times or so), "Segmentation fault (core dumped)" happens. Following is the signature of the ecall that I tried to trigger multiple times by external program. 

public void ecall_test([in, size=20480] char *in1, int len, [out, size=20480] char *out1, [out] int *out2)

Noticed that in/out size has dependency on number of times ecall can be triggered before the Segmentation fault. 
The user guide says "automatically allocates space on the trusted stack to hold a copy of the structure" ,  Dose not the bridge routine that allocates memory frees up the memory when ecall ends/returns? If this is a problem ,then  what is the solution? 

Used following config for enclave
If I reduce the size from 20480 to 2048, 
    <!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
tcs_num 10, tcs_max_num 10, tcs_min_pool 1
The required memory is 4173824B.

0 Kudos
0 Replies