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

Plugins available via multiple paths are loaded without RTLD_NODELETE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0 FF
    • 6.5.0
    • Core: Plugins
    • None
    • Linux/X11
    • 666ce51d4 (dev)
    • Foundation Sprint 84

      Normally Qt seems to load plugins on Linux with RTLD_NODELETE flag set. But when the a plugin is available via multiple paths (via symlinks) this flag is not set.

      This results in differences in linker debug output (LD_DEBUG=files):

      834d833
      <       activating NODELETE for /home/iemeshch/repos/build-qt5/qtbase/plugins/platformthemes/libqgtk3.so [0]
      1228a1228,1229
      > 
      >       file=/home/iemeshch/repos/build-qt5/qtbase/plugins/platformthemes/libqgtk3.so [0];  destroying link map
      

      I'm not sure jet whether there are any more serious problems with this, but I also don't think that this behavior is intentional. This is easier to reproduce with NixOS, but it is not required (replace Qt build path, this assumes dev build):

      $ mkdir build
      $ cd build
      $ <qt-build-path>/qtbase/bin/qt-cmake ..
      $ make
      $ mkdir -p plugins/platformthemes/
      $ ln -s <qt-build-path>/qtbase/plugins/platformthemes/libqgtk3.so plugins/platformthemes
      $ LD_DEBUG=files QT_QPA_PLATFORMTHEME=gtk3 QT_PLUGIN_PATH=$PWD/plugins  ./simple-crash
      

      I'm attaching the test program and two filtered outputs: with and without QT_PLUGIN_PATH.

        1. CMakeLists.txt
          0.6 kB
        2. main.cpp
          0.1 kB
        3. one-path.txt
          44 kB
        4. two-paths.txt
          44 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ievgenii.meshcheriakov Ievgenii Meshcheriakov
            ievgenii.meshcheriakov Ievgenii Meshcheriakov
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes