Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Segfault after moving project from Ubuntu 22.04 to RHEL 8.10
Forum Updated to NodeBB v4.3 + New Features

Segfault after moving project from Ubuntu 22.04 to RHEL 8.10

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 3 Posters 155 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.
  • D Offline
    D Offline
    dbr37
    wrote on 28 Apr 2025, 12:09 last edited by
    #1

    Hi all,

    I've been facing a segmentation fault when porting my working Qt C++ QML project from Ubuntu to RHEL as mentioned in the title. The crash occurs in the Qt code, and seems to be triggered at app.exec() rather than any specific line in my code. I had no such issue on my Ubuntu system. I tried running the Qt-provided HelloWorld example on the RHEL system and it had no problems. The Qt version on both systems is 6.7.3.
    Here is the callstack:

    1  QObject::~QObject                         qobject.cpp               1117 0x7ffff5f91c3d 
    2  QQmlComponent::~QQmlComponent             qqmlcomponent.cpp         441  0x7ffff73f2679 
    3  QObject::event                            qobject.cpp               1437 0x7ffff5f87b30 
    4  QCoreApplication::notifyInternal2         qthread_p.h               344  0x7ffff5f35d3a 
    5  QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp      1951 0x7ffff5f3924d 
    6  postEventSourceDispatch                   qeventdispatcher_glib.cpp 244  0x7ffff61ef223 
    7  g_main_context_dispatch                                                  0x7ffff2d9faed 
    8  g_main_context_iterate.isra                                              0x7ffff2d9fea8 
    9  g_main_context_iteration                                                 0x7ffff2d9ff40 
    10 QEventDispatcherGlib::processEvents       qeventdispatcher_glib.cpp 394  0x7ffff61eeafa 
    11 QEventLoop::exec                          qflags.h                  108  0x7ffff5f41573 
    12 QCoreApplication::exec                    qflags.h                  74   0x7ffff5f3e00e 
    13 main                                      main.cpp                  401  0x4a9c3a
    

    Please let me know if I can provide any additional information that may be helpful. Thanks in advance.

    J J 2 Replies Last reply 28 Apr 2025, 12:32
    0
    • D dbr37
      28 Apr 2025, 12:09

      Hi all,

      I've been facing a segmentation fault when porting my working Qt C++ QML project from Ubuntu to RHEL as mentioned in the title. The crash occurs in the Qt code, and seems to be triggered at app.exec() rather than any specific line in my code. I had no such issue on my Ubuntu system. I tried running the Qt-provided HelloWorld example on the RHEL system and it had no problems. The Qt version on both systems is 6.7.3.
      Here is the callstack:

      1  QObject::~QObject                         qobject.cpp               1117 0x7ffff5f91c3d 
      2  QQmlComponent::~QQmlComponent             qqmlcomponent.cpp         441  0x7ffff73f2679 
      3  QObject::event                            qobject.cpp               1437 0x7ffff5f87b30 
      4  QCoreApplication::notifyInternal2         qthread_p.h               344  0x7ffff5f35d3a 
      5  QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp      1951 0x7ffff5f3924d 
      6  postEventSourceDispatch                   qeventdispatcher_glib.cpp 244  0x7ffff61ef223 
      7  g_main_context_dispatch                                                  0x7ffff2d9faed 
      8  g_main_context_iterate.isra                                              0x7ffff2d9fea8 
      9  g_main_context_iteration                                                 0x7ffff2d9ff40 
      10 QEventDispatcherGlib::processEvents       qeventdispatcher_glib.cpp 394  0x7ffff61eeafa 
      11 QEventLoop::exec                          qflags.h                  108  0x7ffff5f41573 
      12 QCoreApplication::exec                    qflags.h                  74   0x7ffff5f3e00e 
      13 main                                      main.cpp                  401  0x4a9c3a
      

      Please let me know if I can provide any additional information that may be helpful. Thanks in advance.

      J Offline
      J Offline
      JonB
      wrote on 28 Apr 2025, 12:32 last edited by
      #2

      @dbr37
      Just so you know, the "crash" is occurring inside the destruction of a QQmlComponent. Does it occur if you try whatever a minimal QML program is, like a , which includes some QQmlComponent? Or is the "Qt-provided HelloWorld example" already a QML one? Add a couple of components onto it? Otherwise you might have to provide your whole QML app.

      D 1 Reply Last reply 28 Apr 2025, 13:36
      0
      • D dbr37
        28 Apr 2025, 12:09

        Hi all,

        I've been facing a segmentation fault when porting my working Qt C++ QML project from Ubuntu to RHEL as mentioned in the title. The crash occurs in the Qt code, and seems to be triggered at app.exec() rather than any specific line in my code. I had no such issue on my Ubuntu system. I tried running the Qt-provided HelloWorld example on the RHEL system and it had no problems. The Qt version on both systems is 6.7.3.
        Here is the callstack:

        1  QObject::~QObject                         qobject.cpp               1117 0x7ffff5f91c3d 
        2  QQmlComponent::~QQmlComponent             qqmlcomponent.cpp         441  0x7ffff73f2679 
        3  QObject::event                            qobject.cpp               1437 0x7ffff5f87b30 
        4  QCoreApplication::notifyInternal2         qthread_p.h               344  0x7ffff5f35d3a 
        5  QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp      1951 0x7ffff5f3924d 
        6  postEventSourceDispatch                   qeventdispatcher_glib.cpp 244  0x7ffff61ef223 
        7  g_main_context_dispatch                                                  0x7ffff2d9faed 
        8  g_main_context_iterate.isra                                              0x7ffff2d9fea8 
        9  g_main_context_iteration                                                 0x7ffff2d9ff40 
        10 QEventDispatcherGlib::processEvents       qeventdispatcher_glib.cpp 394  0x7ffff61eeafa 
        11 QEventLoop::exec                          qflags.h                  108  0x7ffff5f41573 
        12 QCoreApplication::exec                    qflags.h                  74   0x7ffff5f3e00e 
        13 main                                      main.cpp                  401  0x4a9c3a
        

        Please let me know if I can provide any additional information that may be helpful. Thanks in advance.

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 28 Apr 2025, 12:34 last edited by
        #3

        @dbr37 Did you build the application on RHEL or did you copy the binaries from Ubuntu to RHEL?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        D 1 Reply Last reply 28 Apr 2025, 13:50
        0
        • J JonB
          28 Apr 2025, 12:32

          @dbr37
          Just so you know, the "crash" is occurring inside the destruction of a QQmlComponent. Does it occur if you try whatever a minimal QML program is, like a , which includes some QQmlComponent? Or is the "Qt-provided HelloWorld example" already a QML one? Add a couple of components onto it? Otherwise you might have to provide your whole QML app.

          D Offline
          D Offline
          dbr37
          wrote on 28 Apr 2025, 13:36 last edited by
          #4

          @JonB
          Yes, the HelloWorld example is a QML one. I tried adding a couple of simple Items to it and the issue doesn't occur. The project is fairly large and uses Qt Xml, Sql, and other libraries, so I may have to try a process of elimination here.

          I also tried porting my project to Qt 6.8.3 in case this was an issue of the Qt 6.7 being a bit older than the RHEL version. The ported project works fine on my Ubuntu system, but fails on the RHEL system in a slightly different place, if this is helpful in any way.

          1  QCoreApplicationPrivate::notify_helper    qcoreapplication.cpp      1349 0x7ffff587b805 
          2  QCoreApplicationPrivate::notify_helper    qcoreapplication.cpp      1326 0x7ffff587b805 
          3  QCoreApplication::notifyInternal2         qthread_p.h               359  0x7ffff587b9e2 
          4  QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp      1951 0x7ffff587ef5d 
          5  postEventSourceDispatch                   qeventdispatcher_glib.cpp 246  0x7ffff5b59f47 
          6  g_main_context_dispatch                                                  0x7ffff3396aed 
          7  g_main_context_iterate.isra                                              0x7ffff3396ea8 
          8  g_main_context_iteration                                                 0x7ffff3396f40 
          9  QEventDispatcherGlib::processEvents       qeventdispatcher_glib.cpp 399  0x7ffff5b5960e 
          10 QEventLoop::exec                          qflags.h                  108  0x7ffff58880bb 
          11 QCoreApplication::exec                    qflags.h                  74   0x7ffff58840a6 
          12 main                                      main.cpp                  401  0x4a572d
          

          I think what's throwing me off here is that there was no issue on Ubuntu, so I'm not sure what would change on such a level on a different OS. This is my first time using RHEL as well.

          J 1 Reply Last reply 28 Apr 2025, 13:45
          0
          • D dbr37
            28 Apr 2025, 13:36

            @JonB
            Yes, the HelloWorld example is a QML one. I tried adding a couple of simple Items to it and the issue doesn't occur. The project is fairly large and uses Qt Xml, Sql, and other libraries, so I may have to try a process of elimination here.

            I also tried porting my project to Qt 6.8.3 in case this was an issue of the Qt 6.7 being a bit older than the RHEL version. The ported project works fine on my Ubuntu system, but fails on the RHEL system in a slightly different place, if this is helpful in any way.

            1  QCoreApplicationPrivate::notify_helper    qcoreapplication.cpp      1349 0x7ffff587b805 
            2  QCoreApplicationPrivate::notify_helper    qcoreapplication.cpp      1326 0x7ffff587b805 
            3  QCoreApplication::notifyInternal2         qthread_p.h               359  0x7ffff587b9e2 
            4  QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp      1951 0x7ffff587ef5d 
            5  postEventSourceDispatch                   qeventdispatcher_glib.cpp 246  0x7ffff5b59f47 
            6  g_main_context_dispatch                                                  0x7ffff3396aed 
            7  g_main_context_iterate.isra                                              0x7ffff3396ea8 
            8  g_main_context_iteration                                                 0x7ffff3396f40 
            9  QEventDispatcherGlib::processEvents       qeventdispatcher_glib.cpp 399  0x7ffff5b5960e 
            10 QEventLoop::exec                          qflags.h                  108  0x7ffff58880bb 
            11 QCoreApplication::exec                    qflags.h                  74   0x7ffff58840a6 
            12 main                                      main.cpp                  401  0x4a572d
            

            I think what's throwing me off here is that there was no issue on Ubuntu, so I'm not sure what would change on such a level on a different OS. This is my first time using RHEL as well.

            J Offline
            J Offline
            JonB
            wrote on 28 Apr 2025, 13:45 last edited by
            #5

            @dbr37
            If, say, you have a memory error, a double free or anything like that your code might work in one environment, while still being "wrong", but fall over in another. Don't always read too much into crashes in different areas or in different environments.

            I know nothing about QML. While Qt C++ programs can certainly "crash" from user coding, I don't know whether QML should never do that?

            Can you obtain a debug version of Qt? In your first crash at least, if reputable, you might be able to see which QML component/Qt object was causing the problem. Otherwise you might have to do quite some "chopping out" of your code/QML till you identify a problem....

            You should also confirm to @jsulm's question that you are building fresh binaries under RHEL, not using the Ubuntu ones? And make sure you have a "good", consistent set of Qt/QML libraries. Ubuntu comes with a set of precompiled Qt libraries at a certain version in its distro, does RHEL? Assuming so, have you tried with the Qt/QML binaries supplied for RHEL rather than compiling yourself?

            D 1 Reply Last reply 28 Apr 2025, 14:03
            0
            • J jsulm
              28 Apr 2025, 12:34

              @dbr37 Did you build the application on RHEL or did you copy the binaries from Ubuntu to RHEL?

              D Offline
              D Offline
              dbr37
              wrote on 28 Apr 2025, 13:50 last edited by
              #6

              @jsulm
              I built the application on RHEL using the same program files and CMakeLists.txt. I did not copy the build folder from Ubuntu.

              1 Reply Last reply
              0
              • J JonB
                28 Apr 2025, 13:45

                @dbr37
                If, say, you have a memory error, a double free or anything like that your code might work in one environment, while still being "wrong", but fall over in another. Don't always read too much into crashes in different areas or in different environments.

                I know nothing about QML. While Qt C++ programs can certainly "crash" from user coding, I don't know whether QML should never do that?

                Can you obtain a debug version of Qt? In your first crash at least, if reputable, you might be able to see which QML component/Qt object was causing the problem. Otherwise you might have to do quite some "chopping out" of your code/QML till you identify a problem....

                You should also confirm to @jsulm's question that you are building fresh binaries under RHEL, not using the Ubuntu ones? And make sure you have a "good", consistent set of Qt/QML libraries. Ubuntu comes with a set of precompiled Qt libraries at a certain version in its distro, does RHEL? Assuming so, have you tried with the Qt/QML binaries supplied for RHEL rather than compiling yourself?

                D Offline
                D Offline
                dbr37
                wrote on 28 Apr 2025, 14:03 last edited by
                #7

                @JonB
                There seems to be a time limit on how often I can respond, as I'm a new user.

                Thanks for the insight on crashes in different environments, I'll keep this in mind going forward.
                I actually used the Qt Online Installer for both versions, on both systems. Could you give me a bit more context on what you mean by a debug version of Qt? I'm only familiar with building my project in Debug mode.

                I think I'll look into Qt/QML binaries for RHEL and get back. Thanks!

                J 1 Reply Last reply 28 Apr 2025, 14:16
                0
                • D dbr37
                  28 Apr 2025, 14:03

                  @JonB
                  There seems to be a time limit on how often I can respond, as I'm a new user.

                  Thanks for the insight on crashes in different environments, I'll keep this in mind going forward.
                  I actually used the Qt Online Installer for both versions, on both systems. Could you give me a bit more context on what you mean by a debug version of Qt? I'm only familiar with building my project in Debug mode.

                  I think I'll look into Qt/QML binaries for RHEL and get back. Thanks!

                  J Offline
                  J Offline
                  JonB
                  wrote on 28 Apr 2025, 14:16 last edited by
                  #8

                  @dbr37 said in Segfault after moving project from Ubuntu 22.04 to RHEL 8.10:

                  Could you give me a bit more context on what you mean by a debug version of Qt?

                  You first post showed a crash inside qqmlcomponent.cpp/qobject.cpp. It would be nice which object that was happening on. For that you will need those Qt files to be compiled for debug, so that you can view variables etc. Either you must compile Qt itself for debug or you must be able to fetch debug-compiled Qt libraries from wherever, I don't know whether your RHEL distro offers that.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dbr37
                    wrote 30 days ago last edited by
                    #9

                    Hi all,
                    The issue is now resolved. The project I was porting required glibc 2.29, whereas RHEL 8.10 only supports up to glibc 2.28. When I installed Qt using the online installer, it was expecting 2.29, rather than the system provided version. I couldn't find any precompiled Qt libraries for my version of RHEL, so I rebuilt Qt from source using the system provided version of glibc, and now there is no crash.

                    Thanks for the responses!

                    1 Reply Last reply
                    0

                    1/9

                    28 Apr 2025, 12:09

                    • Login

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