Bug 58 - Simulator::Remove and Simulator::IsExpired are not safe together
Simulator::Remove and Simulator::IsExpired are not safe together
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
pre-release
PC Linux
: P1 blocker
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-27 02:32 EDT by Mathieu Lacage
Modified: 2008-07-01 13:32 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Lacage 2007-07-27 02:32:16 EDT
EventId ev = Simulator::Schedule (...)
EventId ev1 = ev;
Simulator::Remove (ev);
// following call buggy: undefined behavior.
Simulator::IsExpired (ev1);

If we want to make this work reliably, we need to make the EventImpl refcounted and we need to add a bool isRemoved in it. binding authors might be super happy with this change.
Comment 1 Mathieu Lacage 2007-07-27 11:57:31 EDT
Full patchset in http://code.nsnam.org/mathieu/ns-3-bug58
Comment 2 Gustavo J. A. M. Carneiro 2007-08-02 10:15:44 EDT
fix was merged recently