debugging using gdb

790 views
Skip to first unread message

Tania

unread,
Oct 28, 2011, 10:09:40 PM10/28/11
to ns-3-users
Hi,
This problem seems to be pretty common, but I haven't been able to
solve it. Any help will be greatly appreciated.

As I try to debug an ns3 program using gdb I get the "cannot open
shared object file:No such file" warning as follows:

=======================
tmishra@lin116-13> gdb build/debug/examples/tutorial/hello-
simulator
Reading symbols from /tmishra/ns/ns-allinone-3.11/ns-3.11/build/debug/
examples/tutorial/hello-simulator...done.
(gdb) r
Starting program: /tmishra/ns/ns-allinone-3.11/ns-3.11/build/debug/
examples/tutorial/hello-simulator /tmishra/ns/ns-allinone-3.11/ns-3.11/
build/debug/examples/tutorial/hello-simulator: error while loading
shared libraries: libns3-core.so: cannot open shared object file: No
such file or directory

Program exited with code 0177.
(gdb) show environment LD_LIBRARY_PATH
LD_LIBRARY_PATH = /tmishra/ns/ns-allinone-3.11/ns-3.11/build/debug
=======================

tmishra@lin116-13> ls build/debug/libns3-core.so
build/debug/libns3-core.so*

The .so file is in the build/debug directory as follows and the
LD_LIBRARY_PATH is rightly set to that path, but I still get this
error.

Thanks,
Tania

Raad Qandah

unread,
Oct 29, 2011, 5:19:48 PM10/29/11
to ns-3-users
Hi

you should do something like this:

$./waf --run YourSimulationFile --command-template="gdb %s"
$run

and thats it, if you want to see some debugging try
$bt

and there are other commands but thats almost all what I know :p

hope I could help :)

Tania Mishra

unread,
Oct 29, 2011, 9:44:58 PM10/29/11
to ns-3-...@googlegroups.com
Thanks for your response. I actually tried the waf command with --command-template option, but still get the "no library found" error. Another feedback I got was to run it in an environment with root user privileges. I will try that out and see.
Thanks,
Tania

--
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.


Alessandro Russo

unread,
Nov 9, 2011, 12:22:03 PM11/9/11
to ns-3-...@googlegroups.com
hi,
try this please,

http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_programs_with_gdb

or

$ ulimit -c unlimited
$ ./waf --run YourSimulationFile arg1 arg2 etc

check for the "core" dump file
$ ./waf shell
$ gdb YourSimulationFile core

work with gdb

$ exit  (leave waf shell)




 Alessandro  R.

ELKAMEL RABIAA

unread,
Jan 15, 2017, 2:48:44 PM1/15/17
to ns-3-users
hi
i I do all the steps but i have this error

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Running the Direct Transmission Simulation without NPP.
Rounds where:
0 nodes transmitted: 0
1 - 10 nodes transmitted: 0
10 - 20 nodes transmitted: 0
20 - 29 nodes transmitted: 0
29 - 40 nodes transmitted: 0
40 - 50 nodes transmitted: 2001


Program received signal SIGSEGV, Segmentation fault.
_int_malloc (av=0xb45e3440, bytes=2400) at malloc.c:3638
3638    malloc.c: No such file or directory.

Reply all
Reply to author
Forward
0 new messages