List Info

Thread: Crash: Qt4.3 bug




Crash: Qt4.3 bug
country flaguser name
France
2007-03-31 07:17:15
Hello, 

Since I rebuilt KDE4 from scratch after the switch to Qt 4.3
(with 
kdesvn-build), I have a crash in my app: at the moment it
displays a dialog, 
it crashes. This is inside the Qt event loop and I cannot
find 
what is the cause. All what I found is this problem report
(march 7) on a TT 
mailing list that got no answer, it seems: 
http://lists.trolltech.com/qt4-preview
-feedback/2007-03/thread00016-0.html

Could anybody help here ? I put below the stack trace.

Regards,

Kleag

-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects
/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://ext
ragear.kde.org/apps/kgraphviewer

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

  
Re: Crash: Qt4.3 bug
country flaguser name
France
2007-03-31 07:46:52
Kleag wrote:
>Since I rebuilt KDE4 from scratch after the switch to Qt
4.3 (with
>kdesvn-build), I have a crash in my app: at the moment
it displays a
> dialog, it crashes. This is inside the Qt event loop
and I cannot find
>what is the cause. All what I found is this problem
report (march 7) on
> a TT mailing list that got no answer, it seems:
>http://lists.trolltech.com/qt4-preview-f
eedback/2007-03/thread00016-0.ht
>ml
>
>Could anybody help here ? I put below the stack trace.

There's no code in the first function of your backtrace.

>#5  0xb79fb1c8 in vtable for KMenuBar () from
> /home/kde4/kde/lib/libkdeui.so.5 

This line doesn't make sense. Your stack trace is probably
corrupt. You 
can't call "vtable for KMenuBar" because it's not
a function.

> #6  0xb7ee1669 in QMetaObject::cast 
> (this=0xb70535b8, obj=0x8214f70) at
>
/home/kde4/kdesvn/qt-copy/src/corelib/kernel/qmetaobject.cpp
:191

This line reads:
        const QMetaObject *m = obj->metaObject();

It's calling a virtual function, not the virtual table.

