Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42500

QProcess::start() secretly adds LD_LIBRARY_PATH on *nix

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P4: Low P4: Low
    • 6.5.0 Beta1
    • 5.3.2
    • Documentation
    • None
    • linux
    • f514ed7d76 (qt/qtbase/dev) f514ed7d76 (qt/tqtc-qtbase/dev)

      Prerequisites:

      Parent process does have LD_LIBRARY_PATH set. Create a QProcess and set its env to a set of variables that does not include LD_LIBRARY_PATH.

      What happens:

      LD_LIBRARY_PATH is silently added by QProcess::start(), because the parent process has it set and it is not set top empty string in the env.

      What should happen:

      No surprises and no LD_LIBRARY_PATH in the child process. I would expect that the environment I set for the QProcess is final and nothing is added to it by the library.

      If this would break existing code, at the very least, this should be documented.

      Details

      Apparently, this was a convenience added by Qt 3. See:
      http://manpages.ubuntu.com/manpages/natty/man3/qprocess.3qt.html

      I see no mention of LD_LIBRARY_PATH being inherited from the parent process in the current documentation. The `convenience' stayed, the documentation got lost.

        For Gerrit Dashboard: QTBUG-42500
        # Subject Branch Project Status CR V

            thiago Thiago Macieira
            peterix Petr Mrazek
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes