Troubleshooting

From Nsnam
Revision as of 22:52, 27 March 2009 by Craigdo (Talk | contribs)

Jump to: navigation, search

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.

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)