Summary: | Segfault importing Java code (project and single class) into Umbrello [QString::operator==, JavaImport::joinTypename, JavaImport::parseStmt] | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Martin Nyhus <bugs.kde.org> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | alan.krueger, andresbajotierra, carloscunarro, debugger, felix, geroxp, kk1fff, laurent.m.david, mgenhart, NatanaelA, okellogg, pmanousis, pregenitor, ralf.habacker, teabof |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.9.0 | |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi |
Description
Martin Nyhus
2010-03-14 22:07:50 UTC
*** Bug 223504 has been marked as a duplicate of this bug. *** I can confirm this behaviour with the following backtrace: Application: Umbrello UML-Modeller (umbrello), signal: Segmentation fault [KCrash Handler] #6 0xb5eba8e9 in QString::operator==(QLatin1String const&) const () from /usr/lib/libQtCore.so.4 #7 0x0810024a in qStringComparisonHelper (s1=..., s2=0x8764fd0 ";") at /usr/include/qt4/QtCore/qstring.h:908 #8 0x0816b8f7 in QString::operator!= (this=0xbfaf6460) at /usr/include/qt4/QtCore/qstring.h:913 #9 JavaImport::parseStmt (this=0xbfaf6460) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:584 #10 0x0816e5eb in NativeImportBase::parseFile (this=0xbfaf6460, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/nativeimportbase.cpp:416 #11 0x081676d3 in JavaImport::parseFile (this=0xbfaf6460, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:251 #12 0x08160075 in ClassImport::importFiles (this=0xbfaf6460, fileList=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/classimport.cpp:45 #13 0x08167c0a in JavaImport::spawnImport (this=0xbfaf6a70, file=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:126 #14 0x0816897f in JavaImport::resolveClass (this=0xbfaf6a70, className=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:209 #15 0x0816b74a in JavaImport::parseStmt (this=0xbfaf6a70) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:564 #16 0x0816e5eb in NativeImportBase::parseFile (this=0xbfaf6a70, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/nativeimportbase.cpp:416 #17 0x081676d3 in JavaImport::parseFile (this=0xbfaf6a70, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:251 #18 0x08160075 in ClassImport::importFiles (this=0xbfaf6a70, fileList=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/classimport.cpp:45 #19 0x08167c0a in JavaImport::spawnImport (this=0xbfaf7080, file=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:126 #20 0x0816897f in JavaImport::resolveClass (this=0xbfaf7080, className=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:209 #21 0x0816bbdd in JavaImport::parseStmt (this=0xbfaf7080) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:514 #22 0x0816e5eb in NativeImportBase::parseFile (this=0xbfaf7080, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/nativeimportbase.cpp:416 #23 0x081676d3 in JavaImport::parseFile (this=0xbfaf7080, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:251 #24 0x08160075 in ClassImport::importFiles (this=0xbfaf7080, fileList=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/classimport.cpp:45 #25 0x08167c0a in JavaImport::spawnImport (this=0xbfaf7690, file=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:126 #26 0x0816897f in JavaImport::resolveClass (this=0xbfaf7690, className=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:209 #27 0x0816a890 in JavaImport::parseStmt (this=0xbfaf7690) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:352 #28 0x0816e5eb in NativeImportBase::parseFile (this=0xbfaf7690, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/nativeimportbase.cpp:416 #29 0x081676d3 in JavaImport::parseFile (this=0xbfaf7690, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:251 #30 0x08160075 in ClassImport::importFiles (this=0xbfaf7690, fileList=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/classimport.cpp:45 #31 0x08167c0a in JavaImport::spawnImport (this=0x9509078, file=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:126 #32 0x0816897f in JavaImport::resolveClass (this=0x9509078, className=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:209 #33 0x0816b74a in JavaImport::parseStmt (this=0x9509078) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:564 #34 0x0816e5eb in NativeImportBase::parseFile (this=0x9509078, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/nativeimportbase.cpp:416 #35 0x081676d3 in JavaImport::parseFile (this=0x9509078, filename=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp:251 #36 0x08160075 in ClassImport::importFiles (this=0x9509078, fileList=...) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/codeimport/classimport.cpp:45 #37 0x086c923d in UMLApp::importFiles (this=0x90b0550, fileList=0xbfaf7cf8) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/uml.cpp:2213 #38 0x086d7480 in UMLApp::slotImportClasses (this=0x90b0550) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/uml.cpp:2250 #39 0x086d9400 in UMLApp::qt_metacall (this=0x90b0550, _c=QMetaObject::InvokeMetaMethod, _id=162054500, _a=0xbfaf7e68) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/uml.moc:282 #40 0xb5f7ae5a in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4 #41 0xb5f895f5 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4 #42 0xb61bab89 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4 #43 0xb61bcd9c in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQtGui.so.4 #44 0xb665fbfc in ?? () from /usr/lib/libQtGui.so.4 #45 0xb66660ab in ?? () from /usr/lib/libQtGui.so.4 #46 0xb66670b7 in QMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4 #47 0xb710eea5 in KMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.5 #48 0xb621f718 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4 #49 0xb66686ac in QMenu::event(QEvent*) () from /usr/lib/libQtGui.so.4 #50 0xb61c13cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4 #51 0xb61c89b7 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4 #52 0xb70185ba in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5 #53 0xb5f75beb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4 #54 0xb61c790f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4 #55 0xb62531a7 in ?? () from /usr/lib/libQtGui.so.4 #56 0xb62521a1 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4 #57 0xb628100a in ?? () from /usr/lib/libQtGui.so.4 #58 0xb54abe88 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 #59 0xb54af730 in ?? () from /lib/libglib-2.0.so.0 #60 0xb54af863 in g_main_context_iteration () from /lib/libglib-2.0.so.0 #61 0xb5fa1805 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4 #62 0xb6280b35 in ?? () from /usr/lib/libQtGui.so.4 #63 0xb5f74209 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4 #64 0xb5f7465a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4 #65 0xb5f7884f in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4 #66 0xb61c1467 in QApplication::exec() () from /usr/lib/libQtGui.so.4 #67 0x086a9635 in main (argc=1, argv=0xbfaf9164) at ./devel/umbrello/kdesdk-4.3.2/umbrello/umbrello/main.cpp:111 This is a patch for a workaround of the crash that I experienced. It may be a dirty patch, but for me it works: --- javaimport.cpp 2009-06-03 13:54:28.000000000 +0200 +++ ../../../../../kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp 2010-04-20 14:13:29.711275970 +0200 @@ -77,8 +77,11 @@ } } // to handle multidimensional arrays, call recursively - if (m_source[m_srcIndex + 1] == "[") { - typeNameRet = joinTypename( typeNameRet ); + + if (m_srcIndex<(sizeof(m_source) / sizeof(int))) { + if (m_source[m_srcIndex + 1] == "[") { + typeNameRet = joinTypename( typeNameRet ); + } } return typeNameRet; } @@ -581,8 +584,13 @@ } // reset visibility to default m_currentAccess = m_defaultCurrentAccess; - if (m_source[m_srcIndex] != ";") { - uError() << "importJava: ignoring trailing items at " << name; + if (m_srcIndex<(sizeof(m_source) / sizeof(int))) { + if (m_source[m_srcIndex] != ";") { + uError() << "importJava: ignoring trailing items at " << name; + skipStmt(); + } + } else { + uError() << "index out of range: ignoring statement " << name; skipStmt(); } return true; Created attachment 43919 [details]
New crash information added by DrKonqi
Same as original,
Umbrello crashed after I tried importing source from a Java project (Code -> Import Project).
*** Bug 246981 has been marked as a duplicate of this bug. *** *** Bug 245933 has been marked as a duplicate of this bug. *** *** Bug 237138 has been marked as a duplicate of this bug. *** [Comment from a bug triager] From bug 257768: -- Information about the crash: Every time when I import android source code /framework/base/core/java/android, it crashes after ask me is Parcelable a namespace of a class. No matter which answer I gave, it crashes every time. *** Bug 257768 has been marked as a duplicate of this bug. *** *** Bug 258500 has been marked as a duplicate of this bug. *** Created attachment 68539 [details]
New crash information added by DrKonqi
umbrello (2.7.4) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4
- What I was doing when the application crashed:
Every time when I import android source code /framework/base/core/java/android,
it crashes after ask me is Java a namespace of a class. No matter which
answer I gave, it crashes every time.
-- Backtrace (Reduced):
#8 QList (l=<optimized out>, this=<optimized out>) at /usr/include/QtCore/qlist.h:118
#9 QListIterator (container=<optimized out>, this=<optimized out>) at /usr/include/QtCore/qlist.h:883
#10 UMLPackage::findObject (this=0x1f4, name=...) at /chakra/desktop-testing/kdesdk/src/kdesdk-4.7.4/umbrello/umbrello/package.cpp:238
#11 0x08377e4d in UMLDoc::isUnique (this=0x8fe9150, name=..., package=0x1f4) at /chakra/desktop-testing/kdesdk/src/kdesdk-4.7.4/umbrello/umbrello/umldoc.cpp:973
#12 0x08339fac in Model_Utils::uniqObjectName (type=500, parentPkg=0x942c148, prefix=) at /chakra/desktop-testing/kdesdk/src/kdesdk-4.7.4/umbrello/umbrello/model_utils.cpp:438
What exactly are we talking about here? I see lots of marked-as-duplicates and backtraces but not one single Java code attachment to reproduce this with. SVN commit 1279959 by okellogg: (In reply to comment #12) > [...] > I see lots of marked-as-duplicates and backtraces but not one single Java > code attachment to reproduce this with. Okay, I looked at the marked-as-duplicates such as https://bugs.kde.org/show_bug.cgi?id=245933#c2 and it seems we are talking about Java variable-length parameters (three dots following the type name.) Here is the fix for that. Import_Utils::createUMLObject(): If typeName.contains("...") then we are dealing with a Java variable-length parameter. Handle this case specially: - Set type to UMLObject::ot_Datatype - Set parentPkg to umldoc->datatypeFolder() - Set isAdorned false (to preserve ot_Datatype and prevent second creation) M +6 -1 import_utils.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1279959 *** Bug 266978 has been marked as a duplicate of this bug. *** *** Bug 223760 has been marked as a duplicate of this bug. *** *** Bug 308249 has been marked as a duplicate of this bug. *** apply fixed bug from 4.9.0 changelog |