[Interest] Construction of QObjects before QApplication or something else brings SEGV

Olivier BARTHELEMY barthelemy at geovariances.com
Wed Sep 11 17:26:37 CEST 2013


I am having SEGFAULTS in some code just by making trivial changes that
should not influence the behaviour.
The code simply creates a QTextEdit in a QDIalog, and segfaults somewhere
in child calls of show() on the QDialog
Running valgrind, i noticed warnings about 'conditional jump or move
depending on uninitialized value'. Strangely, the warning has an almost
identical call stack than the segv.
The warning is apparently triggered because the class that builds the
QApplication and the dialog is a child of QObject, so the QObject
constructed before the QApplication must mess something up. Removing that
inheritance to QOBject, of manually creating the QApplication before
creating the class object removes the valgrind warning, but does not clear
the SEGV.
I have had some mixed success to remove the segv by trying multiple G++
versions. Older G++ versions seem to crash less (no crash in 4.1, little
crashes in 4.4, almost always crash in 4.6), but the results are
inconsistent. It seems more like the difference of generated code triggers
more or less the error, but what is messed up is still there.

People there (https://code.google.com/p/eiskaltdc/issues/detail?id=601) and
on some other sites (google 'QWidgetPrivate::create_sys conditional jump'
for example) have been having similar problems of either the warning or the
SEGV with call stacks indicating the same problem, but without solution.

Any suggestion?

I'm using QT4.8.5


-- 
Olivier BARTHELEMY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130911/6c703618/attachment.html>


More information about the Interest mailing list