You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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.
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 prints
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.
The text was updated successfully, but these errors were encountered: