OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000047OMNeT++runtime / Tkenvpublic2009-01-20 10:202009-01-20 11:06
ViRe 
andras 
normalminoralways
resolvedfixed 
4.0rc1 
4.0rc2 
0000047: Crash in Tkenv when inspecting a module
If a simple module has a member(such as, a queue) which is an object of class inherited from the cSimpleModule(which is inherited from cComponent), and the componenttype could be left unset. But if I try to inspect the simple module in the GUI, an error will happen. I found such codes in the tkutil.cc:
    const char *getObjectShortTypeName(cObject *object)
    {
           if (dynamic_cast<cComponent*>(object))
               return ((cComponent*)object)->getComponentType()->getName();
           else
               return object->getClassName();
    }
    
Because my queue does NOT set the componenttype, so the getComponentType() returns NULL. Should some ensurance be added?
No tags attached.
Issue History
2009-01-20 10:20rhornigNew Issue
2009-01-20 10:20rhornigAssigned To => andras
2009-01-20 10:28rhornigReporterrhornig => ViRe
2009-01-20 11:05andrasNote Added: 0000116
2009-01-20 11:06andrasNote Added: 0000117
2009-01-20 11:06andrasStatusnew => resolved
2009-01-20 11:06andrasFixed in Version => 4.0rc2
2009-01-20 11:06andrasResolutionopen => fixed

Notes
(0000116)
andras   
2009-01-20 11:05   
Modules (objects derived from cSimpleModule) may only be created via the cModuleType::create() function. It is illegal to create them directly via "new".

Tkenv has been fixed not to crash on such cases, but to print a meaningful error message.
(0000117)
andras   
2009-01-20 11:06   
Client code needs to be fixed not to instantiate a module class without cModuleType object. Tkenv crash was fixed in OMNeT++.