Mark StaticMata as FOLLY_EXPORT (#1533)
Summary: When using folly::ThreadLocal<> to create thread-local variables, if a thread-local is set from two different libraries which are compiled with -fvisibility=hidden and using libc++, then a nullptr dereference is seen when attempting to set the thread-local from the second DLL. This is due to StaticMetaBase (which should be a singleton) getting created twice. This results in the thread local metadata getting corrupted and hence attempting to dereference a nullptr. Fix by marking StaticMeta as FOLLY_EXPORT, so only a single instance exists at runtime. Fixes https://github.com/facebook/folly/issues/1431 Pull Request resolved: https://github.com/facebook/folly/pull/1533 Reviewed By: yfeldblum Differential Revision: D26818467 Pulled By: Orvid fbshipit-source-id: 6b22627bc51060260e653885bdeb0df111207617
Showing
Please register or sign in to comment