Crash under nearly identical build circumstances as working version (AUR)
-
This is a niche and hard to diagnose problem, but I figured I would ask here as I have no idea who else might be able to help.
I have a Qt program, using qmake, packaged for Arch Linux in the AUR. The build steps are as follows:
Qt Version (qmake) is 5.15.2.
GCC Version is 11.1.0.The invocation of
QItemSelectionModel::currentRowChanged
causes a yet undiagnosable crash (stacktrace), but it only happens with the AUR package.Under nearly identical build circumstances (as follows), the crash does not occur:
git clean -xdf qmake ptcollab.pro CONFIG+=release PREFIX=/bin QMAKE_CXXFLAGS+='-march=x86-64 -mtune=generic -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-DGLIBCXX_ASSERTIONS' make -j1 qmake_all make
The compiler flags are gathered from this comparison:
The
qmake
andgcc
versions are the same.
They are both from the latest version upstream, from the same repository, with the samegit clone
flags (none).What could possibly be happening here?
Note, I don't think this is some freak accident; this happens on more than just my machine. If you want to try it out yourself to debug, the AUR package is called
ptcollab-git
.The issue ended up being that there actually was an improper call to
QItemSelectionModel::currentRowChanged
somewhere down the line. This was caused by the-Wp,-D_GLIBCXX_ASSERTIONS
flag that I mistyped in the reproduction build. -
The release-mode binary does not produce a particularly useful stack trace. It looks like your code crashes before you even get out of main(). Is a QApplication the first thing your create in main()?
Build a debug version and reproduce the error. The stack trace should identify the last line of your code that ran, which will usually be in the general area of the root cause of the crash.