Problem with Executing dec-emu-ping

244 views
Skip to first unread message

Dowon Hyun

unread,
Mar 31, 2014, 4:57:16 AM3/31/14
to ns-3-...@googlegroups.com
Dear all,

I have tried to run "dec-emu-ping" in build/bin folder and have some problems of "segmentation fault"
According to NS-3 log, error occurs after run emulation.

I set environments like below:
export BAKE_HOME=/home/dowon/dce/bake
export PATH=$PATH:$BAKE_HOME
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
source bakeSetEnv.sh
ifconfig eth0 promisc
export DCE_PATH=$DCE_PATH:/bin/

Below is NS-3 log:
root@dowon-LinuxPC:/home/dowon/dce/DCE/build/bin# ./dce-emu-ping --deviceName=eth0 --remote=10.251.154.66 --local=10.251.154.67 --localmask=255.255.255.0
DCE Ping Emulation Example
Create Node
Create Device
Add Internet Stack
Create IPv4 Interface
Run Emulation.
세그멘테이션 오류 (core dumped)

I would really appreciate any advice or hint to solve the problem.

Thank you.

With Regards,

Dowon

Konstantinos

unread,
Mar 31, 2014, 5:32:53 AM3/31/14
to ns-3-...@googlegroups.com
Hi,

Naturally, the compiler has suggested you to run your scenario under the debugger. Have you done that? Segmentation Faults are always run-time errors, usually when you are trying to access an object in the memory that is not there (e.g. pointer is null).
Have you changed anything in the example code?

Hajime Tazaki

unread,
Mar 31, 2014, 11:08:50 AM3/31/14
to ns-3-...@googlegroups.com

Hello,

it would be helpful if you gave the following information.

- which version of DCE are you using ? dce-ns3-1.0 ?
dce-linux-1.2 ?
- what distribution are you using ? Linux ? Ubuntu or Fedora
version ?
- if possible, could you give me a stack trace of
the segmentation fault ?

% gdb -c (core filename) build/bin/dce-emu-ping
(gdb) backtrace

should give you the stack trace.

# I may miss questions if Direct Code Execution was
abbreviated with DEC, not DCE.

-- Hajime

At Mon, 31 Mar 2014 02:32:53 -0700 (PDT),
Konstantinos wrote:
>
> [1 <text/plain; UTF-8 (quoted-printable)>]
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, 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 http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
> [2 <text/html; UTF-8 (quoted-printable)>]
>

Dowon Hyun

unread,
Mar 31, 2014, 7:56:41 PM3/31/14
to ns-3-...@googlegroups.com
Hello

Information is below:
DCE version : dce-ns3-1.2
OS : Ubuntu 13.10

I can't find core file. Below is backtrace.

root@dowon-LinuxPC:/home/dowon/dce/DCE/build/bin# gdb dce-emu-ping
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 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".
For bug reporting instructions, please see:
Reading symbols from /home/dowon/dce/DCE/build/bin/dce-emu-ping...done.
(gdb) r
Starting program: /home/dowon/dce/DCE/build/bin/dce-emu-ping
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
DCE Ping Emulation Example
Create Node
Create Device
Add Internet Stack
Create IPv4 Interface

Program received signal SIGUSR1, User defined signal 1.
0x00007ffff1326a8b in raise (sig=10) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:38
38      ../nptl/sysdeps/unix/sysv/linux/pt-raise.c: 그런 파일이나 디렉터리가 없습니다. ----> There is no file or director
(gdb) continue
Continuing.
Run Emulation.
[New Thread 0x7ffff090f700 (LWP 22798)]
[New Thread 0x7ffff7fb7700 (LWP 22799)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fb7700 (LWP 22799)]
__strlen_sse2_pminub () at ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S:38
38      ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S: 그런 파일이나 디렉터리가 없습니다. ----> There is no file or director
(gdb) backtrace
#0  __strlen_sse2_pminub () at ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S:38
#1  0x00007ffff1b09a45 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007ffff7b1947a in ns3::ElfCache::EditBuffer (this=0x7ffff7dd8e00 <ns3::CoojaLoader::Peek()::modules>, map=0x7ffff7fe1000 "\177ELF\002\001\001", selfId=6)
    at ../model/elf-cache.cc:208
#3  0x00007ffff7b19d58 in ns3::ElfCache::EditFile (this=0x7ffff7dd8e00 <ns3::CoojaLoader::Peek()::modules>, filename=..., selfId=6) at ../model/elf-cache.cc:259
#4  0x00007ffff7b1b159 in ns3::ElfCache::Add (this=0x7ffff7dd8e00 <ns3::CoojaLoader::Peek()::modules>, filename=...) at ../model/elf-cache.cc:359
#5  0x00007ffff7b1f9a7 in ns3::CoojaLoader::LoadModule (this=0x6d4b70, filename=..., flag=256) at ../model/cooja-loader-factory.cc:221
#6  0x00007ffff7b1f565 in ns3::CoojaLoader::Load (this=0x6d4b70, filename=..., flag=256) at ../model/cooja-loader-factory.cc:172
#7  0x00007ffff7a82db0 in ns3::DceManager::LoadMain (ld=0x6d4b70, filename=..., proc=0x6d4c10, err=@0x7ffff7fb6b68: 0) at ../model/dce-manager.cc:1266
#8  0x00007ffff7a7bd53 in ns3::DceManager::PrepareDoStartProcess (current=0x6d52e0) at ../model/dce-manager.cc:253
#9  0x00007ffff7a7c2be in ns3::DceManager::DoStartProcess (context=0x6d52e0) at ../model/dce-manager.cc:275
#10 0x00007ffff7b0c7a0 in ns3::TaskManager::Trampoline (context=0x6d5150) at ../model/task-manager.cc:274
#11 0x00007ffff7b08465 in ns3::PthreadFiberManager::Run (arg=0x6d55d0) at ../model/pthread-fiber-manager.cc:402
#12 0x00007ffff131ef6e in start_thread (arg=0x7ffff7fb7700) at pthread_create.c:311
#13 0x00007ffff10499cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
(gdb) 

Thanks in advance,
Dowon

2014년 4월 1일 화요일 오전 12시 8분 50초 UTC+9, Hajime 님의 말:

Hajime Tazaki

unread,
Mar 31, 2014, 11:50:25 PM3/31/14
to ns-3-...@googlegroups.com

Hi,

thank you for the information.
dce-1.2 doesn't support Ubuntu 13.10 due to the Bug 1773.

https://www.nsnam.org/bugzilla/show_bug.cgi?id=1773

coming dce-1.3 and development version (dce-dev) already
merged the fix and should work with it.

-- Hajime

At Mon, 31 Mar 2014 16:56:41 -0700 (PDT),
> > an email to ns-3-users+...@googlegroups.com <javascript:>.
> > > To post to this group, send email to ns-3-...@googlegroups.com<javascript:>.

Dowon Hyun

unread,
Apr 1, 2014, 2:20:37 AM4/1/14
to ns-3-...@googlegroups.com
Thanks for your fast response.

I ran dce-emu-ping with dce-ns3-dev on Ubuntu 13.10, but I have still same error.
Trace is also same.
And I ran dce-emu-ping with dce-ns3-1.2 on Ubuntu 12.04, but same error occurs.

Could you let me explain how to run dce in detailed?

Finally, I want to use ns3 with dce as a LTE interface emulator.

Regards,
Dowon

2014년 4월 1일 화요일 오후 12시 50분 25초 UTC+9, Hajime 님의 말:

Dowon Hyun

unread,
Apr 1, 2014, 10:17:15 AM4/1/14
to ns-3-...@googlegroups.com
Hi,

I tested dce-emu-ping with dce-ns3-1.2 again on Ubuntu 12.04 64bit.
But I have still same error.

What can I do for it?


2014년 4월 1일 화요일 오후 3시 20분 37초 UTC+9, Dowon Hyun 님의 말:

Dowon Hyun

unread,
Apr 2, 2014, 6:52:37 AM4/2/14
to ns-3-...@googlegroups.com
Hi,

Above error occurs at elf-cache.cc, ElfCache::EditBuffer according to gdb.

(gdb) backtrace
#0  __strlen_sse2_pminub () at ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S:38
#1  0x00007ffff1b09a45 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007ffff7b1947a in ns3::ElfCache::EditBuffer (this=0x7ffff7dd8e00 <ns3::CoojaLoader::Peek()::modules>, map=0x7ffff7fe1000 "\177ELF\002\001\001", selfId=6)
    at ../model/elf-cache.cc:208

At that point, it seem looking for some library files. But it can't find required library and try to find several times.
Especially, variable dt-strtab has too big number(400870) compared with previous values(d90, 490) when error occurs.
On my little knowledge, my PATH environment may be wrong.
Please let me know how to set PATH environment.

Below is modified elf-cache.cc, ElfCache::EditBuffer for tracing and its result.

elf-cache.cc
  // first, Patch the DT_NEEDED, and, DT_SONAME entries
  // and save the DT_INIT entry
  long dt_strtab = GetDtStrTab (dyn, base_address);
  long dt_init = 0;
  ElfW (Dyn) * cur = dyn;
        printf("0 \n");
  while (cur->d_tag != DT_NULL)
    {
        printf("00\n");
      if (cur->d_tag == DT_NEEDED)
        {
        printf("x1\n");
        printf("%x, %x, %x\n", map, dt_strtab, cur);
        printf("%x\n", cur->d_un);
        printf("%x\n", cur->d_un.d_val);
          char *needed = (char *)(map + dt_strtab + cur->d_un.d_val);
        printf("################## %x ###########, \n", needed);
        printf("################## %s ###########, %d \n", needed, strlen(needed));
          if (std::string (needed) != "ld-linux-x86-64.so.2"
              && std::string (needed) != "ld-linux.so.2")
            {
        printf("1 \n");
              uint32_t id = GetDepId (needed);
        printf("2 \n");
              fileInfo.deps.push_back (id);
        printf("3 \n");
              WriteString (needed, id);
        printf("4 \n");
            }
        }
      else if (cur->d_tag == DT_SONAME)
        {
        printf("5 \n");
          char *soname = (char *)(map + dt_strtab + cur->d_un.d_val);
          WriteString (soname, selfId);
        printf("6 \n");
        }
      else if (cur->d_tag == DT_INIT)
        {
        printf("7 \n");
          dt_init = cur->d_un.d_val;
        printf("8 \n");
        }
        printf("x2\n");
      cur++;
    }
        printf("x3\n");


Result:
root@dowon-LinuxPC:/home/dowon/dce/dce# dce-emu-ping 
DCE Ping Emulation Example
Create Node
Create Device
Add Internet Stack
Create IPv4 Interface
Run Emulation.
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
x3
x4
00
x1
47cd000, d90, 4810df8
1
1
################## 47cdd91 ###########, 
################## libc.so.6 ###########, 9 
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
x3
x4
00
x1
47ce000, 490, 4810df8
1
1
################## 47ce491 ###########, 
################## libc.so.6 ###########, 9 
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
00
x2
x3
x4
00
x1
4959000, 400870, 4960e50
10
10
################## 4d59880 ###########, 
세그멘테이션 오류 (core dumped)


Regards,
Dowon




2014년 4월 1일 화요일 오후 11시 17분 15초 UTC+9, Dowon Hyun 님의 말:

Dowon Hyun

unread,
Apr 2, 2014, 8:48:02 AM4/2/14
to ns-3-...@googlegroups.com
Hi, 

test.py works very well without elf-cache error under ns-3-dce.
I set PATH environment as same as test.py does. (LD_LIBRARY_PATH, PATH, PYTHONPATH, DEC_PATH, DEC_ROOT)
But still dce-emu-ping has segmentation fault.

I would really appreciate any advice or hint to solve the problem.

current environment:
os: ubuntu 12.04
dce: ns-linux-1.0

Thank you.

Regards,
Dowon

2014년 4월 2일 수요일 오후 7시 52분 37초 UTC+9, Dowon Hyun 님의 말:

Hajime Tazaki

unread,
Apr 2, 2014, 9:56:35 AM4/2/14
to ns-3-...@googlegroups.com

Hi,

well, you don't have to configure environmental variables
(PATH, LD_LIBRARY_PATH, etc). In the past, you need to
configure them by hand (or script like bakeSetEnv.sh).

all you need is to execute program by "waf --run".

./waf --run "dce-emu-ping --deviceName=ens33"

# deviceName is an option in case you need.

I guess the error might be failure due to loading system
ping command, instead of our own-built ping located at
(bake_build_root)/build/bin_dce/ directory.

let me know if you still face trouble.

-- Hajime

At Wed, 2 Apr 2014 05:48:02 -0700 (PDT),

Dowon Hyun

unread,
Apr 6, 2014, 8:09:05 PM4/6/14
to ns-3-...@googlegroups.com
Dear Hajime,

Now I can run dce-emu-ping example as your help.
There is two problem.
One is I have no ping binary for NS-3. I made ping binary for NS-3 using ping open source according to NS-3 manual.
The other is I tried to run binary file directly in build/bin folder without "waf --run".

Thank you for your help.

Regards,
Dowon




2014년 4월 2일 수요일 오후 10시 56분 35초 UTC+9, Hajime 님의 말:
Reply all
Reply to author
Forward
0 new messages