Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LD_LIBRARY_PATH set for MultiMC leaks to other processes #1389

Closed
peterix opened this issue Jan 4, 2016 · 5 comments
Closed

LD_LIBRARY_PATH set for MultiMC leaks to other processes #1389

peterix opened this issue Jan 4, 2016 · 5 comments
Labels
Milestone

Comments

@peterix
Copy link
Member

peterix commented Jan 4, 2016

This is an issue because processes started from MultiMC will use its libraries - and if the ABI is not compatible, these processes will fail.

Solution: remove LD_LIBRARY_PATH and use RPATH instead.

@peterix peterix added this to the 0.4.8 milestone Jan 4, 2016
@peterix peterix added bug ready and removed ready labels Jan 4, 2016
@peterix
Copy link
Member Author

peterix commented Jan 4, 2016

Same should - somehow - happen for QT_PLUGIN_PATH and QT_FONT_PATH. Both are set in the runner script on linux.

See:
http://www.tripleboot.org/?p=536

@peterix
Copy link
Member Author

peterix commented Jan 4, 2016

Also:
http://www.tripleboot.org/?p=138

This is a treasure trove of Qt workarounds. Gotta love it.

@peterix
Copy link
Member Author

peterix commented Jan 4, 2016

So, using RPATH is hard, because it doesn't work for the Qt plugins we are dragging along.

The other option - changing the environment of started processes - is hacky.
It is necessary to change the environment of the parent process. This means something along the lines of:

  • change environment to not include LD_* and QT_*, or to take them from the original system env.
  • hope for no race conditions
  • run a detached process
  • change the environment back

It is impossible to detach an already started process: https://bugreports.qt.io/browse/QTBUG-9328

The remaining options:

  • fork QProcess and fix it
  • rewrite parts of QProcess and do not include the bugs

It's all hacky.

peterix added a commit that referenced this issue Jan 5, 2016
Essentially do not pass some environment variables to subprocesses:
* LD_PRELOAD
* LD_LIBRARY_PATH
* LD_DEBUG
* QT_PLUGIN_PATH
* QT_FONTPATH
@peterix
Copy link
Member Author

peterix commented Jan 5, 2016

Should be fixed now in develop.

@peterix
Copy link
Member Author

peterix commented Jan 5, 2016

Ended up forking and messing with the env in the forked process... It's a bit slower, but should be foolproof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant