bad luck I forgot my qtcentre account,
these days I am stuck over a Qt problem , I tried whatsoever I can do and hence I surrendered.
my projects built successfully on Ubuntu , but when I ran it , it crashed at the very beginning.

here is the backtrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00c59f93 in strlen () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0x00c59f93 in strlen () from /lib/tls/i686/cmov/libc.so.6
#1 0x035364ff in XSetCommand () from /usr/lib/libX11.so.6
#2 0x0353af51 in XSetWMProperties () from /usr/lib/libX11.so.6
#3 0x0100f134 in QWidgetPrivate::create_sys (this=0x8313fb0, window=0,
initializeWindow=true, destroyOldWindow=true)
at /var/tmp/qt-src/src/gui/kernel/qwidget_x11.cpp:795
#4 0x00fc7b21 in QWidget::create (this=0xbffff1cc, window=0, initializeWindow=true,
destroyOldWindow=true) at /var/tmp/qt-src/src/gui/kernel/qwidget.cpp:1319
#5 0x00fca7b1 in QWidget::setVisible (this=0xbffff1cc, visible=true)
at /var/tmp/qt-src/src/gui/kernel/qwidget.cpp:7353
#6 0x081c7e53 in main ()


I asked google for help and checked all the result items thoroughly,
Martin Sander added a comment - 28/Jan/10 04:42 PM
I got the same crash.
Suprisingly it is not only the argv causing the problem.
It's the "design" of QCoreApplication: it stores the argc as reference.
In the example in QappRun the argv AND argc have to be static.
Very nasty: if you subclass from QCoreApplication or QApplication and then forget the & in the subclass constructor.


[ Permalink | « Hide ]
Zeno Albisser added a comment - 08/Feb/10 03:29 PM
I wonder what exactly should be the use case of this implementation.
It of course crashes because argv is not valid anymore after leaving QappRun.
Further the documentation of QApplication mentions:
"Warning: The data referred to by argc and argv must stay valid for the entire lifetime of the QApplication object. In addition, argc must be greater than zero and argv must contain at least one valid character string."
Qt Version? the two arguments ,argc? argv?
many people got the same crash , but there was no solution found ,
so . if you met the same problem before, be nice to give me tips, thank you...