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

getRelocatablePrefix stuck in a dead loop on ArchLinux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.7, 6.4.2
    • Core: Other
    • None
    • distro: ArchLinux
      hardware: amd64
      Qt5 Version: 5.15.8+kde+r181-1
      Qt6 Version: 6.4.2-1
    • Linux/Wayland, Linux/X11

    Description

      On ArchLinux, Qt is configured with the relocatable feature.

      In QlibraryInfo.cpp, if the cdUp function call fails and prefixPath is not root, the program will not be able to exit the loop.

      #if defined(Q_OS_LINUX) && !defined(QT_STATIC) && defined(__GLIBC__)
      const QString libdir = QString::fromLocal8Bit(   qt_configure_strs.viewAt(QLibraryInfo::LibrariesPath - 1));
      QDir prefixDir(prefixPath);
      while (!prefixDir.exists(libdir)) {
          prefixDir.cdUp(); // failed, prefixDir will not be changed   
          prefixPath = prefixDir.absolutePath();        
          if (prefixDir.isRoot()) { // dead loop
              prefixPath.clear();            
              break;        
          }
      }
      #endif
      

      My suggestion for this case is to determine if the cdUp call was successful:

      while (!prefixDir.exists(libdir)) { 
          if(prefixDir.cdUp()){ // Avoiding a dead loop
              prefixPath.clear();
              break;
          }
          prefixPath = prefixDir.absolutePath();        
          if (prefixDir.isRoot()) {
              prefixPath.clear();            
              break;        
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            comixhe yuming he
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes