Bug 1044 - Seconds (1e-9) creates Time that is not IsPositive ()
Seconds (1e-9) creates Time that is not IsPositive ()
Product: ns-3
Classification: Unclassified
Component: core
All All
: P5 normal
Assigned To: Mathieu Lacage
Depends on:
  Show dependency treegraph
Reported: 2011-01-17 04:48 EST by Artem Krasilov
Modified: 2011-04-17 08:34 EDT (History)
2 users (show)

See Also:

simpe program showing the problem (458 bytes, text/x-c++src)
2011-01-17 04:50 EST, Artem Krasilov

Note You need to log in before you can comment on or make changes to this bug.
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