ibr-ds / sgx-perf

High-level performance analyser toolkit for Intel SGX
MIT License
39 stars 11 forks source link

Segmentation fault when executing logger #1

Open gyh2016 opened 5 years ago

gyh2016 commented 5 years ago

I follow the README building sgx-perf and execute logger, but failed because of a segmentation fault like this.

$ LD_PRELOAD=path/to/lib/liblogger.so ./app
=== Initializing sgx-perf
(i) No config file found, load defaults
=== Done initializing
Caught signal 11
Fault address is 0
Forwarding signal
Caught signal 11
Fault address is 0x3e8000073f9
Forwarding signal
Caught signal 11
Fault address is 0x3e8000073f9
(...)
Caught signal 11
Fault address is 0x3e8000073f9
Forwarding signal
Segmentation fault (core dumped)

I tried several apps but got the same result. Neither liblogger and libloggersim can execute correctly.

However, this only happens in hardware mode. Logger in simulation mode with apps built in SIM mode can execute well. Of course, apps can run without logger in hardware mode.

Can somebody tell me is there some wrong with sgx-perf or my apps?

envy commented 5 years ago

Please check if you are using the non-stripped libraries of the PSW, e.g., like so: nm -C /usr/lib/x86_64-linux-gnu/libsgx_urts.so.1.0.101.0 | grep CEnclavePool::instance Obviously, replace the path to your URTS. If this returns a symbol (e.g., 0000000000009b20 t CEnclavePool::instance()) then I need to investigate further. If not, you are using the stripped libraries and have to switch to the unstripped ones.

bronzeMe commented 5 years ago

Hi,I also meet the same problems. When I execute liblogger.so ./app,it occured Segmentation fault (core dumped) as above.

The experimental app is the Intel offical SampleEnclave. I tried liblogger.so in hardware mode. My libsgx_urts.so is non-stripped, it was compiled from souce code. file /opt/intel/sgxsdk/lib64/libsgx_urts.so /opt/intel/sgxsdk/lib64/libsgx_urts.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5e6cf2c8d6704396a103d8a842ab467a9bff1ad7, not stripped Could someone give some advice,please?

envy commented 5 years ago

Hi bronzeMe,

Your segfault seemd to be due to a bug in sgx-perf regarding AEX tracing. I pushed a fix. Can you try again please?

I also pushed checks for getting the stripped symbols.

bronzeMe commented 5 years ago

Thank you so much for your help, it works well now!!