Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when executing logger #1

Open
gyh2016 opened this issue Mar 18, 2019 · 4 comments
Open

Segmentation fault when executing logger #1

gyh2016 opened this issue Mar 18, 2019 · 4 comments

Comments

@gyh2016
Copy link

gyh2016 commented Mar 18, 2019

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
Copy link
Member

envy commented Mar 18, 2019

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
Copy link

bronzeMe commented Mar 26, 2019

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

  • `[CEnclavePool /home/xxx/Downloads/linux-sgx-master/psw/urts/enclave.cpp:566] enter CEnclavePool constructor
  • === Initializing sgx-perf
  • (i) Enabled AEX counting
  • (i) Enabled AEX counting
  • (i) Enabled AEX tracing
  • (i) Enabled EPC page tracing, this needs root permissions
  • /i\ AEP patched
  • === Done initializing
  • [build_secs /home/xxx/Downloads/linux-sgx-master/psw/urts/loader.cpp:477] enclave start address = 0x7fe9fa000000, size = 0x1000000
  • Caught signal 11
  • Fault address is 0
  • Forwarding signal
  • Caught signal 11
  • Fault address is 0x7ffc17f71a40
  • Forwarding signal
  • Caught signal 11
  • Fault address is 0x7ffc17f70f40
  • Forwarding signal
  • Caught signal 11
  • Fault address is 0x7ffc17f70400
  • Forwarding signal
  • Segmentation fault
  • `

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
Copy link
Member

envy commented Mar 26, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants