Difference between revisions of "Troubleshooting"

From Nsnam
Jump to: navigation, search
(bug update)
(fedora core 11 troubleshooting)
Line 3: Line 3:
 
This is a wiki; if you find items not adequately covered below, please consider adding an entry.
 
This is a wiki; if you find items not adequately covered below, please consider adding an entry.
  
 +
== ns-allinone-3.5 build issues ==
 +
 +
=== gcc-4.4 issues ===
 +
 +
For Fedora Core 11 and other systems that use gcc-4.4, you may encounter this type of compilation error:
 +
 +
  [614/702] cxx: build/debug/bindings/python/ns3_module_csma.cc ->
 +
  build/debug/bindings/python/ns3_module_csma_3.o
 +
  In file included from /usr/include/python2.6/pyconfig.h:6,
 +
                from /usr/include/python2.6/Python.h:8,
 +
                from debug/bindings/python/ns3module.h:3,
 +
                from ../bindings/python/ns3module_helpers.cc:2:
 +
  /usr/include/python2.6/pyconfig-64.h:1022:1: error: "_POSIX_C_SOURCE"
 +
  redefined
 +
 +
and
 +
 +
  gcc " " - f P I C " " " " - D _ _ A S S E M B L 1 Y _ _ - f P I C " "
 +
  -Ilinux-2.6.18/include -Ilinux-2.6.18/include/asm/mach-default -Isim
 +
  -Ilinux-2.6.18/nsc -Ilinux-2.6.18/override -c -o
 +
  linux-2.6.18/arch/x86_64/lib/csum-copy.o
 +
  linux-2.6.18/arch/x86_64/lib/csum-copy.S
 +
  gcc:  : No such file or directory
 +
  gcc: f: No such file or directory
 +
  gcc: P: No such file or directory
 +
  gcc: I: No such file or directory
 +
  gcc: C: No such file or directory
 +
  gcc:  : No such file or directory
 +
  gcc:  : No such file or directory
 +
  ...
 +
 +
The first error requires this patch to ns-3.5:
 +
http://code.nsnam.org/ns-3-dev/rev/e33a677e8864
 +
 +
The second error is an error in Network Simulation Cradle and requires patching nsc-0.5.0 with the nsc.patch attached to this message:  http://mailman.isi.edu/pipermail/ns-developers/2009-September/006522.html
  
 
== ns-allinone-3.4 build issues ==
 
== ns-allinone-3.4 build issues ==

Revision as of 13:33, 13 September 2009

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

This is a wiki; if you find items not adequately covered below, please consider adding an entry.

ns-allinone-3.5 build issues

gcc-4.4 issues

For Fedora Core 11 and other systems that use gcc-4.4, you may encounter this type of compilation error:

 [614/702] cxx: build/debug/bindings/python/ns3_module_csma.cc ->
 build/debug/bindings/python/ns3_module_csma_3.o
 In file included from /usr/include/python2.6/pyconfig.h:6,
                from /usr/include/python2.6/Python.h:8,
                from debug/bindings/python/ns3module.h:3,
                from ../bindings/python/ns3module_helpers.cc:2:
 /usr/include/python2.6/pyconfig-64.h:1022:1: error: "_POSIX_C_SOURCE"
 redefined

and

 gcc " " - f P I C " " " " - D _ _ A S S E M B L 1 Y _ _ - f P I C " "
 -Ilinux-2.6.18/include -Ilinux-2.6.18/include/asm/mach-default -Isim
 -Ilinux-2.6.18/nsc -Ilinux-2.6.18/override -c -o
 linux-2.6.18/arch/x86_64/lib/csum-copy.o
 linux-2.6.18/arch/x86_64/lib/csum-copy.S
 gcc:  : No such file or directory
 gcc: f: No such file or directory
 gcc: P: No such file or directory
 gcc: I: No such file or directory
 gcc: C: No such file or directory
 gcc:  : No such file or directory
 gcc:  : No such file or directory
 ...

The first error requires this patch to ns-3.5: http://code.nsnam.org/ns-3-dev/rev/e33a677e8864

The second error is an error in Network Simulation Cradle and requires patching nsc-0.5.0 with the nsc.patch attached to this message: http://mailman.isi.edu/pipermail/ns-developers/2009-September/006522.html

ns-allinone-3.4 build issues

Scons NSC error

Note: This issue should not appear in ns-allinone-3.5 or later.

# Build NSC
Entering directory `nsc-0.5.0'
 =>  python scons.py linux-2.6.18
scons: Reading SConscript files ...
Checking target architecure...(cached) x86
AttributeError: SConsEnvironment instance has no attribute 'CFile': 

or

# Build NSC
Entering directory `nsc-0.5.0'
 =>  python scons.py linux-2.6.18
scons: Reading SConscript files ...
Checking target architecure...(cached) x86
scons: done reading SConscript files.
scons: Building targets ...
scons: *** While building `['globaliser/lexer.lex.cc']' from `
['globaliser/lexer.l']': Don't know how to build from a source file
with suffix `.l'.  Expected a suffix in this list: ['.i'].
scons: building terminated because of errors. 

This indicates that you probably don't have flex and bison installed on your system (for compiling NSC). On Ubuntu/Debian systems, you can try:

sudo apt-get install flex bison

For other systems, consult your package repositories, or install the packages from source. You may optionally edit the .config file of ns-allinone-3.4 to remove the nsc line, since nsc is an optional component:

<?xml version="1.0" ?><config>
    <ns-3 branch="ns-3.4" dir="ns-3.4"/>
    <ns-3-traces branch="ns-3.4-ref-traces" dir="ns-3.4-ref-traces"/>
    <pybindgen dir="pybindgen-0.10.0.630" version="0.10.0.630"/>
</config>

Platform-specific issues

SELinux (First reported on Fedora Core 10)

cannot restore segment prot after reloc: Permission denied

If you see a message such as this when executing an ns-3 script, you have crossed swords with SELinux. You have several alternatives to move forward. The first is to change the library file security context. If, for example, the OS complains about your liblinux2.6.26.so library, you can:

 cd ns-3-allinone/nsc/linux2.6.26
 chcon -t texrel_shlib_t liblinux2.6.26.so 

If you feel confident about about security and are okay with it, you can temporarily disable SELinux by

 /usr/sbin/setenforce 0

If you don't care about security at all you can permanently disable SELinux by

 changing "enforcing" to "disabled" in /etc/selinux/config and rebooting.

Cygwin

Python bindings

Python bindings do not build successfully due to a gccxml bug. See the NS-3_Python_Bindings#Caveats page.

If you see "resolving vtable" messages while linking such as the below when you compile on Cygwin, you can safely ignore them:

[530/535] cxx_link: build/debug/examples/wifi-wired-bridging_23.o -> build/debug
/examples/wifi-wired-bridging.exe
Info: resolving vtable for ns3::EmptyAttributeValueby linking to __imp___ZTVN3ns
319EmptyAttributeValueE (auto-import)
Info: resolving vtable for ns3::RandomVariableValueby linking to __imp___ZTVN3ns
319RandomVariableValueE (auto-import)
Info: resolving vtable for ns3::RectangleValueby linking to __imp___ZTVN3ns314Re
ctangleValueE (auto-import)
Info: resolving vtable for ns3::TimeValueby linking to __imp___ZTVN3ns39TimeValu
eE (auto-import)
Info: resolving vtable for ns3::BooleanValueby linking to __imp___ZTVN3ns312Bool
eanValueE (auto-import)

etc.

NSC

The Network Simulation Cradle is not supported under Cygwin. It is advised to use a Unix-based platform instead. Windows users can use a virtual machine to run e.g. Linux. See e.g. http://www.virtualbox.org/ for a free virtual machine.

General build problems

  • Q. What is this kind of build error representative of?
 assert failed. file=../src/core/type-id.cc, line=389, cond="uid != 0"
 Command ['/ns-3-dev/build/debug/examples/mixed-wireless'] exited with code -5
  • A. The system can't find the specified TypeId. Check spelling, and whether it is prefixed with the namespace "ns3::"
  • Q. A required software package is in a non-standard place. How to get waf to find the packages?
  • A. To compile with non-standard link path, use the environment variable LINKFLAGS. Example for bash shell:
LINKFLAGS="-L/tmp" ./waf configure

Run-time errors

  • Q. What is this assertion indicating?
 assert failed. file=debug/ns3/tags.h, line=105, cond="sizeof (T) <= Tags::SIZE"
  • A. The packet tag may be greater than Tags::SIZE (16 bytes)
  • Q. Why does valgrind fail with SIGILL on a simulation using NSC?
  • A. Valgrind does not work under 64-bit mode when running NSC due to lack of support for all the opcodes used. This has been confirmed to work in 32-bit mode. Check this bug report if you are concerned about a possible valgrind failure with an nsc script and want to see if it is a known issue.
  • Q. NSC does not work on a platform with SELinux enabled; for instance
 $ ./waf --run tcp-nsc-lfn
 Entering directory `/hg/ns-3-dev/build'
 [250/250] build-nsc
 Compilation finished successfully 
 /hg/ns-3-dev/build/debug/liblinux2.6.26.so: cannot restore segment
 prot after reloc: Permission denied
 Command ['/hg/ns-3-dev/build/debug/examples/tcp-nsc-lfn'] exited
 with code -11 
  • A. This is logged in the tracker. Workaround: to temporarily disable enforcement on a running system, set
 /usr/sbin/setenforce 0

To permanently disable enforcement during a system startup change "enforcing" to "disabled" in /etc/selinux/config and reboot.

  • Q. What happened to my pcap trace files? The files are empty or are missing some packets!
  • A. This is usually a symptom of a memory leak; the pcap trace files do not close cleanly. Try running your script with the --valgrind option to see if you've introduced a memory leak.

Debugging tips

  • Q. Is there a way to dereference a Ptr when in gdb?
  • A. yes: p *ptr->m_ptr

Craigdo 22:52, 27 March 2009 (UTC)