Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    DLL trouble

    General and Desktop
    dll release segmentation fault
    2
    10
    3177
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Nio_x last edited by Nio_x

      Sup. I have some problems with DLL loading by QtCreator. If I run my program from QtCreator, it crashes with segmentation fault. But if I run my program manually, everything looks fine. Also everything looks fine in debug mode. I have troubles only with release. Any suggestions?
      Here is my .pro file: screenshot

      1 Reply Last reply Reply Quote 0
      • JKSH
        JKSH Moderators last edited by

        Hi, and welcome to the Qt Dev Net!

        You could be accidentally loading different DLLs. Use Sysinternals ListDLLs to check: https://technet.microsoft.com/en-us/sysinternals/bb896656.aspx?f=255&MSPPError=-2147217396

        1. Run your program manually.
        2. While your program is running, use ListDLLs to see which DLLs your program has loaded.
        3. Close your program.
        4. Run your program from Qt Creator.
        5. While your program is running (or when the crash dialog is showing), use ListDLLs to see which DLLs your program has loaded.

        Are they the same?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        N 1 Reply Last reply Reply Quote 1
        • N
          Nio_x @JKSH last edited by

          @JKSH

          Debug version:
          0x000000006e580000 0x1f9000 C:\Users\nio_x\Documents\qtProjects\nioEngine\build\debug\nioEngine.dll
          Verified: Unsigned
          Publisher: n/a
          Description: n/a
          Product: n/a
          Version: n/a
          File version: n/a

          Release version launched from QtCreator:
          0x00000000629c0000 0xe9000 C:\Users\nio_x\Documents\qtProjects\nioEngine\build\release\nioEngine.dll
          Verified: Unsigned
          Publisher: n/a
          Description: n/a
          Product: n/a
          Version: n/a
          File version: n/a
          Create time: Sat Jul 10 11:37:36 1971

          Release version launched manually:
          0x00000000629c0000 0xe9000 C:\Users\nio_x\Documents\qtProjects\nioEngine\build\release\nioEngine.dll
          Verified: Unsigned
          Publisher: n/a
          Description: n/a
          Product: n/a
          Version: n/a
          File version: n/a
          Create time: Sat Jul 10 11:37:36 1971

          Engine DLLs are the same.

          N 1 Reply Last reply Reply Quote 0
          • N
            Nio_x @Nio_x last edited by Nio_x

            If you need full output, here is release version launched from QtCreator, and here is release version launched manually. I realized that QtCreator loads MinGW DLLs that comes with Qt SDK instead of my own MinGW distro, and it may be root of the problem.
            But here is debug version launched from QtCreator, and it seems that QtCreator loads it own MinGW DLLs, but program doesn't crash as in release version. I am totally confused.
            Here is debug version launched manually. Different DLLs as for release versions, but doesn't crash.

            JKSH 1 Reply Last reply Reply Quote 0
            • JKSH
              JKSH Moderators @Nio_x last edited by

              @Nio_x said:

              I realized that QtCreator loads MinGW DLLs that comes with Qt SDK instead of my own MinGW distro, and it may be root of the problem.

              That's what I think too. Do not mix MinGW versions. Use the same one to build all DLLs in your app (this means you should use the version in the Qt SDK).

              Or, at the very least, you must verify that your two MinGW versions are compatible.

              but program doesn't crash as in release version. I am totally confused.

              There are two possible reasons for this:

              1. A Debug version does more checks than a Release version. The Debug version might detect a problem that your Release version didn't notice. In this case, it is a good thing that the program crashes, because it informs you that there's a problem. The Release version could run for a while, corrupting memory without anybody realizing. Eventually, it could still crash... or even worse, corrupt your data.
              2. The Debug version and Release version have different memory layouts. Therefore, they don't crash in the same place.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              N 1 Reply Last reply Reply Quote 1
              • N
                Nio_x @JKSH last edited by

                @JKSH
                How can I tell QtCreator to use my MinGW libs? In build settings i can only set compilers and debuggers, not libs.

                JKSH 1 Reply Last reply Reply Quote 0
                • JKSH
                  JKSH Moderators @Nio_x last edited by

                  @Nio_x said:

                  How can I tell QtCreator to use my MinGW libs?

                  When you select your MinGW compiler, Qt Creator will automatically use its libs.

                  By the way, do you use Qt in your project?

                  Finally, make sure that MinGW and Qt are not in your PATH. That tends to cause problems.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  N 1 Reply Last reply Reply Quote 1
                  • N
                    Nio_x @JKSH last edited by

                    @JKSH It seems i need qmake.exe for last MinGW version. Where can i get one? Screenshot.

                    JKSH 1 Reply Last reply Reply Quote 0
                    • JKSH
                      JKSH Moderators @Nio_x last edited by

                      @Nio_x said:

                      It seems i need qmake.exe for last MinGW version. Where can i get one? Screenshot.

                      What version is that?

                      Could you just use Qt's version of MinGW to build your whole project?

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      N 1 Reply Last reply Reply Quote 1
                      • N
                        Nio_x @JKSH last edited by

                        @JKSH It is latest version of MinGW. But everything works fine with Qt version of MinGW. Thank you so much for help!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post