Visualizer: Type-ID Error

3,704 views
Skip to first unread message

Fuchs

unread,
Oct 19, 2011, 11:36:15 AM10/19/11
to ns-3-users
Hi,
I have some problem with the --visualizer / -vis Option:

Running my script or examples/wireless/wifi-adhoc (i will stick to
that) works well: ./waf --run "examples/wireless/wifi-adhoc"
Running it with the visualizer option brings me the following error: ./
waf --run "examples/wireless/wifi-adhoc --
SimulatorImplementationType=ns3::VisualSimulatorImpl" (or ./waf --run
examples/wireless/wifi-adhoc --vis )

Waf: Entering directory `/home/fabian/repos/ns-allinone-3.12.1/
ns-3.12.1/build'
Waf: Leaving directory `/home/fabian/repos/ns-allinone-3.12.1/
ns-3.12.1/build'
'build' finished successfully (1.430s)
assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName:
ns3::VisualSimulatorImpl not found", file=../src/core/model/type-
id.cc, line=388
Command ['/home/fabian/repos/ns-allinone-3.12.1/ns-3.12.1/build/debug/
examples/wireless/wifi-adhoc', '--
SimulatorImplementationType=ns3::VisualSimulatorImpl'] terminated with
signal SIGSEGV. Run it under a debugger to get more information (./waf
--run <program> --command-template="gdb --args %s <args>").

I read at http://www.nsnam.org/wiki/index.php/PyViz that this is a
linker problem.
Ok, but for this examples the visualizer is added in wscript file in
the wireless folder. And for the script which I actually care about I
should not have to add anything since it's in the scratch folder.

More information:
1. The visualizer works with python: ./waf --pyrun examples/wireless/
mixed-wireless.py --vis
2. ./waf indicates that visualizer is built:
[...] virtual-net-device visualizer wifi
[...]
Modules not built:
click openflow

I would be very thankful if you could point me towards what's wrong
here.
Thanks!
Fabian

Mitch Watrous

unread,
Oct 20, 2011, 3:47:10 PM10/20/11
to ns-3-users
Have you tried this to see if the visualizer works on your machine:

./waf --pyrun src/flow-monitor/examples/wifi-olsr-flowmon.py --
visualize

Did you try this:

./waf --run examples/wireless/wifi-adhoc --visualize

That example generates plots, so you might want to try to visualize a
different example

Mitch


On Oct 19, 8:36 am, Fuchs <mein.fu...@gmail.com> wrote:
> Hi,
> I have some problem with the --visualizer / -vis Option:
>
> Running my script or examples/wireless/wifi-adhoc (i will stick to
> that) works well: ./waf --run "examples/wireless/wifi-adhoc"
> Running it with the visualizer option brings me the following error: ./
> waf --run "examples/wireless/wifi-adhoc --
> SimulatorImplementationType=ns3::VisualSimulatorImpl" (or ./waf --run
> examples/wireless/wifi-adhoc --vis )
>
> Waf: Entering directory `/home/fabian/repos/ns-allinone-3.12.1/
> ns-3.12.1/build'
> Waf: Leaving directory `/home/fabian/repos/ns-allinone-3.12.1/
> ns-3.12.1/build'
> 'build' finished successfully (1.430s)
> assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName:
> ns3::VisualSimulatorImpl not found", file=../src/core/model/type-
> id.cc, line=388
> Command ['/home/fabian/repos/ns-allinone-3.12.1/ns-3.12.1/build/debug/
> examples/wireless/wifi-adhoc', '--
> SimulatorImplementationType=ns3::VisualSimulatorImpl'] terminated with
> signal SIGSEGV. Run it under a debugger to get more information (./waf
> --run <program> --command-template="gdb --args %s <args>").
>
> I read athttp://www.nsnam.org/wiki/index.php/PyVizthat this is a

Fuchs

unread,
Oct 21, 2011, 8:43:25 AM10/21/11
to ns-3-users
Hi Mitch,

> Have you tried this to see if the visualizer works on your machine:
>
>     ./waf --pyrun src/flow-monitor/examples/wifi-olsr-flowmon.py --
> visualize

actually ./waf --pyrun src/flow-monitor/examples/wifi-olsr-flowmon.py
--visualize does not work without editing the file and adding import
ns.visualizer. But then the visualizer works and I suppose this is ok.

> Did you try this:
>
>     ./waf --run examples/wireless/wifi-adhoc --visualize
>
> That example generates plots, so you might want to try to visualize a
> different example

Yes, I did try this and several other examples. Like ./waf --run
examples/wireless/wifi-simple-interference --visualize
They all do the same:
Waf: Entering directory `/home/fabian/repos/ns-allinone-3.12.1/
ns-3.12.1/build'
Waf: Leaving directory `/home/fabian/repos/ns-allinone-3.12.1/
ns-3.12.1/build'
'build' finished successfully (1.288s)
assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName:
ns3::VisualSimulatorImpl not found", file=../src/core/model/type-
id.cc, line=388
Command ['/home/fabian/repos/ns-allinone-3.12.1/ns-3.12.1/build/debug/
examples/wireless/wifi-simple-interference', '--
SimulatorImplementationType=ns3::VisualSimulatorImpl'] terminated with
signal SIGSEGV. Run it under a debugger to get more information (./waf
--run <program> --command-template="gdb --args %s <args>").

Thanks for replying,
Fabian

david arzola

unread,
Oct 21, 2011, 2:17:53 PM10/21/11
to ns-3-users
I have the same problem... when I try to run my scriot I see the
same!!!
why is happening this? I installed the simulator 3 times...

Fuchs

unread,
Oct 22, 2011, 10:33:46 AM10/22/11
to ns-3-users
Hi David,
No, I did not get it to work so far. But I did not try so much either,
since I tried everything that came to my mind before posting here.
Did you make sure, you are in scratch/ or have the visualizer enabled
for your file (this should be the usual solution for this kind of
error)? Is you python visualizer working?
Fabian

david arzola

unread,
Oct 22, 2011, 2:56:54 PM10/22/11
to ns-3-users
Yes I am with a scrapt in the folder in scratch/ but there only is
necessary to write --vis at the end of the call function. I have tried
also with ./waf --pyrun src/flow-monitor/examples/wifi-olsr-
flowmon.py --visualize but was the same result. I don't know why,
but with the ns-3.9 version the visualizer works perfectly...

Gustavo Carneiro

unread,
Nov 4, 2011, 10:16:45 AM11/4/11
to ns-3-...@googlegroups.com


2011/11/3 Luca Costantino <luca.co...@gmail.com>
same problems here... any solutions?

Hi.

I am the author of the visualizer module, and I am having the same problem in Ubuntu.  The problem stems from the fact that ldd <program> does not list ns3-visualizer as library that the program links to, even though the link command used by waf (waf -v), lists -lns3-visualizer as library to link.

I really do not understand what is going on except that Ubuntu 11.10 linker seems to be not doing what it's told to do.

I don't have more time to debug this, but it would be interesting to confirm if this is a problem limited to Ubuntu 11.10 or if other linux systems have the same issue.

Sorry I can't be of more help right now.
 


--
Chiave pubblica http://luca.costantino.googlepages.com/luca.costantino.asc

Prima di tutto vennero a prendere gli zingari e fui contento, perché
rubacchiavano.
Poi vennero a prendere gli ebrei e stetti zitto, perché mi stavano antipatici.
Poi vennero a prendere gli omosessuali, e fui sollevato, perché mi
erano fastidiosi.
Poi vennero a prendere i comunisti, e io non dissi niente, perché non
ero comunista.
Un giorno vennero a prendere me, e non c’era rimasto nessuno a protestare.
(Martin Niemöller)

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.




--
Gustavo J. A. M. Carneiro
INESC Porto, UTM, WiN, http://win.inescporto.pt/gjc
"The universe is always one step beyond logic." -- Frank Herbert

Luca Costantino

unread,
Nov 4, 2011, 10:19:36 AM11/4/11
to ns-3-...@googlegroups.com
2011/11/4 Gustavo Carneiro <gjcar...@gmail.com>:

> I don't have more time to debug this, but it would be interesting to confirm
> if this is a problem limited to Ubuntu 11.10 or if other linux systems have
> the same issue.
> Sorry I can't be of more help right now.

I'm running Debian SID (so we are kind of related)

Luca

Anthony

unread,
Nov 7, 2011, 12:12:51 AM11/7/11
to ns-3-users
The problem can be fixed by adding

import ns.visualizer

after the other import statements in the python script.

This fix only works for the python simulation scripts. I haven't found
a way to fix it in the C++ scripts.

On Nov 4, 9:19 am, Luca Costantino <luca.costant...@gmail.com> wrote:
> 2011/11/4 Gustavo Carneiro <gjcarne...@gmail.com>:
>
> > I don't have more time to debug this, but it would be interesting to confirm
> > if this is a problem limited to Ubuntu 11.10 or if other linux systems have
> > the same issue.
> > Sorry I can't be of more help right now.
>
> I'm running Debian SID (so we are kind of related)
>
> Luca
>
> --
> Chiave pubblicahttp://luca.costantino.googlepages.com/luca.costantino.asc

Luca Costantino

unread,
Nov 7, 2011, 3:13:32 AM11/7/11
to ns-3-...@googlegroups.com
2011/11/7 Anthony <amille...@gmail.com>:

> This fix only works for the python simulation scripts. I haven't found
> a way to fix it in the C++ scripts.

unfortunately I use c++ simulation only ;(
thanks for the advice, though.


--
Chiave pubblica http://luca.costantino.googlepages.com/luca.costantino.asc

Gustavo Carneiro

unread,
Nov 7, 2011, 6:30:11 AM11/7/11
to ns-3-...@googlegroups.com
On Mon, Nov 7, 2011 at 08:13, Luca Costantino <luca.co...@gmail.com> wrote:
2011/11/7 Anthony <amille...@gmail.com>:
> This fix only works for the python simulation scripts. I haven't found
> a way to fix it in the C++ scripts.

unfortunately I use c++ simulation only ;(
thanks for the advice, though.

I found a workaround, which is to make sure to use some symbol defined in the visualizer library.  For instance like below.

It sounds like recent ld has an "optimization" that makes it ignore linked-to libraries when they are apparently not used.  This is bad.

gjc@gjc-laptop:ns-3-dev$ hg diff examples/wireless/wifi-ap.cc 
diff -r 159633363724 examples/wireless/wifi-ap.cc
--- a/examples/wireless/wifi-ap.cc Mon Oct 31 12:13:18 2011 +0000
+++ b/examples/wireless/wifi-ap.cc Mon Nov 07 11:27:03 2011 +0000
@@ -26,6 +26,7 @@
 #include "ns3/config-store-module.h"
 #include "ns3/wifi-module.h"
 #include "ns3/athstats-helper.h"
+#include "ns3/pyviz.h"
 
 #include <iostream>
 
@@ -116,6 +117,8 @@
 
 int main (int argc, char *argv[])
 {
+  { PyViz v; }
+    
   CommandLine cmd;
   cmd.AddValue ("verbose", "Print trace information if true", g_verbose);
 

 

Prima di tutto vennero a prendere gli zingari e fui contento, perché
rubacchiavano.
Poi vennero a prendere gli ebrei e stetti zitto, perché mi stavano antipatici.
Poi vennero a prendere gli omosessuali, e fui sollevato, perché mi
erano fastidiosi.
Poi vennero a prendere i comunisti, e io non dissi niente, perché non
ero comunista.
Un giorno vennero a prendere me, e non c’era rimasto nessuno a protestare.
(Martin Niemöller)

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Luca Costantino

unread,
Nov 7, 2011, 6:38:27 AM11/7/11
to ns-3-...@googlegroups.com
2011/11/7 Gustavo Carneiro <gjcar...@gmail.com>:

> I found a workaround, which is to make sure to use some symbol defined in
> the visualizer library.  For instance like below.
> It sounds like recent ld has an "optimization" that makes it ignore
> linked-to libraries when they are apparently not used.  This is bad.
> gjc@gjc-laptop:ns-3-dev$ hg diff examples/wireless/wifi-ap.cc
> diff -r 159633363724 examples/wireless/wifi-ap.cc
> --- a/examples/wireless/wifi-ap.cc Mon Oct 31 12:13:18 2011 +0000
> +++ b/examples/wireless/wifi-ap.cc Mon Nov 07 11:27:03 2011 +0000
> @@ -26,6 +26,7 @@
>  #include "ns3/config-store-module.h"
>  #include "ns3/wifi-module.h"
>  #include "ns3/athstats-helper.h"
> +#include "ns3/pyviz.h"
>
>  #include <iostream>
>
> @@ -116,6 +117,8 @@
>
>  int main (int argc, char *argv[])
>  {
> +  { PyViz v; }
> +
>    CommandLine cmd;
>    cmd.AddValue ("verbose", "Print trace information if true", g_verbose);

I'm not sure to understand what this patch is supposed to mean. The
include excerpt is pretty clear, of course, but the PyViz definition
is obscure for me. It's scope ends within the braces, and no operation
is done on it/with it.

Anyway I changed my code adding the include statement and the PyViz
declaration, but I get an error

hfish@hfish:~/repos/ns-3-allinone/ns-3-lena-dev$ ./waf --run
scratch/working --vis
Waf: Entering directory `/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build'
[1339/1341] cxx_link: build/debug/scratch/working_7.o ->
build/debug/scratch/working
debug/scratch/working_7.o: In function `main':
/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build/../scratch/working.cc:29:
undefined reference to `ns3::PyViz::PyViz()'
/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build/../scratch/working.cc:29:
undefined reference to `ns3::PyViz::~PyViz()'
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build'
Build failed: -> task failed (err #1):
{task: cxx_link working_7.o -> working}
hfish@hfish:~/repos/ns-3-allinone/ns-3-lena-dev$

any suggestion?
luca

Gustavo Carneiro

unread,
Nov 7, 2011, 6:45:08 AM11/7/11
to ns-3-...@googlegroups.com
Yes, it is meant to only instantiate the PyViz class once, and then destroy it again.  The { ... } ensures the variable goes out of scope and so  ~PyViz gets called.

It's not supposed to do anything except tell the linker that we really really need this library, please don't ignore it.


Anyway I changed my code adding the include statement and the PyViz
declaration, but I get an error

hfish@hfish:~/repos/ns-3-allinone/ns-3-lena-dev$ ./waf --run
scratch/working --vis
Waf: Entering directory `/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build'
[1339/1341] cxx_link: build/debug/scratch/working_7.o ->
build/debug/scratch/working
debug/scratch/working_7.o: In function `main':
/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build/../scratch/working.cc:29:
undefined reference to `ns3::PyViz::PyViz()'

This is strange, are you sure the visualizer library is enabled? If you used --enable-modules, be sure to include it...

Run waf with the -v option, do you see -lns3-visualizer in there?

 
/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build/../scratch/working.cc:29:
undefined reference to `ns3::PyViz::~PyViz()'
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/hfish/repos/ns-3-allinone/ns-3-lena-dev/build'
Build failed:  -> task failed (err #1):
       {task: cxx_link working_7.o -> working}
hfish@hfish:~/repos/ns-3-allinone/ns-3-lena-dev$

any suggestion?
luca


--
Chiave pubblica http://luca.costantino.googlepages.com/luca.costantino.asc

Prima di tutto vennero a prendere gli zingari e fui contento, perché
rubacchiavano.
Poi vennero a prendere gli ebrei e stetti zitto, perché mi stavano antipatici.
Poi vennero a prendere gli omosessuali, e fui sollevato, perché mi
erano fastidiosi.
Poi vennero a prendere i comunisti, e io non dissi niente, perché non
ero comunista.
Un giorno vennero a prendere me, e non c’era rimasto nessuno a protestare.
(Martin Niemöller)

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

Luca Costantino

unread,
Nov 7, 2011, 6:53:26 AM11/7/11
to ns-3-...@googlegroups.com
2011/11/7 Gustavo Carneiro <gjcar...@gmail.com>:

> Yes, it is meant to only instantiate the PyViz class once, and then destroy
> it again.  The { ... } ensures the variable goes out of scope and so  ~PyViz
> gets called.
> It's not supposed to do anything except tell the linker that we really
> really need this library, please don't ignore it.

perfectly clear now, thanks


> This is strange, are you sure the visualizer library is enabled? If you used
> --enable-modules, be sure to include it...

I configured with just --enable-examples --enable-test --enable-sudo

> Run waf with the -v option, do you see -lns3-visualizer in there?

yes. all modules are compiled except click and openflow

thanks for your time :)

Fuchs

unread,
Nov 7, 2011, 11:50:33 AM11/7/11
to ns-3-users
Hi,
for me it works with adding those two lines. Greatly appreciate your
help!
btw: It's Ubuntu 11.10 on my side, too!
Fabian

On Nov 7, 12:30 pm, Gustavo Carneiro <gjcarne...@gmail.com> wrote:
> On Mon, Nov 7, 2011 at 08:13, Luca Costantino <luca.costant...@gmail.com>wrote:
>
> > 2011/11/7 Anthony <amillerrho...@gmail.com>:
> > Chiave pubblicahttp://luca.costantino.googlepages.com/luca.costantino.asc
>
> > Prima di tutto vennero a prendere gli zingari e fui contento, perché
> > rubacchiavano.
> > Poi vennero a prendere gli ebrei e stetti zitto, perché mi stavano
> > antipatici.
> > Poi vennero a prendere gli omosessuali, e fui sollevato, perché mi
> > erano fastidiosi.
> > Poi vennero a prendere i comunisti, e io non dissi niente, perché non
> > ero comunista.
> > Un giorno vennero a prendere me, e non c’era rimasto nessuno a protestare.
> > (Martin Niemöller)
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ns-3-users" group.
> > To post to this group, send email to ns-3-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > ns-3-users+...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/ns-3-users?hl=en.
>
> --
> Gustavo J. A. M. Carneiro
> INESC Porto, UTM, WiN,http://win.inescporto.pt/gjc

Abdul Quadeer

unread,
Apr 30, 2014, 4:34:46 AM4/30/14
to ns-3-...@googlegroups.com
Thank you very much for this Gustavo!
I made those changes and guess what? All other files run properly without adding those 2 lines!

Konstantinos

unread,
Apr 30, 2014, 6:55:52 AM4/30/14
to ns-3-...@googlegroups.com
Probably because that was 3 years ago and NS-3 has fixed several bugs since then!

Luca Costantino

unread,
Nov 3, 2011, 4:12:25 AM11/3/11
to ns-3-...@googlegroups.com
same problems here... any solutions?

Anthony

unread,
Nov 7, 2011, 2:16:11 PM11/7/11
to ns-3-users
It works for me as well on Ubuntu 11.10.

Ahmed Ben

unread,
May 11, 2017, 6:05:19 PM5/11/17
to ns-3-users
Hi community,
 
I'm a new to ndnSIM. I used this command ./waf--run=ndn-simple --vis

I try to visualize my program I get this error

 assert failed.cond="uid != 0", msg="Assert in TypeId::LookupByName:ns3::VisualSimulatorImpl not found"
,file=../src/core/model/type-id.cc, line=755 terminate called without an active exception

How can I fix this problem.
Thanks
Ahmed

Tommaso Pecorella

unread,
May 11, 2017, 9:22:30 PM5/11/17
to ns-3-users
Hi,

try asking the ndnSim community, we're the ns-3 one.
As stated quite clearly in the posting guidelines, ndnSim is derived from ns-3 but they're two different simulators.

T.

Ahmed Ben

unread,
May 11, 2017, 10:14:32 PM5/11/17
to ns-3-users
 
 Thank you

Shelly R

unread,
Sep 1, 2022, 2:00:47 PM9/1/22
to ns-3-users
thank you for this solution
Reply all
Reply to author
Forward
0 new messages