Bugzilla – Full Text Bug Listing |
Summary: | RvBatteryModel segfalts if the update event happens before load changes | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Claudio <claudio-daniel.freire> |
Component: | energy | Assignee: | Cristiano Tapparello <cristiano.tapparello> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ns-bugs, tomh |
Priority: | P5 | ||
Version: | ns-3-dev | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | Mercurial patchset. Import with "hg import <patchfile>" |
Used the patch for updating the RV Battery Model behavior. |
Created attachment 1198 [details] Mercurial patchset. Import with "hg import <patchfile>" Fix RvBatteryModel: it could cause segfaults at some times, if somehow Discharge() was called with an empty m_timeStamps (ie, if the energy model update event happened before load changes) I found this condition when running benchmarks (repeated execution of tests), so it's not an impossible path. The modified logic, also, is independent of at what timestamp the simulator starts processing model changes (ie, a model that is assigned in the middle of the simulation would have its DoStart method called at non-zero time).