- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I also encounter the same problem in Ubuntu 18.08 after enabling sgx_emmt when I use the sgx-gdb for debugging my program.
It prints the stack used normally. However, the heap used cannot print normally. Please refer to the following output.
--------output---------------
[Peak stack used]: 7 KB
[Can't get peak heap used]: You may use version script to control symbol export. Please export 'g_peak_heap_used' in your version script.
[Can't get peak committed reserved memory]: You may use version script to control symbol export. Please export 'g_peak_rsrv_mem_committed' in your version script.
-----------output ---------------
Should I modify the python script ( sgx_emmt.py )?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Li_Xiaoguo,
According to the section Enclave Memory Measurement Tool of the Intel SGX Developer Reference Guide for Linux, you must export g_peak_heap_used and g_peak_rsrv_mem_committed in the version script of the enclave.
In the SGX SDK sample, SampleEnclave, the enclave version script is /SampleEnclave/Enclave/Enclave.lds and its content is:
enclave.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
g_peak_heap_used;
g_peak_rsrv_mem_committed;
local:
*;
};
The Makefile must reference the version scrypt and define the symbol __ImageBase, similar to:
$ ld -o enclave.so file1.o file2.o \
-pie -eenclave_entry -nostdlib -nodefaultlibs –nostartfiles --no-undefined \
--whole-archive –lsgx_trts --no-whole-archive \
--start-group –lsgx_tstdc ––lsgx_tservice -lsgx_crypto -
-end-group \
-Bstatic -Bsymbolic --defsym=__ImageBase=0 --exportdynamic \
--version-script=enclave.lds
The SampleEnclave provided in the SGX SDK already has all of this in place so you can reuse its Makefile and version script.
Sincerely,
Jesus G.
Intel Customer Support
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Li_Xiaoguo,
According to the section Enclave Memory Measurement Tool of the Intel SGX Developer Reference Guide for Linux, you must export g_peak_heap_used and g_peak_rsrv_mem_committed in the version script of the enclave.
In the SGX SDK sample, SampleEnclave, the enclave version script is /SampleEnclave/Enclave/Enclave.lds and its content is:
enclave.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
g_peak_heap_used;
g_peak_rsrv_mem_committed;
local:
*;
};
The Makefile must reference the version scrypt and define the symbol __ImageBase, similar to:
$ ld -o enclave.so file1.o file2.o \
-pie -eenclave_entry -nostdlib -nodefaultlibs –nostartfiles --no-undefined \
--whole-archive –lsgx_trts --no-whole-archive \
--start-group –lsgx_tstdc ––lsgx_tservice -lsgx_crypto -
-end-group \
-Bstatic -Bsymbolic --defsym=__ImageBase=0 --exportdynamic \
--version-script=enclave.lds
The SampleEnclave provided in the SGX SDK already has all of this in place so you can reuse its Makefile and version script.
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page