Bug 269 - Infinite recursion when NS_LOG=*=level_all|prefix_func|prefix_time
: Infinite recursion when NS_LOG=*=level_all|prefix_func|prefix_time
Status: RESOLVED FIXED
: ns-3
simulation core
: pre-release
: All All
: P1 minor
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-08-03 06:17 EDT by
Modified: 2008-08-03 12:04 EDT (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-08-03 06:17:51 EDT
When NS_LOG is set to '*=level_all|prefix_func|prefix_time' infinite recursion
occurs until the program crashes. Simulator::Now calls NS_LOG_FUNCTION_NOARGS
which in turn calls Simulator::Now. The same happens for Simulator::GetImpl.
This was introduced in revision 3469:9e763021e045.

Commenting out the following lines solves the problem.

diff -r 794671c6a8a1 src/simulator/simulator.cc
--- a/src/simulator/simulator.cc    Fri Aug 01 23:15:00 2008 +0100
+++ b/src/simulator/simulator.cc    Sun Aug 03 11:13:44 2008 +0100
@@ -67,7 +67,7 @@
 SimulatorImpl *
 Simulator::GetImpl (void)
 {
-  NS_LOG_FUNCTION_NOARGS ();
+  //NS_LOG_FUNCTION_NOARGS ();

   if (m_impl == 0) 
     {
@@ -90,7 +90,7 @@
 //
       LogSetTimePrinter (&TimePrinter);
     }
-  NS_LOG_LOGIC ("priv " << m_impl);
+  //NS_LOG_LOGIC ("priv " << m_impl);
   return PeekPointer (m_impl);
 }

@@ -162,7 +162,7 @@
 Time
 Simulator::Now (void)
 {
-  NS_LOG_FUNCTION_NOARGS ();
+  //NS_LOG_FUNCTION_NOARGS ();
   return GetImpl ()->Now ();
 }
------- Comment #1 From 2008-08-03 12:04:52 EDT -------
changeset b8cccd54da26