| Summary: | C++ import: "friend" declaration wreaks havoc | ||
|---|---|---|---|
| Product: | [Applications] umbrello | Reporter: | Maksim Melnikau <maxposedon> |
| Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | crash | CC: | finex, ralf.habacker, sroret |
| Priority: | NOR | Keywords: | triaged |
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 4.11.5 | |
| Sentry Crash Report: | |||
| Attachments: | umbrello crashed when I try open this file | ||
|
Description
Maksim Melnikau
2006-05-09 00:33:18 UTC
Created attachment 15984 [details]
umbrello crashed when I try open this file
SVN commit 541389 by okellogg:
getPackage(): Guard against circularity in the m_pUMLPackage chain.
BUG:126994
M +1 -0 ChangeLog
M +9 -5 umbrello/umlobject.cpp
--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #541388:541389
@@ -14,6 +14,7 @@
* Crash loading xmi file (125331, 126968)
* User interaction with UMLWidget improvements (126391)
* Comments are cut short when generating PHP code (126480)
+* Freeze on C++ class import (126994)
* Crash on importing Java 1.5 classes containing annotations (127160)
Version 1.5.2
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlobject.cpp #541388:541389
@@ -349,15 +349,19 @@
QString UMLObject::getPackage(QString separator) {
if (m_pUMLPackage == NULL)
return "";
- QStringList pkgList;
+ UMLPackageList pkgList;
+ QStringList pkgNames;
UMLPackage* pkg = m_pUMLPackage;
- while (pkg != NULL) {
- pkgList.prepend(pkg->getName());
- pkg = pkg->getUMLPackage();
+ while (1) {
+ pkgList.prepend(pkg);
+ pkgNames.prepend(pkg->getName());
+ if ((pkg = pkg->getUMLPackage()) == NULL ||
+ pkgList.containsRef(pkg))
+ break;
}
if (separator.isEmpty())
separator = UMLApp::app()->activeLanguageScopeSeparator();
- return pkgList.join(separator);
+ return pkgNames.join(separator);
}
UMLPackageList UMLObject::getPackages() const {
*** Bug 126797 has been marked as a duplicate of this bug. *** Gentoo [ebuild R ] kde-base/umbrello-3.5.3 USE="debug kdeenablefinal kdehiddenvisibility xinerama -arts" 0 kB thanks, bug with opening solved BUT!!! now umbrello crashed when I try move "Block" to the Class diogram (with file Created an attachment (id=15984) ) ================================================================= max_posedon@max_posedon ~ % umbrello Qt: Locales not supported on X server umbrello: WorkToolBar::loadPixmaps: n_buttonInfos = 43 umbrello: UMLListViewItem::init: s_pListView still NULL, setting it now umbrello: CppTree2Uml::parseElaboratedTypeSpecifier: text is class Fs umbrello: CppTree2Uml::parseClassSpecifier: name=File umbrello: CppTree2Uml::parseClassSpecifier: name=Block umbrello: CppTree2Uml::parseElaboratedTypeSpecifier: text is class Fs umbrello: CppTree2Uml::parseClassSpecifier: name=Directory umbrello: CppTree2Uml::parseElaboratedTypeSpecifier: text is class Fs umbrello: CppTree2Uml::parseClassSpecifier: name=Fs umbrello: CppTree2Uml::parseElaboratedTypeSpecifier: text is class Directory umbrello: UMLListView::getSelectedItems: selItems = 1 zsh: segmentation fault umbrello Ouch... yes I confirm. The C++ import has a problem with friend declarations so if you're in a hurry and just want your classes imported then comment out all "friend class XYZ;" lines in the file. I opened umbrello (svn version); then i imported the attached file, there was no crash... Could be that there isn't always a crash. Still, on single stepping thru the parse of a "friend class" line and I saw that there are problems lurking. I suggest we leave the bug open till someone finds time for an in-depth check. On the current trunk version the file makes umbrello freeze. do not crash with 4.11.5 |