Open gmatesunny opened 6 years ago
sgx_destroy_enclave
must be called to get stack and heap usage. It seem that the server is terminated without destroy the enclave. You can add a signal handler to destroy the enclaves that you want to measure when SIGINT received.
I have added signal handler as well as sgx_destroy_enclave call.
std::signal(SIGINT, exitGraceful); sgx_destroy_enclave(eid);
Related to closed issue #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.
So I wanted to calculate max stack size and heap size. I did this: Terminal 1: run my server Terminal 2: run sgx-gdb
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:
After that on gdb I do:
signal 2
and now my server terminates and gdb printsIf 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.