Bug 1244

Summary: Seg Faults in optimized builds due to missing Logging components
Product: ns-3 Reporter: John Abraham <john.abraham.in>
Component: coreAssignee: Mathieu Lacage <mathieu.lacage>
Status: RESOLVED FIXED    
Severity: blocker CC: ns-bugs
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   

Description John Abraham 2011-08-11 05:54:33 UTC
For example:

Launch /home/john/buildslave/full-ub64-11-g++-4.5.2/build/build/optimized/src/wimax/examples/wimax-simple
Synchronously execute /home/john/buildslave/full-ub64-11-g++-4.5.2/build/build/optimized/src/wimax/examples/wimax-simple
PASS: Example /home/john/buildslave/full-ub64-11-g++-4.5.2/build/build/optimized/src/mesh/examples/mesh
Return code =  139
stderr =  msg="Logging component "UdpClient" not found. See above for a list of available log components", file=../src/core/model/log.cc, line=280
Segmentation fault

Moving functions such as LogComponentEnable/All/Disable/DisableAll under "NS3_LOG_ENABLE" fixes it.
Comment 1 Mathieu Lacage 2011-08-11 08:44:10 UTC
NS3_LOG_ENABLE is not a property of how you build the ns-3 core. It is a property of how you build the user code that links against it. i.e., it controls whether or not the user code uses the builtin logging facility, not whether or not the logging facility is compiled in.

So, a more useful fix in this case is to make NS_LOG_COMPONENT_DEFINE be defined correctly unconditionally and move it out of the NS3_LOG_ENABLE ifdef.

changeset: dec79131f5f8