[Ns-bugs] [Bug 269] New: Infinite recursion when NS_LOG=*=level_all|prefix_func|prefix_time

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Sun Aug 3 03:17:52 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=269

           Summary: Infinite recursion when
                    NS_LOG=*=level_all|prefix_func|prefix_time
           Product: ns-3
           Version: pre-release
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: simulation core
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: cgavos at gmail.com
                CC: cgavos at gmail.com


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 ();
 }


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list