symbol __libc_start_main, version GLIBC_2.2.5 not defined

1,226 views
Skip to first unread message

David Major

unread,
Apr 17, 2016, 6:13:23 AM4/17/16
to ns-3-users
Hi all,

When I've tried to run a userspace protocol implementation I've encountered the following weird error:
(I've compiled with -fPIC -U_FORTIFY_SOURCE, and linked with -pie -rdynamic)

user@dcetest:~/NS3/dce/source/ns-3-dce$ ./waf --run quictest
Waf: Entering directory `/home/user/NS3/dce/source/ns-3-dce/build'
[ 10/328] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[111/328] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/user/NS3/dce/source/ns-3-dce/build'
'build' finished successfully (0.650s)
assert failed. cond="handle != 0", msg="Could not open elf-cache/0/quic_client elf-cache/0/quic_client: symbol __libc_start_main, version GLIBC_2.2.5 not defined in file 0001.so.6 with link time reference", file=../model/cooja-loader-factory.cc, line=236
terminate called without an active exception
Command ['/home/user/NS3/dce/source/ns-3-dce/build/myscripts/quictest/bin/quictest'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


It say it can't find symbol '__libc_start_main', but it's not a syscall, it's in the ABI. But, I've followed manual and inserted this line to 'model/libc-ns3.h':
NATIVE (__libc_start_main)

But I can't build it (and I haven't hope this):
user@dcetest:~/NS3/dce/source/ns-3-dce$ nano model/libc-ns3.h
user@dcetest:~/NS3/dce/source/ns-3-dce$ ./waf
Waf: Entering directory `/home/user/NS3/dce/source/ns-3-dce/build'
[ 10/328] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[ 15/328] cxx: model/libc-dce.cc -> build/model/libc-dce.cc.6.o
../model/libc-ns3.h: In function ‘void libc_dce(Libc**)’:
../model/libc-ns3.h:225:6: warning: ‘char* getwd(char*)’ is deprecated (declared at /usr/include/unistd.h:525) [-Wdeprecated-declarations]
 DCE (getwd)
      ^
../model/libc-dce.cc:154:62: note: in definition of macro ‘DCE’
 #define DCE(name) (*libc)->name ## _fn = (func_t)(__typeof (&name))dce_ ## name;
                                                              ^
../model/libc-ns3.h:622:9: error: ‘__libc_start_main’ was not declared in this scope
 NATIVE (__libc_start_main)
         ^
../model/libc-dce.cc:159:34: note: in definition of macro ‘NATIVE’
   (*libc)->name ## _fn = (func_t)name;
                                  ^
Waf: Leaving directory `/home/user/NS3/dce/source/ns-3-dce/build'
Build failed
 -> task in './lib/ns3-dce' failed (exit status 1):
    {task 139981850214928: cxx libc-dce.cc -> libc-dce.cc.6.o}
['/usr/bin/g++', '-g', '-fPIC', '-pthread', '-pthread', '-pthread', '-I/home/user/NS3/dce/source/ns-3-dce/build/model', '-I/home/user/NS3/dce/source/ns-3-dce/model', '-I/home/user/NS3/dce/source/ns-3-dce/build/model/freebsd', '-I/home/user/NS3/dce/source/ns-3-dce/model/freebsd', '-I/home/user/NS3/dce/source/ns-3-dce/build/helper', '-I/home/user/NS3/dce/source/ns-3-dce/helper', '-I/home/user/NS3/dce/source/ns-3-dce/build/model/linux', '-I/home/user/NS3/dce/source/ns-3-dce/model/linux', '-I/home/user/NS3/dce/source/ns-3-dce/build/include', '-I/home/user/NS3/dce/source/ns-3-dce/include', '-I/home/user/NS3/dce/build/include/ns3-dev', '-DNS3_LOG_ENABLE', '-DNS3_ASSERT_ENABLE', '-DHAVE_NS3_CORE=1', '-DHAVE_NS3_NETWORK=1', '-DHAVE_NS3_INTERNET=1', '-DHAVE_NS3_POINT_TO_POINT=1', '-DHAVE_NS3_TAP_BRIDGE=1', '-DHAVE_NS3_NETANIM=1', '-DHAVE_NS3_WIFI=1', '-DHAVE_NS3_CSMA=1', '-DHAVE_NS3_MOBILITY=1', '-DHAVE_NS3_POINT_TO_POINT_LAYOUT=1', '-DHAVE_NS3_MPI=1', '-DHAVE_NS3_LTE=1', '-DHAVE_NS3_APPLICATIONS=1', '-DHAVE_NS3_FD_NET_DEVICE=1', '-DHAVE_STDINT_H=1', '-DHAVE_INTTYPES_H=1', '-DHAVE_SYS_TYPES_H=1', '-DHAVE_SYS_STAT_H=1', '-DHAVE_DIRENT_H=1', '-DHAVE_GETCPUFEATURES=1', '-DHAVE_NS3_FLOW_MONITOR=1', '-DHAVE_HOOK_MANAGER_H=1', '-DPYTHONDIR="/home/user/NS3/dce/build/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/home/user/NS3/dce/build/lib/python2.7/site-packages"', '../model/libc-dce.cc', '-c', '-o', 'model/libc-dce.cc.6.o']




When I use the other, DlmLoaderFactory, it's just simply crash:
user@dcetest:~/NS3/dce/source/ns-3-dce$ ./waf --run quictest --dlm
Waf: Entering directory `/home/user/NS3/dce/source/ns-3-dce/build'
[ 10/328] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[111/328] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/user/NS3/dce/source/ns-3-dce/build'
'build' finished successfully (0.687s)
Command ['/home/user/NS3/dce/source/ns-3-dce/build/bin/dce-runner', '/home/user/NS3/dce/source/ns-3-dce/build/myscripts/quictest/bin/quictest'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").




My source code:
user@dcetest:~/NS3/dce/source/ns-3-dce$ cat myscripts/quictest/quictest.cc
#include "ns3/network-module.h"
#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/dce-module.h"

using namespace ns3;

int main (int argc, char *argv[])
{
  CommandLine cmd;
  cmd.Parse (argc, argv);

  NodeContainer nodes;
  nodes.Create (1);

  InternetStackHelper stack;
  stack.Install (nodes);

  DceManagerHelper dceManager;
  dceManager.Install (nodes);

  DceApplicationHelper dce;
  ApplicationContainer apps;

  dce.SetStackSize (1 << 20);

  dce.SetBinary ("quic_client");
  dce.ResetArguments ();
  apps = dce.Install (nodes.Get (0));
  apps.Start (Seconds (4.0));

//  dce.SetBinary ("udp-client");
//  dce.ResetArguments ();
//  dce.AddArgument ("127.0.0.1");
//  apps = dce.Install (nodes.Get (0));
//  apps.Start (Seconds (4.5));

  Simulator::Stop (Seconds (1000100.0));
  Simulator::Run ();
  Simulator::Destroy ();

  return 0;
}


My wscript:
user@dcetest:~/NS3/dce/source/ns-3-dce$ cat myscripts/quictest/wscript
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

import ns3waf
import os

def configure(conf):
    ns3waf.check_modules(conf, ['core', 'internet', 'point-to-point', 'netanim'], mandatory = True)

def build(bld):
#    linkerpath=os.path.abspath(os.path.join('..', 'elf-loader','ldso'))
    bld.build_a_script('dce', needed = ['core', 'internet', 'dce', 'point-to-point', 'netanim' ],
                  target='bin/quictest',
                  source=['quictest.cc'],
#                  linkflags=['-Wl,--dynamic-linker=' + linkerpath ]
#                  linkflags=['-L/usr/local/lib'],
#                  lib=['foolib']
                  )


I've installed dce according the manual on a virgin Ubuntu 14.04 LTS server with bake(by the way, during the dependency check it can't recognise libc lib both on Ubuntu 12.04 LTS and 14.04 LTS):
hg clone http://code.nsnam.org/bake bake
export BAKE_HOME=`pwd`/bake
export PATH=$PATH:$BAKE_HOME
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
mkdir dce
cd dce
bake.py configure -e dce-ns3-dev

user@dcetest:~/NS3/dce$ bake.py check
 > Python - OK
 > GNU C++ compiler - OK
 > Mercurial - OK
 > CVS - OK
 > GIT - OK
 > Bazaar - OK
 > Tar tool - OK
 > Unzip tool - OK
 > Unrar tool - OK
 > 7z  data compression utility - OK
 > XZ data compression utility - OK
 > Make - OK
 > cMake - OK
 > patch tool - OK
 > autoreconf tool - OK


 > Path searched for tools: /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /home/user/NS3/bake bin  /home/user/NS3/bake

user@dcetest:~/NS3/dce$ bake.py show
module: iperf (enabled)
  No dependencies!
module: libexpat-dev (enabled)
  No dependencies!
module: libpcap-dev (enabled)
  No dependencies!
module: bash (enabled)
  No dependencies!
module: thttpd (enabled)
  No dependencies!
module: wget (enabled)
  No dependencies!
module: setuptools (enabled)
  No dependencies!
module: pygoocanvas (enabled)
  No dependencies!
module: pygraphviz (enabled)
  No dependencies!
module: python-dev (enabled)
  No dependencies!
module: gccxml-ns3 (enabled)
  No dependencies!
module: libc (enabled)
  No dependencies!
module: qt4 (enabled)
  No dependencies!
module: g++ (enabled)
  No dependencies!
module: ccnx (enabled)
  depends on:
     libpcap-dev (optional:False)
     libexpat-dev (optional:False)
module: pyviz-prerequisites (enabled)
  depends on:
     python-dev (optional:True)
     pygraphviz (optional:True)
     pygoocanvas (optional:True)
module: pygccxml (enabled)
  depends on:
     gccxml-ns3 (optional:False)
     setuptools (optional:False)
module: netanim-3.107 (enabled)
  depends on:
     qt4 (optional:False)
     g++ (optional:False)
module: libc-debug (enabled)
  depends on:
     libc (optional:False)
module: pybindgen-0.17.0.post49+ng0e4e3bc (enabled)
  depends on:
     pygccxml (optional:True)
     python-dev (optional:True)
     setuptools (optional:False)
module: elf-loader (enabled)
  depends on:
     libc-debug (optional:False)
module: ns-3.25 (enabled)
  depends on:
     netanim-3.107 (optional:True)
     pybindgen-0.17.0.post49+ng0e4e3bc (optional:True)
     pyviz-prerequisites (optional:True)
module: dce-meta-1.8 (enabled)
  depends on:
     ns-3.25 (optional:False)
     elf-loader (optional:True)
     iperf (optional:True)
     ccnx (optional:True)
     wget (optional:True)
     thttpd (optional:True)
     bash (optional:True)
module: dce-ns3-1.8 (enabled)
  depends on:
     dce-meta-1.8 (optional:False)

-- System Dependencies --
 > g++ - OK
 > libc - Missing
   >> Didn't find:   libc package; please install it.
   >> Try: "sudo apt-get install libc6", if you have sudo rights.
 > libc-debug - OK
 > libexpat-dev - OK
 > libpcap-dev - OK
 > pygoocanvas - Missing
   >> The pygoocanvas is not installed, try to install it.
   >> Try: "sudo apt-get install python-pygoocanvas", if you have sudo rights.
 > pygraphviz - Missing
   >> The pygraphviz is not installed, try to install it.
   >> Try: "sudo apt-get install python-pygraphviz", if you have sudo rights.
 > python-dev - Missing
   >> The python-dev is not installed, try to install it.
   >> Try: "sudo apt-get install python-dev", if you have sudo rights.
 > qt4 - Missing
   >> Didn't find:   QT 4, download and install it from http://qt.nokia.com/downloads/
   >> Try: "sudo apt-get install qt4-dev-tools libqt4-dev", if you have sudo rights.
 > setuptools - OK
 user@dcetest:~/NS3/dce$ sudo apt-get install libc6
Reading package lists... Done
Building dependency tree      
Reading state information... Done
libc6 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
user@dcetest:~/NS3/dce$ dpkg -l | grep libc
ii  klibc-utils                         2.0.3-0ubuntu1                       amd64        small utilities built with klibc for early boot
ii  libc-bin                            2.19-0ubuntu6.7                      amd64        Embedded GNU C Library: Binaries
ii  libc-dev-bin                        2.19-0ubuntu6.7                      amd64        Embedded GNU C Library: Development binaries
ii  libc6:amd64                         2.19-0ubuntu6.7                      amd64        Embedded GNU C Library: Shared libraries
ii  libc6-dbg:amd64                     2.19-0ubuntu6.7                      amd64        Embedded GNU C Library: detached debugging symbols
ii  libc6-dev:amd64                     2.19-0ubuntu6.7                      amd64        Embedded GNU C Library: Development Libraries and Header Files
ii  libcap-ng0                          0.7.3-1ubuntu2                       amd64        An alternate POSIX capabilities library
ii  libcap2:amd64                       1:2.24-0ubuntu2                      amd64        support for getting/setting POSIX.1e capabilities
ii  libcap2-bin                         1:2.24-0ubuntu2                      amd64        basic utility programs for using capabilities
ii  libcgmanager0:amd64                 0.24-0ubuntu7.5                      amd64        Central cgroup manager daemon (client library)
ii  libck-connector0:amd64              0.4.5-3.1ubuntu2                     amd64        ConsoleKit libraries
ii  libclass-accessor-perl              0.34-1                               all          Perl module that automatically generates accessors
ii  libcloog-isl4:amd64                 0.18.2-1                             amd64        Chunky Loop Generator (runtime library)
ii  libcomerr2:amd64                    1.42.9-3ubuntu1.3                    amd64        common error description library
ii  libcurl3:amd64                      7.35.0-1ubuntu2.6                    amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64               7.35.0-1ubuntu2.6                    amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libcwidget3                         0.5.16-3.5ubuntu1                    amd64        high-level terminal interface library for C++ (runtime files)
ii  libklibc                            2.0.3-0ubuntu1                       amd64        minimal libc subset for use with initramfs
ii  liblocale-gettext-perl              1.05-7build3                         amd64        module using libc functions for internationalization in Perl
ii  linux-libc-dev:amd64                3.13.0-85.129                        amd64        Linux Kernel Headers for development
ii  python3-pycurl                      7.19.3-0ubuntu3                      amd64        Python 3 bindings to libcurl


My gcc version is 4.8.4:
user@dcetest:~/NS3/dce/source/ns-3-dce$ gcc -v && g++ -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)




I know maybe my program wrong, but I think just something went wrong, maybe I use wrong wscript or etc., so I would like to ask some hints about this problem.

Thank you so much,
David

Hajime Tazaki

unread,
Apr 17, 2016, 7:53:08 PM4/17/16
to ns-3-...@googlegroups.com

Hello David,

I was wondering if I can look at the source code of the
binary 'quic_test' (not the simulation script quictest.cc)
and the full command line to build it: I would like to
reproduce it in my local machine.

your wscript and simulation script seem to be okay. the
symbol '__libc_start_main' is somewhat special: the NATIVE
macro is not for this case.

thank you for your interest.

-- Hajime

At Sun, 17 Apr 2016 03:13:23 -0700 (PDT),
David Major wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; UTF-8 (quoted-printable)>]
> Hi all,
>
> When I've tried to run a userspace protocol implementation I've encountered
> the following weird error:
> (I've compiled with -fPIC -U_FORTIFY_SOURCE, and linked with -pie -rdynamic)
>
>
>
>
>
>
>
>
>
> *user@dcetest:~/NS3/dce/source/ns-3-dce$ ./waf --run quictestWaf: Entering
> directory `/home/user/NS3/dce/source/ns-3-dce/build'[ 10/328]
> lib/pkgconfig/libns3-dev-netlink-debug.pc: ->
> build/lib/pkgconfig/libns3-dev-netlink-debug.pc[111/328]
> lib/pkgconfig/libns3-dev-dce-debug.pc: ->
> build/lib/pkgconfig/libns3-dev-dce-debug.pcWaf: Leaving directory
> `/home/user/NS3/dce/source/ns-3-dce/build''build' finished successfully
> (0.650s)assert failed. cond="handle != 0", msg="Could not open
> elf-cache/0/quic_client elf-cache/0/quic_client: symbol __libc_start_main,
> version GLIBC_2.2.5 not defined in file 0001.so.6 with link time
> reference", file=../model/cooja-loader-factory.cc, line=236terminate called
> without an active exceptionCommand
> ['/home/user/NS3/dce/source/ns-3-dce/build/myscripts/quictest/bin/quictest']
> terminated with signal SIGIOT. Run it under a debugger to get more
> information (./waf --run <program> --command-template="gdb --args %s
> <args>").*

David Major

unread,
Apr 18, 2016, 3:30:29 AM4/18/16
to ns-3-users
Hi,

thank you for your reply. Actually the project quit big. :) (git fetch without history ~ 7GB)
https://www.chromium.org/quic/playing-with-quic

Today I can't access to the build machine, but I write down what I remember.

I've used the following gn build flags(gn args out/mybuild) :
use_clang = false
use_glib = false
is_debug = false

You can list the available flags with gn args out/mybuild --list

And after that, when gn generated its files, I've patched the ''toolchain.ninja" in out/mybuild to insert the custom compiler/linker flags and finally I've builded.

ninja -v -C out/mybuild quic_server quic_client

(Fortunately it's doesn't build the whole chromium.)

Excuse me for I don't precise now, but I can write more tomorrow if you want.

Thanks,
David

David Major

unread,
Apr 19, 2016, 4:01:18 AM4/19/16
to ns-3-users
I use the following:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/home/student/CHROMIUM/depot_tools

mkdir chromium
cd chromium

fetch --nohooks --no-history chromium      (~7GB)

cd src
./build/install-build-deps.sh --no-syms --no-arm --no-chromeos-fonts --no-nacl
gclient runhooks

export GYP_CHROMIUM_NO_ACTION=1
export EDITOR=nano

gn gen out/mybuild

gn args out/mybuild
///////////////////////////////////////
is_debug = false
symbol_level = 0
use_glib = false
is_desktop_linux = true
is_clang = false
use_sysroot = false
///////////////////////////////////////

Insert -fPIC and -pie -rdynamic into 'toolchain.ninja'


ninja -v -C out/mybuild quic_server quic_client

user@ubuntu:~/CHROMIUM/chromium/src/out/mybuild$ ldd quic_client
    linux-vdso.so.1 =>  (0x00007ffef39cf000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff967c83000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff967a7b000)
    libnss3.so => /usr/lib/x86_64-linux-gnu/libnss3.so (0x00007ff967741000)
    libnssutil3.so => /usr/lib/x86_64-linux-gnu/libnssutil3.so (0x00007ff967515000)
    libsmime3.so => /usr/lib/x86_64-linux-gnu/libsmime3.so (0x00007ff9672e9000)
    libnspr4.so => /usr/lib/x86_64-linux-gnu/libnspr4.so (0x00007ff9670ac000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff966d9f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff966a99000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff966882000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff966664000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff96629f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff968213000)
    libplc4.so => /usr/lib/x86_64-linux-gnu/libplc4.so (0x00007ff96609a000)
    libplds4.so => /usr/lib/x86_64-linux-gnu/libplds4.so (0x00007ff965e96000)
user@ubuntu:~/CHROMIUM/chromium/src/out/mybuild$ readelf -h quic_client | grep DYN
  Type:                              DYN (Shared object file)
user@ubuntu:~/CHROMIUM/chromium/src/out/mybuild$

Hajime Tazaki

unread,
Apr 20, 2016, 12:03:02 AM4/20/16
to ns-3-...@googlegroups.com

At Tue, 19 Apr 2016 01:01:18 -0700 (PDT),
David Major wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; UTF-8 (quoted-printable)>]
> I use the following:
>
> git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
> export PATH=$PATH:/home/student/CHROMIUM/depot_tools
(snip)

