Has anyone noticed any abnormal behavior when using thread local storage (TLS) in the presence of atomic blocks? Is there any complication with the fact that the STM library uses TLS itself? A seg fault manifests when all the following three happen:
1. you make a call to a function foo inside a transaction.
2. function foo accesses thread local storage
3. the thread local storage object is defined in another object file that is linked against the file that has function foo.
Consider the following very simple scenario: