Anonymous | Login | 2022-06-26 05:57 UTC | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0000570 | OMNeT++ | simulation kernel | public | 2012-05-16 16:31 | 2012-05-16 16:39 | ||||||||
Reporter | andras | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Platform | OS | OS Version | |||||||||||
Product Version | 4.2.2 | ||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000570: NaN-valued module parameter causes further similar parameters to be NaN as well | ||||||||||||
Description | If a module parameter of type double is assigned NaN, e.g. as 0/0, further parameters of the same name, type, unit etc. will be incorrectly set to NaN as well. E.g. if a parameter of a module in a module vector is set to NaN, further elements in the module vector will have that parameter to be set to NaN as well. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files | |||||||||||||
![]() |
|
(0000755) andras (administrator) 2012-05-16 16:39 |
Cause: cPar::convertToConst() tries to replace the paramImpl with a cached copy: cParImpl *cachedValue = componentType->getSharedParImpl(p); if (cachedValue) setImpl(cachedValue); else componentType->putSharedParImpl(p); Here, componentType->getSharedParImpl(p) can (incorrectly) return a NaN-valued but otherwise matching paramImpl object, regardless of what double value is in "p". getSharedParImpl() uses an underlying std::set, a binary tree which relies on a "less" operator for finding an element. This std::set incorrectly finds the NaN paramImpl. The cause is cDoubleParImpl::compare(const cParImpl *other) that contains this line: return (val == other2->val) ? 0 : (val < other2->val) ? -1 : 1; Problem is that both x<NaN and x>NaN are false, which confuses the std::set. Solution proposal: modify cDoubleParImpl::compare() so that NaN always compares as greater (or less) to all real numbers, including +-inf. |
![]() |
|||
Date Modified | Username | Field | Change |
2012-05-16 16:31 | andras | New Issue | |
2012-05-16 16:39 | andras | Note Added: 0000755 |
Copyright © 2000 - 2022 MantisBT Team |