Bug report: dropAndDelete() does not remove Object from cDefaultList - causes segfault

40 views
Skip to first unread message

janis...@googlemail.com

unread,
Jul 9, 2017, 3:54:50 PM7/9/17
to OMNeT++ Users
I couldn't register to the Bug tracker, because the captcha does not load (cannot be displayed because image contains errors). Hence, I'm reporting this bug here.

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.

- xblax

Michael Kirsche

unread,
Jul 11, 2017, 6:57:30 AM7/11/17
to OMNeT++ Users
Which version of OMNeT++ are you using?

janis...@googlemail.com

unread,
Jul 11, 2017, 10:57:34 AM7/11/17
to OMNeT++ Users
OMNeT++ 5.1

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.

Michael Kirsche

unread,
Jul 12, 2017, 5:36:10 PM7/12/17
to OMNeT++ Users
Okay, I've posted your infos on the bugtracker: https://dev.omnetpp.org/bugs/view.php?id=1015
Reply all
Reply to author
Forward
0 new messages