nwnxee / unified

Binaries available under the Releases tab on Github
https://nwnxee.github.io/unified
GNU General Public License v3.0
128 stars 91 forks source link

Clean NWNX binaries from LD_PRELOAD. #1711

Closed jhett12321 closed 7 months ago

jhett12321 commented 7 months ago

NWNX is loaded/injected on linux by specifying the "LD_PRELOAD" environment variable before starting the server.

This has the unintended side effect of causing all child processes spawned by NWNX plugins to inherit LD_PRELOAD and attempt to preload NWNX_Core.so again, causing these processes to immediately crash

If NWNX attempts to load outside of the nwn process, it will immediately throw a linker error:

symbol lookup error: /nwn/nwnx/NWNX_Core.so: undefined symbol: _ZN11CAppManager12CreateServerEv

This PR adds a workaround that will remove all entries with a NWNX_ prefix from the process level environment variables. User and system environment variables should remain untouched.