Bugzilla – Bug 1244
Seg Faults in optimized builds due to missing Logging components
Last modified: 2011-08-11 08:44:10 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.
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