View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] |
ID | Project | Category | View Status | Date Submitted | Last Update |
0000640 | OMNeT++ | simulation kernel | public | 2013-03-21 10:34 | 2013-03-21 10:34 |
|
Reporter | Harti | |
Assigned To | | |
Priority | normal | Severity | crash | Reproducibility | always |
Status | new | Resolution | open | |
Platform | | OS | | OS Version | |
Product Version | 4.2.2 | |
Target Version | | Fixed in Version | | |
|
Summary | 0000640: Destructor of cOwnedObject may invoke undefined behaviour if object is owned |
Description | If a cOwnedObject is deleted and has an owner and this owner is not the default list, the method ownedObjectDeleted() on cObject throws a cRuntimeError exception. Throwing exceptions from destructors may invoke undefined behaviour - on the platform I'm working it results in abort() called without having a chance to see the message from the exception.
The cOwnedObject destructor should catch the exception, print the message and either return (in which case the error of deleting an owned object translates into a warning) or exit the simulation. In no case it should allow to propagate the exception outside the destructor. |
Additional Information | See section 15.2 of C++11, clause 3, especially the note. I don't have a reference to C++03 at hand but something equaivalent is there too. |
Tags | No tags attached. |
|
Attached Files | |
|