Direct Code Execution error Ubuntu 18.04

253 views
Skip to first unread message

Patrick Hughes

unread,
Feb 10, 2020, 6:52:48 AM2/10/20
to ns-3-users
Hi,

I built DCE on Ubuntu 18.04 and all seemed well until I tried to run a script using waf. I got the following error.

paddyxvy@pc-paddyxvy:~/dce/source/ns-3-dce$ ./waf --run dce-udp-simple
Waf: Entering directory `/home/paddyxvy/dce/source/ns-3-dce/build'

--------------------------------------------------------------------
 Python bindings compilation
--------------------------------------------------------------------
[ 10/371] Creating build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/371] Creating build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/paddyxvy/dce/source/ns-3-dce/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (0.432s)
Fatal error: glibc detected an invalid stdio handle
Command ['/home/paddyxvy/dce/source/ns-3-dce/build/bin/dce-udp-simple'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

I've read around and found this is an existing problem. I read through this Github error log but it hasn't concluded with a patch or workaround solution.

Does anyone know of a way to get around this error other than using a known supported version of Ubuntu for DCE like those mentioned here.
Thank you for your time.

Matt Anonyme

unread,
Feb 10, 2020, 4:19:21 PM2/10/20
to ns-3-users
which dce version have you tried ? I think there was a fix for it on master but I may be wrong.

Patrick Hughes

unread,
Feb 10, 2020, 5:45:03 PM2/10/20
to ns-3-...@googlegroups.com
I tried dce-linux-1.10

Thanks for the help 😊

--
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 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 view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/0f0b0bbc-a45c-44c5-909e-ab17fafd0402%40googlegroups.com.

Stoica Cosmin

unread,
Apr 12, 2020, 3:52:52 PM4/12/20
to ns-3-users
Hello Patrick,

Have you managed to find a mitigation for glibc issue ?

I am also trying to run experiments using ns3-dce on Ubuntu 18, but due to that fact that this version of Ubuntu has libc 2.27 that enforces the vtable checking, current implementation for dce-stdio.cc is not any longer valid.

Best regards,
Cosmin
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-...@googlegroups.com.

Tom Henderson

unread,
Apr 13, 2020, 12:27:13 AM4/13/20
to ns-3-...@googlegroups.com, Stoica Cosmin
On 4/12/20 12:52 PM, Stoica Cosmin wrote:
> Hello Patrick,
>
> Have you managed to find a mitigation for glibc issue ?
>
> I am also trying to run experiments using ns3-dce on Ubuntu 18, but due
> to that fact that this version of Ubuntu has libc 2.27 that enforces the
> vtable checking, current implementation for dce-stdio.cc is not any
> longer valid.
>
> Best regards,
> Cosmin
>

I'm not aware of a solution for Ubuntu 18.04; I use Ubuntu 16.04 for DCE.

- Tom

Stoica Cosmin

unread,
Apr 13, 2020, 3:17:46 AM4/13/20
to Tom Henderson, ns-3-...@googlegroups.com
Hello Tom,

Thank you very much for clarifying. I will continue using Ubuntu 16.04, until we will find a way to re-implement this dce stdio module.

Best regards,
Cosmin

Matt

unread,
Apr 13, 2020, 8:18:28 AM4/13/20
to ns-3-users, Tom Henderson
have you tried using DCE master ? hajime had pushed a fix for this.

2020年4月13日(月) 9:17 Stoica Cosmin <cosmin....@gmail.com>:
> --
> 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/Ox0ps6rPV1Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/CAKEvhP_q-1Z2xnouRS1-ZsRYjQsBTzz7tzTP8Boeqhk%2Bbtuh%2BQ%40mail.gmail.com.

Stoica Cosmin

unread,
Apr 13, 2020, 4:04:13 PM4/13/20
to matt...@gmail.com, ns-3-...@googlegroups.com
Hello  Matthieu,

Thanks for helping!

I am using latest version of ns3-dce:

====> git log short history  <=====
1d88fea (HEAD -> master, origin/master) Update some documentation content
129c14c Merge pull request #102 from teto/clean_update
25eb37e fix for python bindings
2ffbdf6 fix for python35
c209d2d adding with-ns3 path to PKG_CONFIG_PATH
<============================================================>

 but it seems that when I have tried on Ubuntu 18 with glibc  2.27-3ubuntu1, the following error was reported:

bake/source/ns-3-dce$ python3 waf --run dce-iperf-mptcp
Waf: Entering directory `/work/git/dce_dev_alex/bake/source/ns-3-dce/build'
Building library netlink
Building library dce
Building library dce-test
Building library dce-test-netlink
[349/369] Creating build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[350/369] Creating build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/work/git/dce_dev_alex/bake/source/ns-3-dce/build'

