siemens / drace

Data-race detector for windows applications - built on top of DynamoRIO
Other
39 stars 4 forks source link

make central TLS type standard-layout again #41

Closed fmoessbauer closed 4 years ago

fmoessbauer commented 4 years ago

Due to the aligned-stack (which inherits from aligned buffer), the per_thread_t is not standard layout anymore. Hence, it might be unsafe to use offsetof() on it's members. For most compilers, this should be not an issue, but we should fix that anyways.

A possible solution would be to carve out the shadow-stack and put it into it's own TLS slot.

Diagnostics (both clang and gcc-8)

drace/drace-client/src/instr/instr-mem-full.cpp:169:44: warning: offsetof within non-standard-layout type ‘drace::per_thread_t’ is conditionally-supported [-Winvalid-offsetof]
  opnd2 = OPND_CREATE_MEMPTR(reg3, offsetof(per_thread_t, buf_end));
fmoessbauer commented 4 years ago

implemented in 47ac14927edccff9b31e74b627e9e6141171abc8 (feature/dracelinux)