Segfault after moving project from Ubuntu 22.04 to RHEL 8.10
-
wrote on 28 Apr 2025, 12:09 last edited by
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.
-
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.
wrote on 28 Apr 2025, 12:32 last edited by@dbr37
Just so you know, the "crash" is occurring inside the destruction of aQQmlComponent
. Does it occur if you try whatever a minimal QML program is, like a , which includes someQQmlComponent
? 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. -
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.
@dbr37 Did you build the application on RHEL or did you copy the binaries from Ubuntu to RHEL?
-
@dbr37
Just so you know, the "crash" is occurring inside the destruction of aQQmlComponent
. Does it occur if you try whatever a minimal QML program is, like a , which includes someQQmlComponent
? 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.wrote on 28 Apr 2025, 13:36 last edited by@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.
-
@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.
wrote on 28 Apr 2025, 13:45 last edited by@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?
-
@dbr37 Did you build the application on RHEL or did you copy the binaries from Ubuntu to RHEL?
-
@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?
wrote on 28 Apr 2025, 14:03 last edited by@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!
-
@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!
wrote on 28 Apr 2025, 14:16 last edited by@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. -
wrote 30 days ago last edited by
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/9