Skip to main content
Topic: Segmentation fault in QT apps (Read 1399 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Segmentation fault in QT apps

How can I debug with gdb or something?
I tried "gdb qt6ct" but I think that it does not have debug symbols.
Is there some app with the symbols?

Nheko, strawberry etc. do not start because of "Segmentation fault".
I do not know what's the problem.

Re: Segmentation fault in QT apps

Reply #1
ARMtix is built w/o debug symbols. Could you try to rebuild locally? If it works then, i'll rebuild it
ARMtix

Re: Segmentation fault in QT apps

Reply #2
I built qt6ct-git and "Segmentation fault" again.
I also rebuilt another qt app and same problem.

Re: Segmentation fault in QT apps

Reply #3
Stating the obvious QT is complex and it's probable that the segfault is coming is coming from another part of QT not the actual programs you are starting seeing as it's happening with multiple QT programs.

Starting the programs with strace might shed some light ?
If it does you could try building the package that contains the problem component locally and installing the 'debug' version of its package.
Then, making sure that core dumps are enabled, you can use gdb to backtrace the coredump.

Re: Segmentation fault in QT apps

Reply #4
Now I was able to download the symbols.
Code: [Select]
gdb qt6ct
(gdb) run
Starting program: /usr/bin/qt6ct
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0xfffff240ef60 (LWP 26116)]
[New Thread 0xfffff1a0ef60 (LWP 26117)]
Downloading separate debug info for /usr/lib/qt6/plugins/platformthemes/libqt6ct.so...
[...]
Downloading separate debug info for /usr/lib/qt6/plugins/imageformats/libqsvg.so...

Thread 1 "qt6ct" received signal SIGSEGV, Segmentation fault.
0x0000fffff6675e18 in ?? ()
   from /usr/lib/libQt6Core.so.6
(gdb)

Is that enough?

Other app that had debug in binary:
Code: [Select]
Thread 1 "<app>" received signal SIGSEGV, Segmentation fault.
0x0000fffff5075e18 in ?? () from /usr/lib/libQt6Core.so.6
(gdb)

Re: Segmentation fault in QT apps

Reply #5
Well both examples appear to show the segfault coming from /usr/lib/libQt6Core.so.6 , part of qt6-base.

If it's not a red herring you could try building qt6-base locally see if that helps?
If not try with different Flags in makepkg.conf. As in less optimization.
Search for "arm Segmentation fault libQt6Core" and similar.

I use kde on an ARMv7 chromebook. For a while now konsole segfaults not long after being opened. I've never been able to fix it  :'(

Re: Segmentation fault in QT apps

Reply #6
Does build qt6-base take a lot?

Problem is that all qt apps do not start cause of seg fault, quite annoying.

Re: Segmentation fault in QT apps

Reply #7
Does build qt6-base take a lot?

Problem is that all qt apps do not start cause of seg fault, quite annoying.
That all depends on the device you are building it on and how ?
From memory only, I seem to remember it being a fairly big build but not as bad as some of the other QT components eg webengine

On my chromebook I use Distcc Cross-Compiling which makes a big difference but again depends on the power of the client machine(s)
If you try Distcc I suggest the pre-built crosstool-ng toolchains. Building my own toolchain failed for me, but that's probably down to me only.

Re: Segmentation fault in QT apps

Reply #8
If you have powerful x86_64 machine, you could also try to build using qemu+chroot (i didn't succeed at that but someone on the forum did recently) or inside virtual machine
ARMtix

 

Re: Segmentation fault in QT apps

Reply #9
qemu+chroot? Not sure how that works.

I tried to make a VM but I could not boot.

I use just use a chroot to cross compile but my desktop is really not powerful.
But the aarch64 device is a PinePhone (very slow).

Error when building qt6-base from chroot:
Code: [Select]
  Mimer .................................. no
 

ERROR: Feature "no_direct_extern_access": Forcing to "ON" breaks its condition:
    NOT WIN32 AND TEST_no_direct_extern_access
Condition values dump:
    WIN32 = ""
    TEST_no_direct_extern_access = "FALSE"


CMake Error at cmake/QtBuildInformation.cmake:208 (message):
  Check the configuration messages for an error that has occurred.
Call Stack (most recent call first):
  cmake/QtBuildInformation.cmake:39 (qt_configure_print_summary)
  cmake/QtBuildRepoHelpers.cmake:347 (qt_print_feature_summary)
  cmake/QtBaseHelpers.cmake:219 (qt_build_repo_end)
  CMakeLists.txt:32 (qt_internal_qtbase_build_repo)

I just built a qt5 app natively to test and:
Code: [Select]
Cannot mix incompatible Qt library (5.15.13) with this library (5.15.14)
How so?

Re: Segmentation fault in QT apps

Reply #10
I just built a qt5 app natively to test and:
Code: [Select]
Cannot mix incompatible Qt library (5.15.13) with this library (5.15.14)
There was a problem at ARMtix build system last month that led to some qt5 packages being incorrectly built. Could you check which qt5 package is broken for you?
ARMtix

Re: Segmentation fault in QT apps

Reply #11
The app that I built is auralquiz from the AUR.
Same error from extra/qstardict.

Not sure what apps from ARMtix repo use qt5.

Re: Segmentation fault in QT apps

Reply #12
The app that I built is auralquiz from the AUR.
Same error from extra/qstardict.

Not sure what apps from ARMtix repo use qt5.
The error you sent means that some qt5 dependency of that package is built against the wrong qt5-base version. Could you check which one can it be?
ARMtix

Re: Segmentation fault in QT apps

Reply #13
Code: [Select]
[...]
Downloading separate debug info for /usr/lib/libQt5X11Extras.so.5                                                                
Cannot mix incompatible Qt library (5.15.13) with this library (5.15.14)                                                         

Thread 1 "auralquiz" received signal SIGABRT, Aborted.
0x0000fffff6acd718 in ?? () from /usr/lib/libc.so.6
Like that?

Code: [Select]
usr/lib/libc.so.6 is owned by system/glibc 2.39+r52+gf8e4623421-1

Re: Segmentation fault in QT apps

Reply #14
Code: [Select]
[...]
Downloading separate debug info for /usr/lib/libQt5X11Extras.so.5                                                                
Cannot mix incompatible Qt library (5.15.13) with this library (5.15.14)                                                         

Thread 1 "auralquiz" received signal SIGABRT, Aborted.
0x0000fffff6acd718 in ?? () from /usr/lib/libc.so.6
Like that?
I listed files owned by each installed qt5 package and tried to run the ones from /usr/bin. If it fails with such error - it requires rebuild
ARMtix