thanks. I'll give it a try and get you back later.

-- Hajime

Hany

unread,
Apr 26, 2016, 3:46:23 PM4/26/16
to ns-3-users
Hello,

I am also trying to run both quic_server and quic_client in dce-linux (1.8). I followed the previous steps introduced by David and I set the configuration file and toolchain as below and I managed to run the server and client independently. However, when I run them in dce environment, I get the below error related to missing timezone symbol:

assert failed. cond="handle != 0", msg="Could not open elf-cache/0/quic_server elf-cache/0/quic_server: symbol __timezone, version GLIBC_2.2.5 not defined in file 0001.so.6 with link time reference", file=../model/cooja-loader-factory.cc, line=236
terminate called without an active exception

I added the timezone as a native system call in the libc-ns3 for test however, I am still getting the same error. Any idea on how to solve it?


The configuration file for gn (Build Configuration System) args is:
is_component_build = false
is_debug = true
symbol_level = 1
enable_nacl = false
symbol_level = 0
use_glib = false
is_desktop_linux = false
is_clang = false
use_sysroot = false

The configuration file for the toolchain.ninja is (I just added 
-fPIC -pie -rdynamic
 for each line that calls gcc or g++):
Enter code he
rule cc
  command = gcc -fPIC -pie -rdynamic -MMD -MF ${out}.d ${defines} ${include_dirs} ${cflags} ${cflags_c} -c ${in} -o ${out}
  description = CC ${out}
  depfile = ${out}.d
  deps = gcc
rule cxx
  command = g++ -fPIC -pie -rdynamic -MMD -MF ${out}.d ${defines} ${include_dirs} ${cflags} ${cflags_cc} -c ${in} -o ${out}
  description = CXX ${out}
  depfile = ${out}.d
  deps = gcc
rule asm
  command = gcc -fPIC -pie -rdynamic -MMD -MF ${out}.d ${defines} ${include_dirs} ${asmflags} -c ${in} -o ${out}
  description = ASM ${out}
  depfile = ${out}.d
  deps = gcc
rule alink
  command = python "../../build/toolchain/gcc_ar_wrapper.py" --output=${out} --ar="ar"  rcsD @"${out}.rsp"
  description = AR ${out}
  rspfile = ${out}.rsp
  rspfile_content = ${in}
rule solink
  command = python "/home/hany/chromium-ns3/src/build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm"  --sofile="${output_dir}/${target_output_name}${output_extension}" --tocfile="${output_dir}/${target_output_name}${output_extension}.TOC" --output="${output_dir}/${target_output_name}${output_extension}" -- g++ -shared ${ldflags} -o "${output_dir}/${target_output_name}${output_extension}" -Wl,-soname="${target_output_name}${output_extension}" @"${output_dir}/${target_output_name}${output_extension}.rsp"
  description = SOLINK ${output_dir}/${target_output_name}${output_extension}
  rspfile = ${output_dir}/${target_output_name}${output_extension}.rsp
  rspfile_content = -Wl,--whole-archive ${in} ${solibs} -Wl,--no-whole-archive  ${libs} 
  pool = link_pool
  restat = 1
rule solink_module
  command = g++ -fPIC -pie -rdynamic -shared ${ldflags} -o "${output_dir}/${target_output_name}${output_extension}" -Wl,-soname="${target_output_name}${output_extension}" @"${output_dir}/${target_output_name}${output_extension}.rsp"
  description = SOLINK_MODULE ${output_dir}/${target_output_name}${output_extension}
  rspfile = ${output_dir}/${target_output_name}${output_extension}.rsp
  rspfile_content = -Wl,--whole-archive ${in} ${solibs} -Wl,--no-whole-archive  ${libs} 
  pool = link_pool
rule link
  command = g++ -fPIC -pie -rdynamic ${ldflags} -o "${output_dir}/${target_output_name}${output_extension}" -Wl,--start-group @"${output_dir}/${target_output_name}${output_extension}.rsp" ${solibs} -Wl,--end-group  ${libs} 
  description = LINK ${output_dir}/${target_output_name}${output_extension}
  rspfile = ${output_dir}/${target_output_name}${output_extension}.rsp
  rspfile_content = ${in}
  pool = link_pool
rule stamp
  command = touch ${out}
  description = STAMP ${out}
rule copy
  command = ln -f ${in} ${out} 2>/dev/null || (rm -rf ${out} && cp -af ${in} ${out})
  description = COPY ${in} ${out}
re
...




David Major

unread,
Apr 27, 2016, 6:52:21 AM4/27/16
to ns-3-users
Hi,

I think is_desktop_linux = true will solve it (if you use linux), but you will encounter with my problem.

D

Hany

unread,
Apr 27, 2016, 9:43:07 AM4/27/16
to ns-3-users
Hi David,

I set is_desktop_linux = true and I am still getting the same problem of missing timezone symbol even though I have it as native system call. I think but not sure the __libc_start_main is executed before the timezone symbol i.e. in my case I don't have the same problem like you.

prk...@gmail.com

unread,
Sep 20, 2016, 10:51:38 AM9/20/16
to ns-3-users

Hello all,
   I am having the same problem when I try to run quic server inside dce:

assert failed. cond="handle != 0", msg="Could not open elf-cache/0/quic_server elf-cache/0/quic_server: symbol __libc_start_main, version GLIBC_2.2.5 not defined in file 0002.so.6 with link time reference", file=../model/cooja-loader-factory.cc, line=236

terminate called without an active exception

I am checking to see if you were able to find a solution for this issue.

Thank you.
Prakash

Hany

unread,
Sep 20, 2016, 11:42:33 AM9/20/16
to ns-3-users
Hello,

Unfortunately, I did not find a solution to the problem so I gave up.

Regards,
Hany Assasa

prk...@gmail.com

unread,
Sep 20, 2016, 4:20:29 PM9/20/16
to ns-3-users
Hello Hany,
   Thank you for a quick response. I've exhausted my options too to get this working.

Regards,

Prakash


On Sunday, April 17, 2016 at 5:13:23 AM UTC-5, David Major wrote:

Matt Anonyme

unread,
Sep 20, 2016, 6:10:50 PM9/20/16
to ns-3-users
When you need function part of the ABI, you need a declaration for it so you should look into libc code what's the prototype of __libc_start_main and copy it in DCE.
NATIVE (__libc_start_main)

After compiling dce, make sure the libraries exported correctly the

symbol "__libc_start_main" via doing "nm -D <DCE>/build/lib/libc-ns3.so"
Hopefully I've written a script for clang support that should be able to do just that but that will be avaiable in DCE 2.0.

Hany

unread,
Sep 20, 2016, 6:27:00 PM9/20/16
to ns-3-users
Hi Matt,

Thanks for the reply, however according to the manual of DCE if we want to add a native symbol we should not declare any function body for it since it will redirected to the underlying host OS. Only the DCE symbols need function bodies.

Matt

unread,
Sep 20, 2016, 8:06:25 PM9/20/16
to ns-3-users
You don't need to define it but to declare it (in a header) so that it
gets exported in the library, otherwise the symbol is likely to not
get exported.

For instance on my system libc library, the symbol exists:
nm -D /usr/libc.so.6
0000000000020740 T __libc_start_main
/build/glibc-GKVZIf/glibc-2.23/csu/../csu/libc-start.c:126

And it needs to exists in the DCE library as well (you can check with
the command in my previous message).
> --
> 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/JIirultln1o/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.

prk...@gmail.com

unread,
Sep 22, 2016, 11:43:16 AM9/22/16
to ns-3-users
Hi Matt,
   It helped. Adding the __libc_start_main signature (below) to header file model/libc-dce.h  helped with the problem. There are still issues with quic in dce, but at least I am able to go further. Thanks for the tip.

int __libc_start_main(int *(main) (int, char * *, char * *), int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), void (*rtld_fini) (void), void (* stack_end));


Prakash


 

On Sunday, April 17, 2016 at 5:13:23 AM UTC-5, David Major wrote:

Hany

unread,
Sep 22, 2016, 6:34:18 PM9/22/16
to ns-3-users
Hi Prakash,

Would you please share what are the new problem you encounter now? Are there any additional missing symbols? And did you manage to test the QUIC server and client and do transmission?

Thanks.

prk...@gmail.com

unread,
Sep 23, 2016, 11:15:30 AM9/23/16
to ns-3-users
Hi Hany,
   No, I have not reached to the point where I could run quic with dce. I had to add 'log' and 'exp' NATIVE symbols to model/libc-ns3.h. After this, I now see below issue with memcpy. I see that memcpy is already in model/libc-ns3.h, so  not sure yet what is causing this. I did not get a chance to dig further into it. I am using dce 1.8.

assert failed. cond="handle != 0", msg="Could not open elf-cache/0/quic_server elf-cache/0/quic_server: symbol memcpy, version GLIBC_2.2.5 not defined in file 0001.so.6 with link time reference", file=../model/cooja-loader-factory.cc, line=236

Thanks,
Prakash

Matt Anonyme

unread,
Sep 25, 2016, 9:57:36 AM9/25/16
to ns-3-users
Indeed that's strange. Is quick build against its own libc ?

Matt Anonyme

unread,
Nov 10, 2016, 12:31:57 PM11/10/16
to ns-3-users
Hi prakash,

As a matter of fact, I've upated my workstation and hit the same problem.
I don't know if it's due to compiling flags or the compiler with "g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005" so if anyone has a hint on this let's hear it :)

german...@blue-tc.com

unread,
Jun 14, 2017, 5:44:19 AM6/14/17
to ns-3-users
Hi all,

Did you get the quic_client running in a NS3 simulation?

Best Regards.
Message has been deleted

opens...@epust.dk

unread,
Apr 20, 2018, 8:03:45 AM4/20/18
to ns-3-users

I have tried to run the stunserver from https://webrtc.org/native-code/development/ in DCE 1.9 and I also get the error:


assert failed. cond="handle != 0", msg="Could not open elf-cache/0/stunserver elf-cache/0/stunserver: symbol __libc_start_main, version GLIBC_2.2.5 not defined in file 0001.so.6 with link time reference", file=../model/cooja-loader-factory.cc, line=236


Note that the stunserver is built using Google's own build system. I assume that the same goes for quic which this thread is about. This build system downloads its own version of clang that it uses for compilation and linking. It uses 'ldd' to link with as a default, so I had to set a flag use_ldd=false - otherwise DCE would not even load the stunserver binary.


My system is Ubunto 16.04 and I have compiled DCE itself with the standard compiler on that system.


Any help will be much appreciated!

Reply all
Reply to author
Forward
0 new messages