Bugzilla – Bug 1216
RvBatteryModel segfalts if the update event happens before load changes
Last modified: 2015-04-30 18:32:50 EDT
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).
Used the patch for updating the RV Battery Model behavior.