Topic: when i execute some functions in sgx? it report error,why?

I exeuted the function such as : wolfSSL_X509_notBefore、wolfSSL_X509_notAfter、wolfSSL_X509_get_signature,it reported " Segmentation fault " why ?

Share

Re: when i execute some functions in sgx? it report error,why?

zhq0918,

Seg faults most commonly occur when the library was compiled with one configuration but the application using the library has a different configuration. Yesterday I had recommended you add a setting to the Linux SGX makefile, please add the same define to the wolfssl-examples/SGX_Linux/sgx_t.mk and sgx_u.mk to ensure the application is configured the same as the library.

Warm Regards,

K

3 (edited by zhq0918 2019-05-19 23:21:36)

Re: when i execute some functions in sgx? it report error,why?

Hi @Kaleb, thank you for your answer.I have added the "-DKEEP_PEER_CERT -DSESSION_CERTS -DOPENSSL_ALL" to the Wolfssl_C_Extra_Flags in sgx_t.mk and when i make the lib which named libwolfssl.sgx.static.lib.a, but the same error which name Segmentation fault reported again.
Regards
zhq0918

Share

Re: when i execute some functions in sgx? it report error,why?

Hi @zhq0918,

If the seg fault is not due to misconfiguration the next thing to check is dereferencing a NULL variable in any way IE let's say a malloc failed and a variable wasn't checked against NULL after the malloc but application code later uses the variable which was never allocated.

If that proves not to be the case check for variable use after a free IE a variable was malloced, used, freed, used again (after the free).

A third thing to check is reading out of bounds IE is there any application code that accesses or modifies memory outside of a variable (buffer overflow/underflow).

Last thing to check is your stack and heap inside the enclave. If the stack and heap are colliding one could be over-writing the other causing corruptions in either stack or heap which can result in a segmentation fault.


Regards,

K

5 (edited by zhq0918 2019-06-03 16:36:43)

Re: when i execute some functions in sgx? it report error,why?

Ok,thank you @Kaleb ,  I have tried again as you said.The problem has been resolved.
Regards
zhq0918

Share