Bug 1044

Summary: Seconds (1e-9) creates Time that is not IsPositive ()
Product: ns-3 Reporter: Artem Krasilov <krasilov>
Component: coreAssignee: Mathieu Lacage <mathieu.lacage>
Status: RESOLVED FIXED    
Severity: normal CC: mathieu.lacage, ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: simpe program showing the problem

Description Artem Krasilov 2011-01-17 04:48:14 EST
I'm trying to schedule a method in a small amount of time (~1e-9 sec).
To achieve this I have to instantiate Time object which turns out to be non-positive (IsPositive() returns false).
Non-positive Time leads to assert failure in DefaultSimulatorImpl::Schedule():

assert failed. cond="tAbsolute >= TimeStep (m_currentTs)", file=../src/simulator/default-simulator-impl.cc, line=193

This is not very surprising by itself but this also leads to random (depending on RngRun) crashes if the scheduling amount is taken from RandomVariable.
This can cause corrupted simulation results.

Example to reproduce this bug is in the attachment.
It's worth to mention, that the same example works fine in mathieu/ns-3-time repository.
Comment 1 Artem Krasilov 2011-01-17 04:50:20 EST
Created attachment 1025 [details]
simpe program showing the problem
Comment 2 Mathieu Lacage 2011-04-17 08:34:28 EDT
merged ns-3-time