Bugzilla – Full Text Bug Listing |
Summary: | all python programs intermittently crash | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
Component: | examples | Assignee: | ns-bugs <ns-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | watrous |
Priority: | P5 | ||
Version: | pre-release | ||
Hardware: | PC | ||
OS: | Linux | ||
Bug Depends on: | 954 | ||
Bug Blocks: |
Description
Tom Henderson
2012-12-13 14:36:50 EST
This bug can be fixed for this example by adding this to the beginning of the example: ns.core.Time.SetResolution(ns.core.Time.NS) All of our python examples (not just first.py) are now intermittently crashing on some platforms (OS X, Ubuntu 10.04) with older gcc. Explicit calls to SetResolution() seem to avoid the crashes. This test program will intermittently crash: import ns.core ns.core.Simulator.Run() ns.core.Simulator.Destroy() This one will not crash: import ns.core ns.core.Time.SetResolution(ns.core.Time.NS) ns.core.Simulator.Run() ns.core.Simulator.Destroy() When it crashes it seems to be dying in this loop (m_event is null pointer): void DefaultSimulatorImpl::Run (void) { NS_LOG_FUNCTION (this); // Set the current threadId as the main threadId m_main = SystemThread::Self(); ProcessEventsWithContext (); m_stop = false; while (!m_events->IsEmpty () && !m_stop) { ProcessOneEvent (); } and it seems to be doing some thread context switching around that time. |