sslab-gatech / opensgx

OpenSGX
Other
288 stars 80 forks source link

Problem with compiling openssl libraries to be linked in user/test/openssl/ files #47

Closed noname77 closed 8 years ago

noname77 commented 8 years ago

I am debugging an opensgx application which uses openssl library within an enclave. It works fine, but a call to ssl_get_algorithm2(s) crashes the app with:

CPU_SIGNAL_HANDLER 11
user-exec.c Called exception_action
Exception Action
Debug Raise Exception: RBP: 5029ad78   RSP: 5029aa50 EIP: 50002f77
POE_PAGE
MAPERR
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
./../sgx: line 11: 88827 Segmentation fault      $QEMU "$@"

which might be somehow related to #30

to debug further i wanted to recompile the openssl library after I included debug prints in the ssl_get_algorithm2 function.

when i try to link the newly produced (libssl.a, libcrypto.a) library files to my opensgx program it crashes straight away with:

CPU_SIGNAL_HANDLER 11
user-exec.c Called exception_action
Exception Action
Debug Raise Exception: RBP: 4000800460   RSP: 4000800460 EIP: 4042a4
POE_PAGE
MAPERR
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
./../sgx: line 11: 68674 Segmentation fault      $QEMU "$@"

which looks like the same error

i have tried increasing the NUM_EPC and HEAP_PAGE_FRAMES in each header as advised in #30 with no luck

finally my question: how were the openssl static library files in libsgx folder generated? do I need to include some specific ./Configure options to make it compatible with qemu?

so far i've simply tried

./configure
make

and change in the openssl Makefile: PROCESSOR=386

grateful for any pointers, nnm77

noname77 commented 8 years ago

it turned out compiling openssl with

./configure
make

works just fine. it must have been something in my code causing troubles.