KDE 4 porting: KBabel Project configuration crashes, help needed

Stephan Johach lucardus at onlinehome.de
Sat Oct 7 17:51:18 BST 2006


Hi Thiago!

Am Samstag, 7. Oktober 2006 15:03 schrieb Thiago Macieira:
> Stephan Johach wrote:
> >ASSERT failure in QVector<T>::operator[]: "index out of range",
> >file /home/lucardus/qt-copy/src/corelib/tools/qvector.h, line 290
> >KCrash: crashing... crashRecursionCounter = 2
> >KCrash: Application Name = catalogmanager path = <unknown> pid = 1262
> >
> >[1]+  Exit 253                ./install/bin/catalogmanager
> >lucardus at leviathan:~$
>
> This means you tried to access an element in the vector past the end (or
> before the beginning). Find the faulty code accessing a QVector and make
> sure it verifies that the index is strictly less than length().

Yes, I know, I had problems debugging it. But now I got it, at least I
think, I found the reason. 

KDbg shows, the assertion is triggered in

KTabCtrl::Private::showTab(int index)

index is 0, but obviously the array mPages is empty and
so index 0 bails out.

Seems like KTabCtrl::addTab() triggers an

emit selected(index)

in QTabBar::setCurrentIndex()

which leads to calling

KTabCtrl::Private::showTab(int index)

but before mPages has the new page added in KTabCtrl::addTab()

mPages[index]->setGeometry( getChildRect() );

then triggers the assertion, as mPages is empty at that time.

I think, this is something a core developer should look at.  I have
no clue if KBabel is doing something stupid here, but KTabCtrl
should at least check, if mPages is empty to avoid crashes.

Stephan





More information about the kde-core-devel mailing list