Loop unrolling -> stack corruption

Michael Goffioul goffioul at imec.be
Wed May 8 17:50:04 BST 2002


Michael Goffioul wrote:
> 
> Something weird seems to happen with kdeprint code. When compiled with
> the flag -funroll-loops, crashes happen and it's impossible to debug it
> with gdb as the stack is corrupted ("Cannot access memory..."). Without
> that compilation flag, everything is OK.
> This is tested with gcc-2.95.3.
> 
> Except valgrinding the code, does anybody have any hint?

More info about this. Here's a complete backtrace when compiling only
kdelibs/kdeprint/ with -funroll-loops (the rest of KDE is compiled
without -funroll-loops). It's compiled with (Mandrake) gcc-2.96. The
backtrace is obtained by attaching gdb to a running process.

Michael.

#0  0x407b678c in malloc () from /opt/kde3/lib/libkdecore.so.4
#1  0x41021a1b in __builtin_new () from /usr/lib/libstdc++-libc6.2-2.so.3
#2  0x406c58d8 in KStandardDirs::resourceDirs () from /opt/kde3/lib/libkdecore.so.4
#3  0x406c0a5b in KStandardDirs::findResourceDir () from /opt/kde3/lib/libkdecore.so.4
#4  0x406bf6e6 in KStandardDirs::findResource () from /opt/kde3/lib/libkdecore.so.4
#5  0x407052b7 in KIconLoader::iconPath () from /opt/kde3/lib/libkdecore.so.4
#6  0x40705e74 in KIconLoader::loadIcon () from /opt/kde3/lib/libkdecore.so.4
#7  0x4070cf0f in UserIcon () from /opt/kde3/lib/libkdecore.so.4
#8  0x416a24d1 in KPCopiesPage::slotCollateClicked () from /opt/kde3/lib/libkdeprint.so.4
#9  0x416a2676 in KPCopiesPage::initialize () from /opt/kde3/lib/libkdeprint.so.4
#10 0x416a22a9 in KPCopiesPage::KPCopiesPage () from /opt/kde3/lib/libkdeprint.so.4
#11 0x41671d73 in KMUiManager::setupPrintDialog () from /opt/kde3/lib/libkdeprint.so.4
#12 0x4168888d in KPrintDialog::printerDialog () from /opt/kde3/lib/libkdeprint.so.4
#13 0x4168ebcd in KPrinter::setup () from /opt/kde3/lib/libkdeprint.so.4
#14 0x415cbf31 in KateDocument::printDialog () from /opt/kde3/lib/kde3/katepart.so
#15 0x415cc168 in KateDocument::print () from /opt/kde3/lib/kde3/katepart.so
#16 0x415c5228 in KateDocument::qt_invoke () from /opt/kde3/lib/kde3/katepart.so
#17 0x40a5cff4 in QObject::activate_signal () from /opt/qt3/lib/libqt-mt.so.3
#18 0x40a5cf5e in QObject::activate_signal () from /opt/qt3/lib/libqt-mt.so.3
#19 0x404aaaf5 in KAction::activated () from /opt/kde3/lib/libkdeui.so.4
#20 0x40496ee9 in KAction::slotActivated () from /opt/kde3/lib/libkdeui.so.4
#21 0x404aad31 in KAction::qt_invoke () from /opt/kde3/lib/libkdeui.so.4
#22 0x40a5cff4 in QObject::activate_signal () from /opt/qt3/lib/libqt-mt.so.3
#23 0x40d210cd in QSignal::signal () from /opt/qt3/lib/libqt-mt.so.3
#24 0x40a71fe7 in QSignal::activate () from /opt/qt3/lib/libqt-mt.so.3
#25 0x40b487c3 in QPopupMenu::mouseReleaseEvent () from /opt/qt3/lib/libqt-mt.so.3
#26 0x40a8b490 in QWidget::event () from /opt/qt3/lib/libqt-mt.so.3
#27 0x40a05771 in QApplication::internalNotify () from /opt/qt3/lib/libqt-mt.so.3
#28 0x40a04ec3 in QApplication::notify () from /opt/qt3/lib/libqt-mt.so.3
#29 0x4068ccc9 in KApplication::notify () from /opt/kde3/lib/libkdecore.so.4
#30 0x409b14b7 in QETWidget::translateMouseEvent () from /opt/qt3/lib/libqt-mt.so.3
#31 0x409ae93f in QApplication::x11ProcessEvent () from /opt/qt3/lib/libqt-mt.so.3
#32 0x409ad5ba in QApplication::processNextEvent () from /opt/qt3/lib/libqt-mt.so.3
#33 0x40a06b61 in QApplication::enter_loop () from /opt/qt3/lib/libqt-mt.so.3
#34 0x409ad518 in QApplication::exec () from /opt/qt3/lib/libqt-mt.so.3
#35 0x40024a0b in main () from /opt/kde3/lib/kwrite.so
#36 0x410855b0 in __libc_start_main () from /lib/libc.so.6


-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul at imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------




More information about the kde-core-devel mailing list