OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0001015OMNeT++simulation kernelpublic2017-07-12 21:352017-07-12 21:35
mkirsche 
 
normalminorhave not tried
newopen 
5.1 
 
0001015: dropAndDelete of cTopology object leads to segmentation fault
From a report on the OMNeT++ mailing list:

"I found a bug, that is causing a segmentation fault on destruction of modules in my simulation.
I think the problem is, that dropAndDelete(), defined in cobject.cc, does not remove deleted objects from the owner's object list that is inherited by cDefaultList. The segmentation fault is then caused by the dynamic_cast in the destructor of cDefaultList, since the memory is already unallocated. The object list should never contain pointers of deleted objects.

Possible fix: overwrite dropAndDelete() in cDefaultList and remove owned objects from the object list before deletion."

and in addition:

"In my case I can not dropAndDelete a cTopology object that is owned by a cSimpleModule. If I dropAndDelete it, the Simulation segfaults once the cDefaultList destructor of the cSimpleModule is called (in my case on simulation termination). It's not too dramatic as I can just not dropAndDelete the cTopology in the destructor of the owner module. But then I'm getting a notice "undisposed object: (omnetpp::cTopology) -- check module destructor" at the end of simulation."
Link to the entry on the OMNeT mailing list: https://groups.google.com/d/msg/omnetpp/e4tn_QqKOnY/4xaCL9qmBAAJ [^]
No tags attached.
Issue History
2017-07-12 21:35mkirscheNew Issue

There are no notes attached to this issue.