Build commands will be stored in build/compile_commands.json
'build' finished successfully (0.813s)
Don't know how to configure dynamic library path for the platform 'linux'; assuming it's LD_LIBRARY_PATH.

Fatal error: glibc detected an invalid stdio handle
Command ['/work/git/dce_dev_alex/bake/source/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>").

Notes:
1.  LD_LIBRARY_PATH value:

 echo $LD_LIBRARY_PATH
<work_path>/bake/source/ns-3-dce/build/lib

2. Is this the fix vtable ? 

Which is the future approach to mitigate the vtable issue? I am asking because we need a new approach since vtable is modifiable in the latest versions of glibc.

Regards,
Cosmin

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 view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/CADHp1NzXwhhZ15_RdsDKU_tpVxKr3Ja1ToL6q4VmSYwYiT_KZw%40mail.gmail.com.

Stoica Cosmin

unread,
Apr 21, 2020, 11:14:09 AM4/21/20
to matt...@gmail.com, ns-3-...@googlegroups.com
Hello,

I have noticed that the libc error is caused by this vtable_check when dce_fdopen is called. Please find below called function stacktrace:

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff4136801 in __GI_abort () at abort.c:79
#2  0x00007ffff417f5e5 in __libc_message (action=(do_abort | do_backtrace), fmt=0x7ffff42ac796 "%s", fmt=0x7ffff42ac796 "%s", action=(do_abort | do_backtrace))
    at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff417f92a in __GI___libc_fatal (message=message@entry=0x7ffff42ae3b8 "Fatal error: glibc detected an invalid stdio handle\n")
    at ../sysdeps/posix/libc_fatal.c:191
#4  0x00007ffff41801d7 in _IO_vtable_check () at vtables.c:72
#5  0x00007ffff4176cb1 in IO_validate_vtable (vtable=0x7ffff7dd1da0 <dce_fdopen::vtable>) at ../libio/libioP.h:876
#6  _IO_seekoff_unlocked (fp=0x55555581ee50, offset=-1, dir=<optimized out>, mode=<optimized out>) at ioseekoff.c:59
#7  0x00007ffff417dcd9 in __GI_fseek (fp=0x55555581ee50, offset=<optimized out>, whence=<optimized out>) at fseek.c:36
#8  0x00007ffff7a811fb in dce_fseek (stream=0x55555581ee50, offset=-1, whence=0) at ../model/dce-stdio.cc:580

#9  0x00007ffff7a7c9bf in dce_fdopen (fildes=0, mode=0x7ffff7b58d7d "r") at ../model/dce-stdio.cc:208
#10 0x00007ffff7aa0009 in dce_global_variables_setup (variables=0x7ffff374ab70) at ../model/dce-global-variables.cc:22
#11 0x00007ffff2d71793 in setup_global_variables () at ../model/libc-setup.cc:37
#12 0x00007ffff2d716e2 in libc_setup (fn=0x555555925cd0) at ../model/libc.cc:225
#13 0x00007ffff7a1b599 in ns3::DceManager::LoadMain (ld=0x55555582fd50, filename="/work/git/dce_dev_alex/bake/build/sbin/ip", proc=0x55555583b4c0,
    err=@0x7ffff374acf4: 0) at ../model/dce-manager.cc:1227
#14 0x00007ffff7a149a1 in ns3::DceManager::PrepareDoStartProcess (current=0x55555583c020) at ../model/dce-manager.cc:267
#15 0x00007ffff7a14ebe in ns3::DceManager::DoStartProcess (context=0x55555583c020) at ../model/dce-manager.cc:292
#16 0x00007ffff7aae030 in ns3::TaskManager::Trampoline (context=0x5555558269e0) at ../model/task-manager.cc:275
#17 0x00007ffff7aa715b in ns3::UcontextFiberManager::Trampoline (a0=32767, a1=-139796500, a2=21845, a3=1434610144) at ../model/ucontext-fiber-manager.cc:199
#18 0x00007ffff414e6b0 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#19 0x0000000000000000 in ?? () 

Has somebody managed to bypass somehow VTABLE checking ?

Thank you in advance for help!

Best regards,
Cosmin

Stoica Cosmin

unread,
Apr 28, 2020, 4:24:35 PM4/28/20
to matt...@gmail.com, ns-3-...@googlegroups.com
Hello,

The issue seems to disappear on my side after I have applied  this fix https://github.com/teto/ns-3-dce/commit/5230dcb68b5cc96513b6c69677b26578457acac6 proposed by teto. Unfortunately, I don't know how reliable those modifications are, so I will continue the experiments on Ubuntu 16.04.

Is anybody who knows why those fixes were not merged?

Best regards,
Cosmin
Reply all
Reply to author
Forward
0 new messages