Bug 1725

Summary: Netanim examples crash on cygwin
Product: ns-3 Reporter: Vedran Miletić <vedran>
Component: build systemAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: CONFIRMED ---    
Severity: normal CC: alexander.afanasyev, john.abraham.in, ns-bugs, riley, tomh
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Windows   

Description Vedran Miletić 2013-06-29 18:20:06 EDT
VedranM@eddie-willers ~/ns-3-dev
$ g++ --version
g++ (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


VedranM@eddie-willers ~/ns-3-dev
$ uname -a
CYGWIN_NT-6.1-WOW64 eddie-willers 1.7.20(0.266/5/3) 2013-06-07 11:11 i686 Cygwin


VedranM@eddie-willers ~/ns-3-dev
$ ./waf --run src/netanim/examples/dumbbell-animation
Waf: Entering directory `/home/VedranM/ns-3-dev/build'
Waf: Leaving directory `/home/VedranM/ns-3-dev/build'
'build' finished successfully (3.541s)
assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName: ns3::WimaxN                                                                                            etDevice not found", file=../src/core/model/type-id.cc, line=419
terminate called without an active exception
Command ['/home/VedranM/ns-3-dev/build/src/netanim/examples/ns3-dev-dumbbell-ani                                                                                            mation-debug'] terminated with signal SIGABRT. Run it under a debugger to get mo                                                                                            re information (./waf --run <program> --command-template="gdb --args %s <args>")                                                                                            .
Comment 1 Tom Henderson 2013-07-01 10:28:34 EDT
does including "wimax-net-device.h" in animation-interface.cc resolve this?  There is a runtime dependency on this due to the callbacks.
Comment 2 John Abraham 2013-07-01 12:30:00 EDT
It is very similar to the problem discussed in 
https://groups.google.com/forum/#!topic/ns-3-users/j3eg1cFx8Qo

I haven't got working cygwin setup with me , to test Tom's theory but to me it look waf related, as we already have wimax on the dependency list

module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma', 'lte', 'uan'])
Comment 3 Tom Henderson 2013-07-01 23:21:52 EDT
(In reply to comment #2)
> It is very similar to the problem discussed in 
> https://groups.google.com/forum/#!topic/ns-3-users/j3eg1cFx8Qo
> 
> I haven't got working cygwin setup with me , to test Tom's theory but to me it
> look waf related, as we already have wimax on the dependency list
> 
> module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax',
> 'wifi', 'csma', 'lte', 'uan'])

I tested my idea on Cygwin earlier today-- didn't work.  The problem is that the type id is not being registered for some reason.  I can look at this some more over the next day or two.

There are a few other Cygwin problems with ns-3.17, the fd-net-device wscript one that Vedran recently fixed, and matrix-topology.cc is not compiling for me.
Comment 4 Vedran Miletić 2013-07-22 06:12:39 EDT
John, any progress or more info on this?
Comment 5 John Abraham 2013-07-22 08:42:43 EDT
Unfortunately, I am unable to even get past compilation issues


[ 757/1696] cxx: utils/bench-simulator.cc -> build/utils/bench-simulator.cc.2.o
../utils/bench-simulator.cc: In member function `void Bench::RunBench()':
../utils/bench-simulator.cc:87: warning: passing `double' for converting 1 of `n                     s3::Time ns3::NanoSeconds(uint64_t)'
../utils/bench-simulator.cc: In member function `void Bench::Cb()':
../utils/bench-simulator.cc:121: warning: passing `double' for converting 1 of `                     ns3::Time ns3::NanoSeconds(uint64_t)'
Waf: Leaving directory `/cygdrive/c/ws/ns-3-dev/build'
Build failed
 -> task in 'bench-simulator' failed (exit status 1):
        {task 4287928908L: cxx bench-simulator.cc -> bench-simulator.cc.2.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-fstrict-aliasing',                      '-Wstrict-aliasing', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE',                      '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '../utils/bench-simulator.cc', '-c                     ', '-o', 'utils/bench-simulator.cc.2.o']
Comment 6 John Abraham 2013-07-23 09:32:20 EDT
Can you try adding the following statements.

BaseStationNetDevice b;
SubscriberStationNetDevice s;
CsmaNetDevice c;
UanNetDevice u;

to the constructor "AnimationInterface"
Comment 7 John Abraham 2013-07-23 09:35:58 EDT
BaseStationNetDevice b;
SubscriberStationNetDevice s;
CsmaNetDevice c;
UanNetDevice u;

NS_UNUSED(b);
NS_UNUSED(s);
NS_UNUSED(c);
NS_UNUSED(u);
Comment 8 Vedran Miletić 2013-07-23 12:57:17 EDT
Works. But, no offense intended, this is not quite the nicest fix.
Comment 9 John Abraham 2013-07-23 13:05:58 EDT
Yeah but it has nothing to do with netanim.
Unless wad is better documented we need workarounds
Comment 10 Vedran Miletić 2013-07-23 13:29:21 EDT
At the moment, Alex and I are sort of maintainers for waf. What needs to be done, what is the issue exactly?
Comment 11 John Abraham 2013-07-23 13:40:00 EDT
1. I don't have working Cygwin setup. ns-3 never compiles due to various compilation warnings.
2. We need to understand why the static/global variables of certain modules mentioned in the wscript are not linked ,


as mentioned earlier, something like:

module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax',
'wifi', 'csma', 'lte', 'uan'])
I thought is sufficient to link modules such as Wimax, but apparently NS_LOG_COMPONENT_DEFINE ("WimaxNetDevice"); is not getting executed. I have seen this in the Visual Studio Environment years back, in which case we force the creation of at least one variable of type WimaxNetDevice to ensure all the static/global variables are initialized.