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

Local path information is baked into Qt5Core.dll causing very hard to reproduce crashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.1.0 RC1
    • Fix Version/s: 5.1.1
    • Component/s: Core: Plugins
    • Labels:
      None
    • Environment:
      Windows
    • Commits:
      Message box fix: 7ead3a39c71949e28d682f893f8b4037e25d7259

      Description

      I installed 5.1.0 RC1 Snapshot after previously using 4.7.4 and encountered quite a serious problem which seems to be caused by a few seemingly minor issues working together. The results were quite serious and I believe it may affect many other users of Qt on Windows.

      Our usual build process is to compile in Visual Studio, test a Release EXE locally, and then deploy to users with QtCore/QtGui DLLs in the same directory. I tested locally, committed the new tool and DLLs and left for the night thinking I had tested it thoroughly, only to find that no-one could run the tool the next morning!

      There was no error message, the application simply failed to launch.

      Using Process Monitor we found it was searching for platforms/qwindows.dll but I couldn't understand why I hadn't spotted that locally in my testing. I used Process Hacker and found that the tool was actually loading qwindows.dll directly from my original Qt installation directory!

      I searched for environment variables, and even through the registry to find out how the application 'knew' where my Qt installation directory was. Eventually I found using cygwin and 'strings' that my Qt installation directory was baked into Qt5Core.dll directly! I was very surprised by this.

      Here is what I found:
      Qt5Core.dll: qt_prfxpath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010
      Qt5Core.dll: qt_docspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\doc
      Qt5Core.dll: qt_hdrspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\include
      Qt5Core.dll: qt_libspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\lib
      Qt5Core.dll: qt_lbexpath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\libexec
      Qt5Core.dll: qt_binspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\bin
      Qt5Core.dll: qt_plugpath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\plugins
      Qt5Core.dll: qt_impspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\imports
      Qt5Core.dll: qt_qml2path=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\qml
      Qt5Core.dll: qt_adatpath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010
      Qt5Core.dll: qt_datapath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\
      Qt5Core.dll: qt_trnspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\translations
      Qt5Core.dll: qt_xmplpath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\examples
      Qt5Core.dll: qt_tstspath=D:\Qt\Qt5.1.0\5.1.0-rc1\msvc2010\tests

      Since other people are likely to hit the same problem, I would strongly suggest fixing a few of these issues:

      • Don't bake local paths into DLLs by default, use only relative paths (or perhaps an environment variable?)
      • If qwindows.dll cannot be found, maybe provide feedback to the user instead of just exiting

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              davehampson Dave Hampson
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes