ssrg-vt / popcorn-compiler

Popcorn Linux compiler toolchain for heterogeneous-ISA execution
41 stars 22 forks source link

TLS alignment lead to a not aligned stack on aarch64 #14

Open mohamed-karaoui opened 6 years ago

mohamed-karaoui commented 6 years ago

When using TLS, the size of the section may lead to having a not aligned stack on aarch64: the TLS is allocated at the same time as the stack within pthread_create().

This problem is confirmed by the kernel dmesg message: "SP Alignment exception: pc=0000000000508d10 sp=00007ffff6b2a9a8"

A test that show the problem is in the "popcorn-test" repos in the "tls-test" test.

Two possible solutions: 1) Align the TLS section in the LDSCRIPT 2) Modify the musl library to make sure that the stack is aligned

rlyerly commented 6 years ago

@mohamed-karaoui is this issue now closed?

mohamed-karaoui commented 6 years ago

Not sure. I will run the test again on the last master branch, just in case.