Can you also tell us what object "obj" above is?
Hint: run "set print 
object" in gdb.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago
(AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Crash: Qt4.3 bug
country flaguser name
France
2007-04-01 05:51:55
Hello Thiago,

Thanks for your answer.

I ran again from gdb this time, setting the printing of
objects as you 
requested. I join the new backtrace with the output of the
gdb commands I 
ran. 
Frankly, it does not give me any hint of what is
happening... 

Best regards,

Kleag
Le samedi 31 mars 2007, Thiago Macieira a écrit :
> Kleag wrote:
> >Could anybody help here ? I put below the stack
trace.
>
> There's no code in the first function of your
backtrace.
>
> >#5  0xb79fb1c8 in vtable for KMenuBar () from
> > /home/kde4/kde/lib/libkdeui.so.5
>
> This line doesn't make sense. Your stack trace is
probably corrupt. You
> can't call "vtable for KMenuBar" because it's
not a function.
>
> > #6  0xb7ee1669 in QMetaObject::cast
> > (this=0xb70535b8, obj=0x8214f70) at
> >
/home/kde4/kdesvn/qt-copy/src/corelib/kernel/qmetaobject.cpp
:191
>
> This line reads:
>         const QMetaObject *m = obj->metaObject();
>
> It's calling a virtual function, not the virtual
table.
>
> Can you also tell us what object "obj" above
is? Hint: run "set print
> object" in gdb.



-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects
/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://ext
ragear.kde.org/apps/kgraphviewer

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

  
Re: Crash: Qt4.3 bug
country flaguser name
France
2007-04-01 07:15:58
Kleag wrote:
>Hello Thiago,
>
>Thanks for your answer.
>
>I ran again from gdb this time, setting the printing of
objects as you
>requested. I join the new backtrace with the output of
the gdb commands
> I ran.
>Frankly, it does not give me any hint of what is
happening...

No, it doesn't. Any chance you can run this through valgrind
too?

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago
(AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Crash: Qt4.3 bug
country flaguser name
France
2007-04-01 07:55:50
Le dimanche 01 avril 2007, Thiago Macieira a écrit :
> Kleag wrote:
> >Hello Thiago,
> >
> >Thanks for your answer.
> >
> >I ran again from gdb this time, setting the
printing of objects as you
> >requested. I join the new backtrace with the output
of the gdb commands
> > I ran.
> >Frankly, it does not give me any hint of what is
happening...
>
> No, it doesn't. Any chance you can run this through
valgrind too?
Here is the valgrind output (command was: 
valgrind --log-file=ksirk.log --error-limit=no
--num-callers=30
ksirk)
Just to be sure the problem was not purely local, I asked
somebody else having 
Qt4.3 to try and it crashed for him too.

Regards,

Kleag

-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects
/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://ext
ragear.kde.org/apps/kgraphviewer

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

  
Re: Crash: Qt4.3 bug
country flaguser name
Germany
2007-04-03 08:58:35
On Saturday 31 March 2007 14:17:15 Kleag wrote:
> Could anybody help here ? I put below the stack trace.

Confirmed. Same here while trying to load a document into
kspread.

Regards,
Stefan

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Crash: Qt4.3 bug
country flaguser name
France
2007-04-04 07:37:25
Selon Stefan Nikolaus <stefan.nikolauskdemail.net>:

> On Saturday 31 March 2007 14:17:15 Kleag wrote:
> > Could anybody help here ? I put below the stack
trace.
>
> Confirmed. Same here while trying to load a document
into kspread.
Great news, if I can say  I'm no
more alone in this mess. Note that I have
still no idea how to solve it. I will subscribe to the
qt4-preview-feedback
mailing list to ask for help there.

Regards,

Kleag

>
> Regards,
> Stefan
>


 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-04-30 16:53:09
Hello,

After a month of search, I was able to find the code which
makes crash KsirK 
in playground. This code is in qt-copy. It was added between
Qt 4.2.3 and Qt 
4.3.0 between releases 646832 and 641769. This is this code:
 void QMainWindowLayout::animationFinished(QWidget *widget)
 {
+#ifndef QT_NO_TOOLBAR
+    if (QToolBar *tb =
qobject_cast<QToolBar*>(widget)) {
+        QToolBarLayout *tbl =
qobject_cast<QToolBarLayout*>(tb->layout());
+        if (tbl->expanded && tbl->collapsing)
{
+            tbl->expanded = false;
+            tbl->collapsing = false;
+            tbl->invalidate();
+            tb->update();
+        }
+    }
+#endif
+
     if (widget != pluggingWidget)
         return;

If I comment it out, my app works again.

I have no idea why it happens, particularly because I use
only two KToolBar 
that are never deleted. So, you see that I'm not really able
to propose a 
patch. I still don't know if the real problem comes from my
code or from KDE 
or Qt. 
Any idea or advice ?

Regards,

Kleag



Le samedi 31 mars 2007, Kleag a écrit :
> Hello,
>
> Since I rebuilt KDE4 from scratch after the switch to
Qt 4.3 (with
> kdesvn-build), I have a crash in my app: at the moment
it displays a
> dialog, it crashes. This is inside the Qt event loop
and I cannot find
> what is the cause. All what I found is this problem
report (march 7) on a
> TT mailing list that got no answer, it seems:
> http://lists.trolltech.com/qt4-preview
-feedback/2007-03/thread00016-0.html
>
> Could anybody help here ? I put below the stack trace.
>
> Regards,
>
> Kleag



-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects
/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://ext
ragear.kde.org/apps/kgraphviewer
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<
Re: Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-05-01 03:32:06
Kleag wrote:
>After a month of search, I was able to find the code
which makes crash
> KsirK in playground. This code is in qt-copy. It was
added between Qt
> 4.2.3 and Qt 4.3.0 between releases 646832 and 641769.
This is this
> code:
[snip]

>I have no idea why it happens, particularly because I
use only two
> KToolBar that are never deleted. So, you see that I'm
not really able
> to propose a patch. I still don't know if the real
problem comes from
> my code or from KDE or Qt.
>Any idea or advice ?

Does this bug still happen with current qt-copy? I know
there have been 
some QToolBarLayout fixes since the original beta 1.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago
(AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-05-01 17:01:07
Le mardi 01 mai 2007, Thiago Macieira a écrit :
> Kleag wrote:
[snip]
> >Any idea or advice ?
>
> Does this bug still happen with current qt-copy? I know
there have bee
> some QToolBarLayout fixes since the original beta 1.
Yes, it still happens: I build qt-copy every day with
kdesvn-build and it 
still happens.

regards,

Kleag



-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects
/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://ext
ragear.kde.org/apps/kgraphviewer
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<
Re: Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-05-01 23:41:55
Kleag wrote:
>Le mardi 01 mai 2007, Thiago Macieira a écrit :
>> Kleag wrote:
>
>[snip]
>
>> >Any idea or advice ?
>>
>> Does this bug still happen with current qt-copy? I
know there have bee
>> some QToolBarLayout fixes since the original beta
1.
>
>Yes, it still happens: I build qt-copy every day with
kdesvn-build and
> it still happens.

Can you create a small, self-contained testcase that
illustrates the bug? 
If so, mail it to qt-bugstrolltech.com.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago
(AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-05-02 03:13:12
On Monday 30 April 2007, Kleag wrote:
> I have no idea why it happens, particularly because I
use only two KToolBar 
> that are never deleted. 

valgrind would tell ;)

-- 
David Faure, faurekde.org, sponsored by Trolltech to work on
KDE,
Konqueror (http://www.konqueror.org
), and KOffice (http://www.koffice.org).
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-05-04 02:54:32
Hello,
Le mercredi 02 mai 2007, David Faure a écrit :
> On Monday 30 April 2007, Kleag wrote:
> > I have no idea why it happens, particularly
because I use only two
> > KToolBar that are never deleted.
>
> valgrind would tell ;)
Well, I tried before to use valgrind. It's right, It
reported the error. But 
it wasn't very useful to me as it just printed out the same
stack trace as 
gdb, deep inside the Qt control loop. As I don't now Qt
internals enough, 
this does not give me valuable data.
I already posted a valgrind output previously in this
thread, on april first 
and it wasn't a fish 

But I (finally!!) found the origin of the crash and, as
Thiago asked, 
created "a small, self-contained testcase that
illustrates the bug". The 
problem appears when I replace the central widget. It seems
to be a 
regression from Qt4.1.3 which announced this bug as
corrected.

The code below crashes:
*****************************
#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QTimer>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QMainWindow w;
    QPushButton* b1 = new
QPushButton("Abc",&w);
    w.setCentralWidget(b1);
    w.show();
    QPushButton* b2 = new
QPushButton("Def",&w);
    w.setCentralWidget(b2);

    return app.exec();
}
*****************************

Furthermore, as a direction to look at, the following diff
allows the above 
program to work:

******************************
Index: qmainwindowlayout.cpp
============================================================
=======
--- qmainwindowlayout.cpp       (révision 660602)
+++ qmainwindowlayout.cpp       (copie de travail)
 -1561,17
+1561,17 

 void QMainWindowLayout::animationFinished(QWidget *widget)
 {
-#ifndef QT_NO_TOOLBAR
-    if (QToolBar *tb =
qobject_cast<QToolBar*>(widget)) {
-        QToolBarLayout *tbl =
qobject_cast<QToolBarLayout*>(tb->layout());
-        if (tbl->expanded && tbl->collapsing)
{
-            tbl->expanded = false;
-            tbl->collapsing = false;
-            tbl->invalidate();
-            tb->update();
-        }
-    }
-#endif
+// #ifndef QT_NO_TOOLBAR
+//     if (QToolBar *tb =
qobject_cast<QToolBar*>(widget)) {
+//         QToolBarLayout *tbl =
qobject_cast<QToolBarLayout*>(tb->layout());
+//         if (tbl->expanded &&
tbl->collapsing) {
+//             tbl->expanded = false;
+//             tbl->collapsing = false;
+//             tbl->invalidate();
+//             tb->update();
+//         }
+//     }
+// #endif

     if (widget != pluggingWidget)
         return;
******************************

I hope this will allow the bug to be corrected.

Best regards,

Kleag
-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects
/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://ext
ragear.kde.org/apps/kgraphviewer
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: Update: Re: Crash: Qt4.3 bug
country flaguser name
France
2007-05-04 06:15:20
On Friday 04 May 2007, Kleag wrote:
>  The 
> problem appears when I replace the central widget. It
seems to be a 
> regression from Qt4.1.3 which announced this bug as
corrected.

Strange. I'm the one who reported the crash in Qt-4.0/4.1
when replacing the central widget,
and the testcase for it in konqueror/tests still passes with
Qt-4.3 (even when removing the workaround
from the code - which was to delete the old central widget
first).
So this must be a new variation of the bug, but it's not
exactly a regression to that fix.

Anyhow - it's in TT's hands now.

-- 
David Faure, faurekde.org, sponsored by Trolltech to work on
KDE,
Konqueror (http://www.konqueror.org
), and KOffice (http://www.koffice.org).
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

[1-14]

about | contact  Other archives ( Real Estate discussion Medical topics )