From kde-core-devel Sat Oct 07 16:51:18 2006 From: Stephan Johach Date: Sat, 07 Oct 2006 16:51:18 +0000 To: kde-core-devel Subject: Re: KDE 4 porting: KBabel Project configuration crashes, help needed Message-Id: <200610071851.18788.lucardus () onlinehome ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=116023898404942 Hi Thiago! Am Samstag, 7. Oktober 2006 15:03 schrieb Thiago Macieira: > Stephan Johach wrote: > >ASSERT failure in QVector::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 = pid = 1262 > > > >[1]+  Exit 253                ./install/bin/catalogmanager > >lucardus@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