When importing /usr/include/QtCore/qatomic_x86_64.h from libqt4-devel-4.7.1-8.17.1.x86_64 umbrello hangs Reproducible: Always Steps to Reproduce: 1. start umbrello 2. import qatomic_x86_64.h 3. Actual Results: umbrello hangs Expected Results: umbrello should finish the import The call stack is: #0 PreprocessLexer::preprocess() at /home/admin/src/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp:584 #1 Lexer::tokenize() at /home/admin/src/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp:390 #2 Lexer::setSource() at /home/admin/src/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp:321 #3 Driver::parseFile() at /home/admin/src/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/driver.cpp:237 #4 CppImport::parseFile() at /home/admin/src/kdesdk/umbrello/umbrello/codeimport/cppimport.cpp:135 #5 ClassImport::importFile() at /home/admin/src/kdesdk/umbrello/umbrello/codeimport/classimport.cpp:90 #6 CodeImpThread::run() at /home/admin/src/kdesdk/umbrello/umbrello/codeimpwizard/codeimpthread.cpp:61 #7 CodeImpStatusPage::importCodeFile() at /home/admin/src/kdesdk/umbrello/umbrello/codeimpwizard/codeimpstatuspage.cpp:163 #8 CodeImpStatusPage::importCode() at /home/admin/src/kdesdk/umbrello/umbrello/codeimpwizard/codeimpstatuspage.cpp:136 #9 CodeImpStatusPage::qt_metacall() at /home/admin/src/kdesdk/build/umbrello/umbrello/codeimpstatuspage.moc:86 #10 QMetaObject::activate(QObject*, QMetaObject const*, int, void**)() at /usr/lib64/libQtCore.so.4:-1 #11 QAbstractButton::clicked(bool)() at /usr/lib64/libQtGui.so.4:-1 #12 ??() at /usr/lib64/libQtGui.so.4:-1 #13 ??() at /usr/lib64/libQtGui.so.4:-1 #14 QAbstractButton::mouseReleaseEvent(QMouseEvent*)() at /usr/lib64/libQtGui.so.4:-1 #15 QWidget::event(QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #16 QApplicationPrivate::notify_helper(QObject*, QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #17 QApplication::notify(QObject*, QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #18 KApplication::notify(QObject*, QEvent*)() at /usr/lib64/libkdeui.so.5:-1 #19 QCoreApplication::notifyInternal(QObject*, QEvent*)() at /usr/lib64/libQtCore.so.4:-1 #20 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)() at /usr/lib64/libQtGui.so.4:-1 #21 ??() at /usr/lib64/libQtGui.so.4:-1 #22 QApplication::x11ProcessEvent(_XEvent*)() at /usr/lib64/libQtGui.so.4:-1 #23 ??() at /usr/lib64/libQtGui.so.4:-1 #24 g_main_context_dispatch() at /lib64/libglib-2.0.so.0:-1 #25 ??() at /lib64/libglib-2.0.so.0:-1 #26 g_main_context_iteration() at /lib64/libglib-2.0.so.0:-1 #27 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)() at /usr/lib64/libQtCore.so.4:-1 #28 ??() at /usr/lib64/libQtGui.so.4:-1 #29 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)() at /usr/lib64/libQtCore.so.4:-1 #30 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)() at /usr/lib64/libQtCore.so.4:-1 #31 QDialog::exec()() at /usr/lib64/libQtGui.so.4:-1 #32 UMLApp::slotImportingWizard() at /home/admin/src/kdesdk/umbrello/umbrello/uml.cpp:2447 #33 UMLApp::qt_metacall() at /home/admin/src/kdesdk/build/umbrello/umbrello/moc_uml.cpp:223 #34 QMetaObject::activate(QObject*, QMetaObject const*, int, void**)() at /usr/lib64/libQtCore.so.4:-1 #35 QAction::triggered(bool)() at /usr/lib64/libQtGui.so.4:-1 #36 QAction::activate(QAction::ActionEvent)() at /usr/lib64/libQtGui.so.4:-1 #37 ??() at /usr/lib64/libQtGui.so.4:-1 #38 ??() at /usr/lib64/libQtGui.so.4:-1 #39 KMenu::mouseReleaseEvent(QMouseEvent*)() at /usr/lib64/libkdeui.so.5:-1 #40 QWidget::event(QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #41 QMenu::event(QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #42 QApplicationPrivate::notify_helper(QObject*, QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #43 QApplication::notify(QObject*, QEvent*)() at /usr/lib64/libQtGui.so.4:-1 #44 KApplication::notify(QObject*, QEvent*)() at /usr/lib64/libkdeui.so.5:-1 #45 QCoreApplication::notifyInternal(QObject*, QEvent*)() at /usr/lib64/libQtCore.so.4:-1 #46 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)() at /usr/lib64/libQtGui.so.4:-1 #47 ??() at /usr/lib64/libQtGui.so.4:-1 #48 QApplication::x11ProcessEvent(_XEvent*)() at /usr/lib64/libQtGui.so.4:-1 #49 ??() at /usr/lib64/libQtGui.so.4:-1 #50 g_main_context_dispatch() at /lib64/libglib-2.0.so.0:-1 #51 ??() at /lib64/libglib-2.0.so.0:-1 #52 g_main_context_iteration() at /lib64/libglib-2.0.so.0:-1 #53 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)() at /usr/lib64/libQtCore.so.4:-1 #54 ??() at /usr/lib64/libQtGui.so.4:-1 #55 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)() at /usr/lib64/libQtCore.so.4:-1 #56 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)() at /usr/lib64/libQtCore.so.4:-1 #57 QCoreApplication::exec()() at /usr/lib64/libQtCore.so.4:-1 #58 main() at /home/admin/src/kdesdk/umbrello/umbrello/main.cpp:110 at frame #0 the following for loop is located: 582: void PreprocessLexer::preprocess() 583: { 584: for (;;) { nextLine(); if (m_source.currentChar().isNull()) break; } Token tk = m_source.createToken(Token_eof, m_source.get_ptr()); m_preprocessedString += tk.text(); } Umbrello hangs in parsing line 116 of qatomic_x86_64.h: 113:inline bool QBasicAtomicInt::ref() 114:{ 115: unsigned char ret; 116: asm volatile("lock\n" 117: "incl %0\n" 118: "setne %1" 119: : "=m" (_q_value), "=qm" (ret) 120: : "m" (_q_value) 121: : "memory"); 122: return ret != 0; 123:} at character 23 - the backslash 116: asm volatile("lock\n"
Created attachment 72123 [details] test case The problematic code part could be reduced to the appended file. At least the open #if defined(...) is required. Closing the #if part before the method do not raise the error.
The reason for this that the lexer do not handle '\n' (and other escape sequences like '\0') inside a string.
SVN commit 1303066 by habacker: Fixed hanging bug because of not supported escape sequences. There may be more cases because escape sequence handling is still not complete. M +2 -2 lexer.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1303066
SVN commit 1303067 by habacker: Fixed hanging bug because of not supported escape sequences. There may be more cases because escape sequence handling is still not complete. M +2 -2 lexer.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1303067
Other cases are handled in bug #302539
*** Bug 218386 has been marked as a duplicate of this bug. ***
apply fixed bug from 4.9.0 changelog