Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. DLL trouble
QtWS25 Last Chance

DLL trouble

Scheduled Pinned Locked Moved General and Desktop
dllreleasesegmentationfault
10 Posts 2 Posters 3.8k Views
  • 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 Offline
    N Offline
    Nio_x
    wrote on last edited by Nio_x
    #1

    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
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      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
      1
      • JKSHJ JKSH

        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?

        N Offline
        N Offline
        Nio_x
        wrote on last edited by
        #3

        @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
        0
        • N Nio_x

          @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 Offline
          N Offline
          Nio_x
          wrote on last edited by Nio_x
          #4

          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.

          JKSHJ 1 Reply Last reply
          0
          • N 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.

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            @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
            1
            • JKSHJ JKSH

              @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.
              N Offline
              N Offline
              Nio_x
              wrote on last edited by
              #6

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

              JKSHJ 1 Reply Last reply
              0
              • N Nio_x

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

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @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
                1
                • JKSHJ JKSH

                  @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.

                  N Offline
                  N Offline
                  Nio_x
                  wrote on last edited by
                  #8

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

                  JKSHJ 1 Reply Last reply
                  0
                  • N Nio_x

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

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #9

                    @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
                    1
                    • JKSHJ JKSH

                      @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?

                      N Offline
                      N Offline
                      Nio_x
                      wrote on last edited by
                      #10

                      @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
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved