waf run dce-iperf-mptcp gives dce_path error and terminates with signal SIGIOT

751 views
Skip to first unread message

Lawrence

unread,
Oct 14, 2016, 9:00:53 AM10/14/16
to ns-3-users
Hello friends,

I have been trying to debug MPTCP with DCE but without success. Here is what I did :

I use XUbuntu 14.04, mptcp_v0.89 and dce-ns3-1.8

I first built dce using bake /* sorry Matt :-(  I failed to do it using waf */

1. hg clone http://code.nsnam.org/bake bake
2. export BAKE_HOME=`pwd`/bake
3. export PATH=$PATH:$BAKE_HOME
4. export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
5. mkdir dce 6. cd dce 7. bake.py configure -e dce-ns3-1.8 8. bake.py download 9. bake.py build



Next I did this for MPTCP :

1. git clone -b mptcp_v0.89 git://github.com/multipath-tcp/mptcp
2. cd mptcp
3. git checkout -b sim3.14 mptcp_v0.89
4. git remote add dce git://github.com/direct-code-execution/net-next-sim.git
5. git fetch dce
6. git merge dce/sim-ns3-3.14.0-branch
7. make menuconfig ARCH=sim
/* here I include the necessary MPTCP modules */
8. make library ARCH=sim /* the file liblinux.so is created */



Now I get ns-3-dce to configure DCE :

1. hg clone http://code.nsnam.org/ns-3-dce  -r dce-1.8
2. export DCE_PATH=$HOME/mptcp
3. ./waf configure --with-ns3=$HOME/dce/build --enable-kernel-stack=$HOME/mptcp/arch --prefix=$HOME/dce/build
4. ./waf build
5. ./waf --run dce-iperf-mptcp /* which gives me the following errors */



lawrence@lawrence:~/ns-3-dce$ sudo ./waf --run dce-iperf-mptcp
Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.212s)

assert failed. cond="filePath.length () > 0", msg="Stack file 'liblinux.so' not found ! Please check your DCE_PATH environment variable.", file=../model/kernel-socket-fd-factory.cc, line=566
terminate called without an active exception
Command ['/home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


What is wrong ? I have set the DCE_PATH but why is it not recognised ? The file "liblinux.so" is present at "$HOME/mptcp". I have tried setting the DCE_PATH variable by doing ./waf shell and then running dce-iperf-mptcp but to no avail.

Please help.

Lawrence

Matt Anonyme

unread,
Oct 16, 2016, 7:23:24 PM10/16/16
to ns-3-users
Hi Lawrence,

In the final step, you say you use "./waf --run dce-iperf-mptcp" and in the line just after you use "sudo ./waf --run dce-iperf-mptcp". Which one is it ?
Why do you use sudo ? that's the best way to call the apocalypse on your installation. sudo does not preserve the environement (man sudo and search for "-E").

Otherwise the steps you describe look fine.

Matt

Lawrence

unread,
Oct 17, 2016, 5:08:06 AM10/17/16
to ns-3-users
Thank you for the heads up concerning sudo.

However running the command without sudo gives me "permission denied" errors as follows :


lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp
Waf: Entering directory `/home/lawrence/ns-3-dce/build'
Traceback (most recent call last):
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Scripting.py", line 151, in run_commands
    run_command(cmd_name)
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Scripting.py", line 143, in run_command
    ctx.execute()
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Scripting.py", line 345, in execute
    return execute_method(self)
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Build.py", line 98, in execute
    self.execute_build()
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Build.py", line 101, in execute_build
    self.recurse([self.run_dir])
  File "/home/lawrence/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/home/lawrence/ns-3-dce/wscript", line 838, in build
    out = open(build_status_file, 'w')
IOError: [Errno 13] Permission denied: '/home/lawrence/ns-3-dce/build/build-status.py'



Is there something else that I should do ?

Matt

unread,
Oct 17, 2016, 5:41:59 AM10/17/16
to ns-3-users
You must have used sudo in a previous step where you shouldn' have.
Hence some files are owned by root instead of you.
You can check with "ls -l /home/lawrence/ns-3-dce/wscript" and than
run "sudo chown -R lawrence:lawrence /home/lawrence/".
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ns-3-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ns-3-users/M3A5ydBLktY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Lawrence

unread,
Oct 17, 2016, 7:25:12 AM10/17/16
to ns-3-users
You're right. I used sudo for all the commands that I have stated in the first message.

I did :   sudo chown -R  lawrence:lawrence /home/lawrence

and then without sudo :
./waf --run dce-iperf-mptcp

I get a similar error of DCE_PATH, DCE_ROOT and SIGIOT as in the first message :(



lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp

Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.208s)
assert failed. cond="exeFullPath.length () > 0", msg="Executable 'ip' not found !  Please check your DCE_PATH and DCE_ROOT environment variables.", file=../model/dce-manager.cc, line=260

Matt

unread,
Oct 17, 2016, 7:43:08 AM10/17/16
to ns-3-users
There is some progress, dce found your linux kernel :)
DCE_PATH works as PATH, you can concatenate several folders there:
DCE_PATH="/home/lawrence/mptcp:/home/lawrence/ip".

DCE does not find the program "ip". So you have to compile it. You can
find somewhat of a recipe in the bakeconf.xml or you do:
$ apt source ip (or the name of the package where you can find ip)
and you apply the patch in dce/utils/iprouteXXX
Message has been deleted
Message has been deleted

Lawrence

unread,
Oct 17, 2016, 1:06:03 PM10/17/16
to ns-3-users
Hello Matt,

I don't quite know how I can apply the patch :(

I did the following :

In $HOME
apt-get source iproute2
cd iproute2-3.12.0
./configure
make

I also do an export DCE_PATH=$HOME/mptcp:$HOME/iproute2-3.12.0/ip (this is where I found the ip executable)

Next I don't know how to include the patch in ns-3-dce/utils

I see that there is already a iproute-2.6.38-fix-01.patch and iproute-mptcp.patch

Lawrence

unread,
Oct 18, 2016, 9:21:05 AM10/18/16
to ns-3-users
Hello,

I tried another thing since I don't know how to include a patch.

1. apt-get source iproute2
2. cd iproute2-3.12.0
3. LDFLAGS=-pie make CCOPTS='-fpic -D_GNU_SOURCE -O0 -U_FORTIFY_SOURCE'
4. cd ../ns-3-dce
5. cp ../iproute2-3.12.0/ip/ip .
6. ./waf configure --with-ns3=$HOME/dce/build --enable-kernel-stack=$HOME/mptcp/arch --prefix=$HOME/dce/build
7. ./waf build
8. ./waf --run dce-iperf-mptcp


This gave me no errors but the .pcap files generated are all empty.

I would really appreciate if I am helped get past these anomalies.

Matt

unread,
Oct 18, 2016, 10:15:06 AM10/18/16
to ns-3-users
diff & patch are a common workflow in software engineering.

Basically you move to the source directory of your software and then to
"$ patch -p0 < mypatch.patch"
(might be -p1 depending on the directory)

As for the ip recipe, the bakeconf.xml can give you some ideas:
https://github.com/teto/bake/blob/master/bakeconf.xml#L279

Lawrence

unread,
Oct 19, 2016, 5:44:03 AM10/19/16
to ns-3-users
I have successfully applied the iproute2 patch as follows :

1. Download iproute2 version 2.6.38 and extract it
2. cd iproute2-2.6.38
3. patch -p1 -i ../ns-3-dce/utils/iproute-2.6.38-fix-01.patch
4. KERNEL_INCLUDE should point to my liblinux.so directory ( for me it is $HOME/mptcp )
    Hence I modified the following part in the Makefile:
    Config:
                               sh configure /home/lawrence/mptcp
5. make


Now when I run ./waf --run dce-iperf-mptcp I get the following error :

lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp

Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.209s)
*** unable to open non-shared object file=elf-cache/0/ip ***
assert failed. cond="false", msg="make it sure that DCE binrary file elf-cache/0/ip was built with correct options: (CFLAGS=-fPIC, LDFLAGS=-pie -rdynamic)", file=../model/elf-cache.cc, line=274

terminate called without an active exception
Command ['/home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


Hence I did the following :

1. cd iproute2-2.6.38
2. make clean
3.
LDFLAGS=-pie make CCOPTS='-fpic -D_GNU_SOURCE -O0 -U_FORTIFY_SOURCE'

Now I have the following error :

lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp

Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.205s)

Command ['/home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


I see that others have come across the same error and have solved it with the newer version as explained here :
https://www.nsnam.org/docs/dce/manual/html/dce-user-kernel.html#build-an-mptcp-kernel-with-net-next-sim

I'm already using mptcp_v0.89 and have followed those instructions.
I tried running gdb and have the following :

lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp --command-template="gdb --args %s"

Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.218s)

GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp...done.
(gdb) run
Starting program: /home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb)


What should I do ?

Matt

unread,
Oct 19, 2016, 5:55:20 AM10/19/16
to ns-3-users
Now we arrive in the things harder to debug :/
First and foremost yo should print the backtrace ("bt" or "backtrace"
in gdb) to get a better idea on how/why it failed. The
==
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
==
is not really helpful.

Cheers

Lawrence

unread,
Oct 19, 2016, 7:09:30 AM10/19/16
to ns-3-users
Sorry :P

Here is the backtrace :

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff3528103 in tcp_connect_init (sk=sk@entry=0x7ffff33819b0)
    at /home/lawrence/mptcp/net/ipv4/tcp_output.c:2885
#2  0x00007ffff35282a2 in tcp_connect (sk=sk@entry=0x7ffff33819b0)
    at /home/lawrence/mptcp/net/ipv4/tcp_output.c:3062
#3  0x00007ffff352b870 in tcp_v4_connect (sk=0x7ffff33819b0,
    uaddr=0x7ffff174fa60, addr_len=<optimized out>)
    at /home/lawrence/mptcp/net/ipv4/tcp_ipv4.c:248
#4  0x00007ffff3541676 in __inet_stream_connect (
    sock=sock@entry=0x7ffff3380cf0, uaddr=uaddr@entry=0x7ffff174fa60,
    addr_len=addr_len@entry=16, flags=flags@entry=0)
    at /home/lawrence/mptcp/net/ipv4/af_inet.c:602
#5  0x00007ffff3541842 in inet_stream_connect (sock=0x7ffff3380cf0,
    uaddr=0x7ffff174fa60, addr_len=16, flags=0)
    at /home/lawrence/mptcp/net/ipv4/af_inet.c:663
#6  0x00007ffff34a4565 in sim_sock_connect (
    socket=socket@entry=0x7ffff3380cf0, name=name@entry=0x7ffff33780b8,
    namelen=namelen@entry=16, flags=flags@entry=0) at arch/sim/sim-socket.c:103
#7  0x00007ffff34a1edc in sim_sock_connect_forwarder (v0=0x7ffff3380cf0,
    v1=0x7ffff33780b8, v2=16, v3=0) at arch/sim/sim.c:92
#8  0x00007ffff7b4273c in ns3::KernelSocketFdFactory::Connect (this=0x643ed0,
    socket=0x7ffff3380cf0, my_addr=0x7ffff33780b8, addrlen=16, flags=0)
    at ../model/kernel-socket-fd-factory.cc:728
---Type <return> to continue, or q <return> to quit---
#9  0x00007ffff7b4a5cb in ns3::KernelSocketFd::Connect (this=0x6b6be0,
    my_addr=0x7ffff33780b8, addrlen=16) at ../model/kernel-socket-fd.cc:119
#10 0x00007ffff7a8fa71 in dce_connect (fd=3, my_addr=0x7ffff33780b8,
    addrlen=16) at ../model/dce-fd.cc:458
#11 0x00007ffff2892da3 in connect () at ../model/libc-ns3.h:182
#12 0x00007ffff1a5ddae in Client::Connect (this=0x7ffff33782f8)
    at Client.cpp:415
#13 0x00007ffff1a5cf24 in Client::Client (this=0x7ffff33782f8,
    inSettings=0x7ffff3378018) at Client.cpp:87
#14 0x00007ffff1a5e54c in client_spawn (thread=0x7ffff3378018)
    at Launch.cpp:111
#15 0x00007ffff1a68d2d in thread_run_wrapper (paramPtr=0x7ffff3378018)
    at Thread.c:242
#16 0x00007ffff7a9d9ff in pthread_do_start (context=0x6ae070)
    at ../model/dce-pthread.cc:108
#17 0x00007ffff7ac34f4 in ns3::TaskManager::Trampoline (context=0x6a1270)
    at ../model/task-manager.cc:274
#18 0x00007ffff7abcde9 in ns3::UcontextFiberManager::Trampoline (a0=32767,
    a1=-139709264, a2=0, a3=6951536) at ../model/ucontext-fiber-manager.cc:199
#19 0x00007ffff3ca4800 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#20 0x0000000000000000 in ?? ()
(gdb)

Matt

unread,
Oct 19, 2016, 7:30:29 AM10/19/16
to ns-3-users
IMO, this is the most troublesome problem you can get into. I guess
you are using net-next-sim ? make sure you use the versions in the doc
(IIRC mptcp 0.89.8 with netnextsim3.14) or else use libos (which
replaced net-next-sim, in fact you should try with libos first). In
the libos repo, there is an mptcp_branhc, you might want to try that
one rather than merge both kernels by yourself.

Lawrence

unread,
Oct 19, 2016, 8:09:39 AM10/19/16
to ns-3-users
Dear Matt,

I use mptcp_v0.89.5 with sim3.14
Couldn't find mptcp_v0.89.8 in the github releases

I'll try libos now.

Lawrence

unread,
Oct 19, 2016, 11:13:49 AM10/19/16
to ns-3-users
Hello Matt,

I did everything afresh using LibOS (without sudo). Here is the complete summary (A to Z just to be sure):

Install dependencies :

sudo apt-get install vim git mercurial gcc g++ python python-dev qt4-dev-tools libqt4-dev bzr cmake libc6-dev libc6-dev-i386 g++-multilib gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison libfl-dev tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc uncrustify doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra texlive-font-utils dvipng python-sphinx dia python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev ipython libboost-signals-dev libboost-filesystem-dev openmpi-bin openmpi-common openmpi-doc libopenmpi-dev libncurses5-dev libncursesw5-dev unrar unrar-free p7zip-full autoconf libpcap-dev cvs libssl-dev

I use XUbuntu 14.04, LibOS from here : https://github.com/libos-nuse/net-next-nuse/tree/mptcp_trunk_libos and dce-ns3-1.8


I first built dce using bake

1. hg clone http://code.nsnam.org/bake bake
2. export BAKE_HOME=`pwd`/bake
3. export PATH=$PATH:$BAKE_HOME
4. export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
5. mkdir dce 6. cd dce 7. bake.py configure -e dce-ns3-1.8 8. bake.py download 9. bake.py build

Next I get mptcp_trunk_libos :

git clone -b mptcp_trunk_libos https://github.com/libos-nuse/net-next-nuse.git

I rename the folder net-next-nuse to mptcp for simplicity :)

1. cd mptcp
2. make menuconfig ARCH=lib
/* here I include the necessary MPTCP modules */
3. make library ARCH=lib /* the file liblinux.so is created */


Now I get ns-3-dce to configure DCE :

1. hg clone http://code.nsnam.org/ns-3-dce  -r dce-1.8
2. export DCE_PATH=$HOME/mptcp
3. cd ns-3-dce
4. ./waf configure --with-ns3=$HOME/dce/build --enable-kernel-stack=$HOME/mptcp/arch --prefix=$HOME/dce/build
5. ./waf build
6. ./waf --run dce-iperf-mptcp /* which gives me the following errors */


lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp

Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.218s)

msg="Oops. Can't find initialization function", file=../model/kernel-socket-fd-factory.cc, line=575

terminate called without an active exception
Command ['/home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

A gdb backtrace gives the following :

lawrence@lawrence:~/ns-3-dce$ ./waf --run dce-iperf-mptcp --command-template="gdb --args %s"
Waf: Entering directory `/home/lawrence/ns-3-dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/lawrence/ns-3-dce/build'
'build' finished successfully (0.212s)

GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp...done.
(gdb) run
Starting program: /home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
msg="Oops. Can't find initialization function", file=../model/kernel-socket-fd-factory.cc, line=575

terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00007ffff3c91c37 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff3c91c37 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff3c95028 in __GI_abort () at abort.c:89
#2  0x00007ffff44b4535 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff44b26d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff44b2703 in std::terminate() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff7b40b1e in ns3::KernelSocketFdFactory::InitializeStack (
    this=0x643ed0) at ../model/kernel-socket-fd-factory.cc:575
#6  0x00007ffff7b4d4cd in ns3::LinuxSocketFdFactory::InitializeStack (
    this=0x643ed0) at ../model/linux-socket-fd-factory.cc:156
#7  0x00007ffff7b4de6b in ns3::EventImpl* ns3::MakeEvent<void (ns3::LinuxSocketFdFactory::*)(), ns3::LinuxSocketFdFactory*>(void (ns3::LinuxSocketFdFactory::*)(), ns3::LinuxSocketFdFactory*)::EventMemberImpl0::Notify() (this=0x644240)
    at /home/lawrence/dce/build/include/ns3.25/ns3/make-event.h:323
#8  0x00007ffff7373801 in ns3::EventImpl::Invoke (this=0x644240)
    at ../src/core/model/event-impl.cc:51
#9  0x00007ffff7b3fc3c in ns3::KernelSocketFdFactory::ScheduleTaskTrampoline (
    context=0x644240) at ../model/kernel-socket-fd-factory.cc:488
#10 0x00007ffff7ac34f4 in ns3::TaskManager::Trampoline (context=0x6445a0)
    at ../model/task-manager.cc:274
#11 0x00007ffff7abcde9 in ns3::UcontextFiberManager::Trampoline (a0=32767,
---Type <return> to continue, or q <return> to quit---
    a1=-139709264, a2=0, a3=6571424) at ../model/ucontext-fiber-manager.cc:199
#12 0x00007ffff3ca4800 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x0000000000000000 in ?? ()
(gdb)

What is the initialisation function ?

Matt

unread,
Oct 19, 2016, 11:18:34 AM10/19/16
to ns-3-users
2016-10-19 17:13 GMT+02:00 Lawrence <soura...@gmail.com>:
> fd-factory.cc, line=575
> terminate called without an active exception
dce looks for a lib_init or sim_init function in the library; libos
generates several libraries, most likely you don't load the good one.
You can check with "nm" to list library symbols and check there an
"*_init" function.
There is a warning here
https://www.nsnam.org/docs/dce/manual/html/dce-user-kernel.html#with-libos
but feel free to submit changes to the documentation if it's not
enough.

Lawrence

unread,
Oct 19, 2016, 11:33:18 AM10/19/16
to ns-3-users

nm -gC liblinux.so

in the mptcp directory shows me the presence of lib_init

0000000000083f40 T lib_init

How can I make dce find it ?


Matt

unread,
Oct 19, 2016, 11:36:27 AM10/19/16
to ns-3-users
It should find it, if it doesn't it's probably because it loads
another liblinux.so. Maybe you have other liblinux.so in your DCE_PATH
?
you can run dce with NS_LOG=* to see what happens.

Lawrence

unread,
Oct 19, 2016, 11:55:28 AM10/19/16
to ns-3-users
Oh là là !

An almost non terminating log appeared when I did

NS_LOG="*" ./waf --run dce-iperf-mptcp

However in the end I do get something like this :


...
...
...
0s 0 Object:GetInstanceTypeId(0x12819c0)
0s 0 Object:UpdateSortedArray(0x1288750, 0x12d60c0, 2)
0s 0 EventImpl:Invoke(0x1281880)
0s 0 DceKernelSocketFdFactory:InitializeStack(): [INFO ] loading /home/lawrence/mptcp/liblinux.so
0s 0 DceCoojaLoaderFactory:LoadModule(0x1288d30, /home/lawrence/mptcp/liblinux.so, 0)
0s 0 DceElfDependencies:SearchFile(0x7ff6090aebb0, /home/lawrence/mptcp/liblinux.so)
0s 0 DceElfDependencies:SearchFile(): [DEBUG] Found: /home/lawrence/mptcp/liblinux.so as /home/lawrence/mptcp/liblinux.so
0s 0 DceElfLdd:ExtractLibraries(/home/lawrence/mptcp/liblinux.so, /home/lawrence/mptcp/liblinux.so)
0s 0 DceElfCache:Add(0x7ff608eb8f00, /home/lawrence/mptcp/liblinux.so)
0s 0 DceElfCache:CopyFile(0x7ff608eb8f00, /home/lawrence/mptcp/liblinux.so, elf-cache/0/liblinux.so)
0s 0 DceElfCache:CopyFile(): [DEBUG] copied /home/lawrence/mptcp/liblinux.so to elf-cache/0/liblinux.so
0s 0 DceElfCache:EditFile(0x7ff608eb8f00, elf-cache/0/liblinux.so)
0s 0 DceCoojaLoaderFactory:LoadModule(): [DEBUG] create shared module=0x12be070 file=elf-cache/0/liblinux.so id=1
0s 0 DceCoojaLoaderFactory:LoadModule(): [DEBUG] Create module for 0x12d9aa0 elf-cache/0/liblinux.so
0s 0 DceCoojaLoaderFactory:LoadModule(): [DEBUG] add 0x129f680
0s 0 DceElfCache:Add(0x7ff608eb8f00, /home/lawrence/mptcp/liblinux.so)
0s 0 DceCoojaLoaderFactory:Lookup(0x1288d30, 0x12d9aa0, sim_init)
0s 0 DceCoojaLoaderFactory:Lookup(): [WARN ] elf-cache/0/liblinux.so: undefined symbol: sim_init

msg="Oops. Can't find initialization function", file=../model/kernel-socket-fd-factory.cc, line=575
0s 0 FatalImpl:FlushStreams()
0s 0 FatalImpl:PeekStreamList()

terminate called without an active exception
Command ['/home/lawrence/ns-3-dce/build/bin/dce-iperf-mptcp'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

So basically, it does find the compiled liblinux.so (with lib_init inside but not with sim_init) but apparently it searches for sim_init  :/

Should I make the mptcp library with ARCH=sim ?

Matt

unread,
Oct 19, 2016, 12:24:42 PM10/19/16
to ns-3-users
Hopefully there is google :)

https://groups.google.com/forum/#!topic/libos-nuse/hKwhZMto87U

2016-10-19 17:55 GMT+02:00 Lawrence <soura...@gmail.com>:
> /home/lawrence/mptcp/liblinux.s

Lawrence

unread,
Oct 20, 2016, 5:04:39 AM10/20/16
to ns-3-users
Dear Matt,

Sorry, I did not understand how I can load libsim-linux.so (at $HOME/mptcp/arch/lib/tools) with linux-libos-tools.

After cloning linux-libos-tools what modifications did you carry out ?

Since there is no documentation I find it very difficult to proceed. Do you have a doc as to how to do it ?

Lawrence

unread,
Oct 20, 2016, 8:22:21 AM10/20/16
to ns-3-users
I tried doing something :

1. Created a symbolic link of $HOME/linux-libos-tools in $HOME/mptcp/arch/lib/tools
2. cd mptcp
3. make clean
4. make library ARCH=lib

Running ./waf --run dce-iperf-mptcp gives me the same error of not finding the initialisation function.
Probably I need to change the Makefile in $HOME/linux-libos-tools ?
I don't know where to go after this.

Please help :(

Matt

unread,
Oct 20, 2016, 8:45:19 AM10/20/16
to ns-3-users
It's just a matter of having DCE load the correct shared library, the
one with the symbol sim_init.
I think you try to load the wrong one, check the symbols with "nm".

Afterwards, you can either set an attribute from DCE as explained here:
https://www.nsnam.org/docs/dce/manual/html/dce-user-kernel.html#with-libos
create a symlink, copy the shared library or adjust your DCE_PATH so
that DCE finds it.

I hope the confusion between net-next-sim and libos generating the
same library name with different symbols will be cleared in the next
libos release. I had difficulty with it, just like you.
Message has been deleted

Lawrence

unread,
Oct 20, 2016, 9:52:15 AM10/20/16
to ns-3-users
I was complicating things a bit.

Finally it worked more or less :/

I did nothing special.

In $HOME/mptcp

1. I rename the already existing liblinux.so to liblinux0.so so that it is not found by DCE
2. Created a symbolic link of the libsim-linux.so as follows to mislead DCE into using this library ^^
    ln -s $HOME/mptcp/arch/lib/tools/libsim-linux.so $HOME/mptcp/liblinux.so

Now it's working more or less; a bit unsatisfied because the .pcap files generated when open with wireshark don't show the mptcp protocol (only TCP shown), however examination at the TCP level shows the Multipath TCP: Multipath Capable option :) Probably I need an MPTCP version of wireshark ?

I also need to make this work with multiple interfaces on both sides (server and client). For now I only see one interface on each side. How do I do that ???

If you want I can prepare a documentation of the entire procedure with possible errors if it may help others in the future and avert them of the possible obstacles.

Anyway, I am really grateful to Matt for bearing with me all this while :) However I am not letting him go so soon. I still have loads to do !!!

Matt Anonyme

unread,
Oct 20, 2016, 10:29:32 AM10/20/16
to ns-3-users
Glad you got it working.

you need a wireshark > 2.1 to have wireshark considering it a specific protocol cf http://blog.multipath-tcp.org/blog/html/2016/08/23/mptcp_analyzer.html .

I've been working on a tool to help mptcp pcap analysis but it's a bit buggy (no need to open issues to tell me, I am aware)
https://github.com/teto/mptcpanalyzer

I plan to release a much better version next month.

jayse...@gmail.com

unread,
Jul 10, 2017, 10:43:46 AM7/10/17
to ns-3-users
Hi,

I came across this older thread and faced an issue which I'd like to share.

I used
bake.py configure -e dce-linux-1.9
bake
.py download
bake
.py build
to get ns-3 and DCE.

I downloaded and compiled libos-nuse as mentioned in the DCE manual
git clone
https
://github.com/libos-nuse/net-next-nuse.git

cd net
-next-nuse
git checkout libos
-v4.4
make defconfig ARCH
=lib
make library ARCH
=lib


Next, I changed the symbolic link in build/bin_dce so that the more recent kernel is used
liblinux.so -> libsim-linux-4.4.0.so

Now, when running for example dce-linux, the network interface sim0 was broken (looks like uninitialized memory at #8)
source/ns-3-dce$ ./waf --run "dce-linux"
[...]

source
/ns-3-dce$ more files-0/var/log/*/*
[...]
::::::::::::::
files-0/var/log/64577/stdout
::::::::::::::
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN
    link/ipip 0.0.0.0 brd 0.0.0.0
3: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN
    link/gre 0.0.0.0 brd 0.0.0.0
4: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN
    link/sit 0.0.0.0 brd 0.0.0.0
6: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN
    link/tunnel6 :: brd ::
7: ip6gre0@NONE: <NOARP> mtu 1448 qdisc noop state DOWN
    link/[823] 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
8: 8�5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
(#8 is the faulty one, should be sim0)



After some investigation, I found out that a change in the DCE glue code API is probably the problem, more specific the macro LIBOS_API_VERSION in the file source/ns-3-dce/model/kernel-socket-fd-factory.cc

Because DCE was built with bake, waf's --enable-kernel-stack still pointed to the old net-next-sim-2.6.36 directory; LIBOS_API_VERSION was not set to the value "2"; and thus the old glue code API was used (although there was a newer libos-nuse kernel).

The solution was to configure DCE manually (as already suggested by Matt) and to set --enable-kernel-stack to the directory with the libos-nuse kernel (libos-v4.4 in my case).
source/ns-3-dce$ ./waf configure --with-ns3=$HOME/dce-linux-1.9/build --enable-kernel-stack=$HOME/net-next-nuse/arch --prefix=$HOME/dce-linux-1.9/build

Then the LIBOS_API_VERSION macro is correctly set (because waf finds the macro in the net-next-nuse/arch/lib/include/sim-types.h file), and simulation scripts referring to sim0 run again with a recent linux kernel :-)

Best regards
Jay



Reply all
Reply to author
Forward
0 new messages