intel / intel/confidential-computing.sgx.sdk
sgx_emmt shows 0KB
- Dominant language
- C++
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Related to closed issue intel/confidential-computing.sgx#136
I have a mbed-sgx server(multi-threaded) that sets up the ssl context inside enclave and the infinite loop to accept connection runs at the app and does some analysis inside the enclave. It stops on SIGINT signal.
Related Server code snippet.
```
std::signal(SIGINT, exitGraceful);
do {
std::this_thread::sleep_for (std::chrono::seconds(1));
if (quit.load()) {
cerr << "APP: Ctrl-C/SIGINT passed.\n" << endl;
break;
}
mbedtls_net_accept(&listen_fd, &client_fd, NULL, 0, NULL);
} while(true);
mbedtls_printf("APP: About to exit\n");
sgx_destroy_enclave(eid);
return (ret);
}
```
So I wanted to calculate max stack size and heap size. I did this:
**Terminal 1:**
run my server
**Terminal 2:**
run sgx-gdb
```
enable sgx_emmt
attach 3975(pid of my server )
continue &
```
**Terminal 3:**
I send a request to the server and the server send reponse.
Now, on Terminal 1, I press Ctrl+C, nothing happens and the server does not exits but gdb on terminal 1 prints:
```
Thread 1 "osn_server" received signal SIGINT, Interrupt.
0x00007f4ffbc7fc1d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
84 in ../sysdeps/unix/syscall-template.S
```
After that on gdb I do:
`signal 2 `
and now my server terminates and gdb prints
```
Enclave: "/home/roshan/thesis/osn_server/sgx/enclave_enclave/enclave.signed.so"
[Peak stack used]: 0 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.
remove-symbol-file -a 139978543850752
[Inferior 1 (process 3975) exited normally]
```
If I do not do [Terminal 1, I press Ctrl+C] and directly write **signal 2** in gdb, nothing happens to the server and it continues to run and gdb prints:
`Cannot execute this command without a live selected thread.`
Why the stack size prints 0KB and the how I get peak heap used. Am I doing the things in the correct way?
PS: I am using SIM mode.
Contributor guide
Assessment
This issue has not been assessed yet.