Closed
Description
Version: 10.15.0, master
Platform: Darwin 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64
Subsystem: native addons
When the two copies of an addon are loaded into the same process on OSX, their symbols overlap. That is, two symbols that have the same name receive the same address. This can result in a segfault if the symbol is a global static data item and both copies of the addon make use of it oblivious to one another.
There's a PR against node-gyp which seeks to introduce -fvisibility=hidden
for building native addons on OSX. It includes a unit test which makes sure that symbols in each copy of an addon get distinct addresses.