Bug 77645 - Umbrello crashes on code generation and on save when class "Widget" in model
Summary: Umbrello crashes on code generation and on save when class "Widget" in model
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: HI crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-15 09:36 UTC by Christopher Mann
Modified: 2004-11-19 17:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Mann 2004-03-15 09:36:22 UTC
Version:           1.2.90 (using KDE 3.2.1,  (testing/unstable))
Compiler:          gcc version 3.3.3 (Debian)
OS:          Linux (i686) release 2.4.21

I tried generating code many times wtih many different files, and I seem to always come across the same problem :
A system crash occurs.  Sometimes the .xmi file is empty !
The common link in all the files is that I have a class "Widget".  When I use files without this class "Widget" everything is OK.

Unable to show backtrace (Why is that ?)

infopol-chris:~/logiciels/kdesdk-040314/umbrello# umbrello: CodeGeneratorFactory created
umbrello: Querying languages available
umbrello: Looking up generator for language Ada
umbrello: Looking up generator for language ActionScript
umbrello: Looking up generator for language Cpp
umbrello: Looking up generator for language IDL
umbrello: Looking up generator for language Java
umbrello: Looking up generator for language JavaScript
umbrello: Looking up generator for language Perl
umbrello: Looking up generator for language PHP
umbrello: Looking up generator for language Python
umbrello: Looking up generator for language SQL
umbrello: Looking up generator for language XMLSchema
umbrello: CodeGeneratorFactory created
umbrello: Looking up generator for language PHP
umbrello: CodeGeneratorFactory created
umbrello: Looking up generator for language Cpp
umbrello: WARNING: Can't set content: unexpected end of file Line: 1
umbrello: CodeGeneratorFactory created
umbrello: Looking up generator for language Cpp
Comment 1 Jonathan Riddell 2004-03-16 00:44:15 UTC
This only happens on diagrams which have been saved then loaded.

>Unable to show backtrace (Why is that ?)
It's either because the packages were compiled without --debug or because DrKonqui is broken (I suspect the second since I can get a backtrace from gdb but not DrKonqi).

#0  0x0811336e in CodeGenerator::getPolicy() (this=0x0) at codegenerator.cpp:183
#1  0x0820c07e in CodeGenerationWizard::showPage(QWidget*) (this=0xbfffeab0, page=0x8455838)
    at umbrello/dialogs/codegenerationwizard.cpp:167
#2  0x40d7b1ff in QWizard::next() () from /usr/lib/libqt-mt.so.3
#3  0x40f16412 in QWizard::qt_invoke(int, QUObject*) () from /usr/lib/libqt-mt.so.3
#4  0x08224163 in CodeGenerationWizardBase::qt_invoke(int, QUObject*) () at qsizepolicy.h:95
#5  0x0820c876 in CodeGenerationWizard::qt_invoke(int, QUObject*) (this=0xbfffeab0, _id=56, _o=0xbfffe160) at codegenerationwizard.moc:103
#6  0x40bced9c in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3
#7  0x40bcebd4 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#8  0x40ef32fe in QButton::clicked() () from /usr/lib/libqt-mt.so.3
#9  0x40c5d6ea in QButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
#10 0x40c03da7 in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
Comment 2 Oliver Kellogg 2004-06-19 22:47:04 UTC
> The common link in all the files is that I have a class "Widget".
> When I use files without this class "Widget" everything is OK. 

Could you create an attachment that solicits the bevahiour?
Also, please list the exact steps required to get the crash.
Thanks.
Comment 3 Tobias Koenig 2004-08-11 15:15:59 UTC
According to the backtrace, the document (m_doc) of the CodeGenerationWizard has
no CodeGenerator set, so in showPage() a null pointer is accessed in line
  CodeGenerationPolicy *policy = m_doc->getCurrentCodeGenerator()->getPolicy()

Is it enough to check for null pointer here or is the null pointer itself the bug?

Ciao,
Tobias
Comment 4 Tobias Koenig 2004-11-19 17:29:08 UTC
CVS commit by tokoe: 

Set the code generator, otherwise you'll get a lot of crashes all over the
application.

CCMAIL:77645-done@bugs.kde.org


  M +2 -0      uml.cpp   1.119


--- kdesdk/umbrello/umbrello/uml.cpp  #1.118:1.119
@@ -632,4 +632,5 @@ void UMLApp::slotFileOpen() {
 
         }
+        setGenerator(createGenerator());
         slotUpdateViews();
         loading = false;
@@ -655,4 +656,5 @@ void UMLApp::slotFileOpenRecent(const KU
 
         loading = false;
+        setGenerator(createGenerator());
         slotUpdateViews();
         slotStatusMsg(i18n("Ready."));