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. Statically linked third-party app leads to segmentation fault

Statically linked third-party app leads to segmentation fault

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 587 Views 2 Watching
  • 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.
  • Y Offline
    Y Offline
    yryu4526
    wrote on last edited by
    #1

    I have successfully build a third-party app using Qt 5.9.7 (as well as 5.12.10) in a docker container under CentOS 7.

    When I build it using dynamically linked Qt libraries it runs fine but when I add the -static flag to the initial building of qmake in order to have the Qt libraries statically linked to the third-party application it crashes - in the docker container - with a segmentation fault.

    Note that there are no other differences between the two scenarios and both run in walled-off docker containers, they /should/ have the same libraries etc in the same places...

    Does anyone have any suggestions where I should start looking?

    Y JKSHJ 2 Replies Last reply
    0
    • Y yryu4526

      I have successfully build a third-party app using Qt 5.9.7 (as well as 5.12.10) in a docker container under CentOS 7.

      When I build it using dynamically linked Qt libraries it runs fine but when I add the -static flag to the initial building of qmake in order to have the Qt libraries statically linked to the third-party application it crashes - in the docker container - with a segmentation fault.

      Note that there are no other differences between the two scenarios and both run in walled-off docker containers, they /should/ have the same libraries etc in the same places...

      Does anyone have any suggestions where I should start looking?

      Y Offline
      Y Offline
      yryu4526
      wrote on last edited by
      #2

      I should have added that ldd [application] shows that the Qt libraries are /not/ among the list of dynamically linked libraries and I therefore "assume" they are statically linked.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Did you try to start it using a debugger ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Y 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Did you try to start it using a debugger ?

          Y Offline
          Y Offline
          yryu4526
          wrote on last edited by
          #4

          No, I have not linked any debugging information and not done that. To try to speed this process up, may I respectfully ask that you suggest a few possible reasons for the crash bearing in mind that in both scenarios I run the app in a docker container?

          Surely I cannot be the first person with this experience?

          SGaistS 1 Reply Last reply
          0
          • Y yryu4526

            I have successfully build a third-party app using Qt 5.9.7 (as well as 5.12.10) in a docker container under CentOS 7.

            When I build it using dynamically linked Qt libraries it runs fine but when I add the -static flag to the initial building of qmake in order to have the Qt libraries statically linked to the third-party application it crashes - in the docker container - with a segmentation fault.

            Note that there are no other differences between the two scenarios and both run in walled-off docker containers, they /should/ have the same libraries etc in the same places...

            Does anyone have any suggestions where I should start looking?

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • Y yryu4526

              No, I have not linked any debugging information and not done that. To try to speed this process up, may I respectfully ask that you suggest a few possible reasons for the crash bearing in mind that in both scenarios I run the app in a docker container?

              Surely I cannot be the first person with this experience?

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @yryu4526 said in Statically linked third-party app leads to segmentation fault:

              Surely I cannot be the first person with this experience?

              Using an application with a statically built Qt inside Docker ? You are likely not that many.

              As for suggestions, it could be the platform plugin acting up. Not knowing that third party application does not help either. Hence a crash report would help pinpoint the issue. You can also try using strace to see if there's any difference there.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              Y 1 Reply Last reply
              0
              • SGaistS SGaist

                @yryu4526 said in Statically linked third-party app leads to segmentation fault:

                Surely I cannot be the first person with this experience?

                Using an application with a statically built Qt inside Docker ? You are likely not that many.

                As for suggestions, it could be the platform plugin acting up. Not knowing that third party application does not help either. Hence a crash report would help pinpoint the issue. You can also try using strace to see if there's any difference there.

                Y Offline
                Y Offline
                yryu4526
                wrote on last edited by
                #7

                Well, the objective is not to run it in docker once I have compiled it. However, since it uses a different version of Qt than the default version on the computer and I am worried about messing things up, can you point me to instructions on how to compile the application if not statically linked and where to put the various Qt libraries outside docker so that they do not conflict with what is already on the system?

                Thanks.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  If you would like to use Qt pre-built binaries, then the installer will put them in non conflicting areas by default. Either your home directory or /opt.

                  Just beware that at this moment, there are some issues to download them. See this thread.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  Y 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    If you would like to use Qt pre-built binaries, then the installer will put them in non conflicting areas by default. Either your home directory or /opt.

                    Just beware that at this moment, there are some issues to download them. See this thread.

                    Y Offline
                    Y Offline
                    yryu4526
                    wrote on last edited by
                    #9

                    @SGaist Ok, thanks. I have not had time to do anything with this project for a couple of weeks now but will be working on it again tomorrow, hopefully being able to compile the app in docker and understanding how to then move it - and required libraries - outside docker while not messing up the existing system...

                    As a newbie, I have much to learn... Thanks for your continued support.

                    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