Segmentation faults on 64-bit Fedora

19 views
Skip to first unread message

Stjepan Gros

unread,
Sep 20, 2009, 6:21:32 AM9/20/09
to omn...@googlegroups.com, sg...@zemris.fer.hr
Hi!

While trying to create some simulation models I stumbled upon some
segmentation faults (the gdb backtrace of one of them is at the end of
the mail). While trying to figure out what's happening I stumbled on
this post:

http://www.bailopan.net/blog/?p=30

which seems to be the problem in this case, and probably the global
problem in the code?

Stjepan

(gdb) bt
#0 0x000000303b4489d7 in vfprintf () from /lib64/libc.so.6
#1 0x000000303b46f232 in vsnprintf () from /lib64/libc.so.6
#2 0x00007fdcdb190246 in Tkenv::componentMethodBegin (this=0x1c16ee0,
fromComp=0x36e3fb0, toComp=0x36e2d80, methodFmt=0x7fdcd9c83450
"fireChangeNotification(%s, %s)", va=0x7fff9f655e60) at tkenv.cc:1292
#3 0x00007fdcda73b2f4 in cMethodCallContextSwitcher::methodCall
(this=0x7fff9f655f90, methodFmt=0x7fdcd9c83450
"fireChangeNotification(%s, %s)") at util.cc:376
#4 0x00007fdcd995886a in NotificationBoard::fireChangeNotification
(this=0x36e2d80, category=4, details=0x36e4110) at
base/NotificationBoard.cc:99
#5 0x00007fdcd99af322 in AbstractRadio::setRadioState
(this=0x36e3fb0, newState=RadioState::TRANSMIT) at
linklayer/radio/AbstractRadio.cc:638
#6 0x00007fdcd99ada74 in AbstractRadio::handleUpperMsg
(this=0x36e3fb0, airframe=0x38207c0) at
linklayer/radio/AbstractRadio.cc:271
#7 0x00007fdcd99ad2d8 in AbstractRadio::handleMessage
(this=0x36e3fb0, msg=0x3820000) at
linklayer/radio/AbstractRadio.cc:147
#8 0x00007fdcda7139f9 in cSimulation::doOneEvent (this=0x1c17300,
mod=0x36e3fb0) at csimulation.cc:627
#9 0x00007fdcdb18c5bb in Tkenv::doRunSimulation (this=0x1c16ee0) at
tkenv.cc:529
#10 0x00007fdcdb18c0ce in Tkenv::runSimulation (this=0x1c16ee0,
mode=1, until_time= {t = 0, static scaleexp = -12, static dscale =
1000000000000, static fscale = 1000000000000, static invfscale =
9.9999999999999998e-13, static SCALEEXP_S = <optimized out>, static
SCALEEXP_MS = <optimized out>, static SCALEEXP_US = <optimized out>,
static SCALEEXP_NS = <optimized out>, static SCALEEXP_PS = <optimized
out>, static SCALEEXP_FS = <optimized out>, static
SCALEEXP_UNINITIALIZED = -1}, until_eventnum=0, until_msg=0x0,
until_module=0x0) at tkenv.cc:402
#11 0x00007fdcdb198672 in run_cmd (interp=0x1f9e670, argc=2,
argv=0x1fa0ba0) at tkcmd.cc:430
#12 0x000000303cc2f11f in TclInvokeStringCommand () from /usr/lib64/libtcl8.5.so
#13 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#14 0x000000303cc77d3c in ?? () from /usr/lib64/libtcl8.5.so
#15 0x000000303cc7f1e9 in ?? () from /usr/lib64/libtcl8.5.so
#16 0x000000303cc31266 in TclEvalObjEx () from /usr/lib64/libtcl8.5.so
#17 0x000000303cc42744 in ?? () from /usr/lib64/libtcl8.5.so
#18 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#19 0x000000303cc77d3c in ?? () from /usr/lib64/libtcl8.5.so
#20 0x000000303ccb8ad0 in TclObjInterpProcCore () from /usr/lib64/libtcl8.5.so
#21 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#22 0x000000303cc77d3c in ?? () from /usr/lib64/libtcl8.5.so
#23 0x000000303ccb8ad0 in TclObjInterpProcCore () from /usr/lib64/libtcl8.5.so
#24 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#25 0x000000303cc77d3c in ?? () from /usr/lib64/libtcl8.5.so
#26 0x000000303cc7f1e9 in ?? () from /usr/lib64/libtcl8.5.so
#27 0x000000303cc31266 in TclEvalObjEx () from /usr/lib64/libtcl8.5.so
#28 0x000000303c062c96 in ?? () from /usr/lib64/libtk8.5.so
#29 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#30 0x000000303cc30ff3 in Tcl_EvalObjv () from /usr/lib64/libtcl8.5.so
#31 0x000000303cc313c8 in TclEvalObjEx () from /usr/lib64/libtcl8.5.so
#32 0x000000303ccb94df in ?? () from /usr/lib64/libtcl8.5.so
#33 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#34 0x000000303cc77d3c in ?? () from /usr/lib64/libtcl8.5.so
#35 0x000000303ccb8ad0 in TclObjInterpProcCore () from /usr/lib64/libtcl8.5.so
#36 0x000000303cc300c1 in ?? () from /usr/lib64/libtcl8.5.so
#37 0x000000303cc306bf in ?? () from /usr/lib64/libtcl8.5.so
#38 0x000000303c0369e0 in Tk_BindEvent () from /usr/lib64/libtk8.5.so
#39 0x000000303c03cff5 in TkBindEventProc () from /usr/lib64/libtk8.5.so
#40 0x000000303c044090 in Tk_HandleEvent () from /usr/lib64/libtk8.5.so
#41 0x000000303c0442c8 in ?? () from /usr/lib64/libtk8.5.so
#42 0x000000303cca9a07 in Tcl_ServiceEvent () from /usr/lib64/libtcl8.5.so
#43 0x000000303cca9cdf in Tcl_DoOneEvent () from /usr/lib64/libtcl8.5.so
#44 0x00007fdcdb1a3b83 in runTk () at tklib.cc:111
#45 0x00007fdcdb18b8ec in Tkenv::run (this=0x1c16ee0) at tkenv.cc:263
#46 0x00007fdcdaeeafa6 in EnvirBase::run (this=0x1c16ee0, argc=5,
argv=0x7fff9f6585f8, configobject=0x1bb5ae0) at envirbase.cc:230
#47 0x00007fdcdaee79b5 in setupUserInterface (argc=5,
argv=0x7fff9f6585f8, cfg=0x0) at startup.cc:234
#48 0x00007fdcdaee89a8 in main (argc=5, argv=0x7fff9f6585f8) at main.cc:39
#49 0x000000303b41ea2d in __libc_start_main () from /lib64/libc.so.6
#50 0x0000000000400689 in _start ()

Stjepan Gros

unread,
Sep 21, 2009, 7:19:59 AM9/21/09
to omn...@googlegroups.com, sg...@zemris.fer.hr
Ok, I managed to trace this one and correct it. The problem is in the
Tkenv::componentMethodBegin method (src/tkenv/tkenv.cc in OMNeT++
distribution). At the beginning of the function there is a call to a
method EnvirBase::componentMethodBegin which also takes va argument
but messes it up (for details see the link I sent in the previous
mail) and that argument is then given to the function vsnprintf that
segfaults. The solution is to change the call of the first method
EnvirBase::componentMethodBegin as follows:

va_list vc;
va_copy(vc, va);
EnvirBase::componentMethodBegin(fromComp, toComp, methodFmt, vc);
va_end(vc);

Now I'm stucked with another error. DAD in IPv6 fails with duplicate
address found, but I checked the model and there shouldn't be any
duplicates. Did anyone got this error too?

And while I'm asking questions, I'll ask one more. Now and then it
happens that the simulation stops with an error that radioIn of an
AccessPoint isn't connected. This error occurs, e.g. when I try to
create INI file from scratch. But when I c/p ini file from mobileipv6
example (with appropriate, but simple, modifications), everything
works?

I'm using xMIPv6 from git repository.

Stjepan

P.S. If necessary I can send ini and ned files.

Rudolf Hornig

unread,
Sep 21, 2009, 10:55:55 AM9/21/09
to omn...@googlegroups.com
Thansks for the detailed error report. I have created a bug entry for this in the omnetpp bugtracker.

http://dev.omnetpp.org/bugs/view.php?id=107

Rudolf

Stjepan Gros

unread,
Sep 21, 2009, 11:28:54 AM9/21/09
to omn...@googlegroups.com
I also had problems compiling omnet-4.0 using GCC 4.4 (missing stdio.h
includes). Attached is a patch that fixes that.

S

On Mon, Sep 21, 2009 at 4:55 PM, Rudolf Hornig <rudolf...@gmail.com> wrote:
> Thansks for the detailed error report. I have created a bug entry for this
> in the omnetpp bugtracker.
>
> http://dev.omnetpp.org/bugs/view.php?id=107
>
> Rudolf
>
omnetpp-4.0-fedora11.patch

Rudolf Hornig

unread,
Sep 21, 2009, 12:53:06 PM9/21/09
to omn...@googlegroups.com
Thanks, we knew about that. We will bundele mingw4.4 with omnetpp 4.1 so this will be handy...

I will apply this to the master branch...

Rudolf

On Mon, Sep 21, 2009 at 5:28 PM, Stjepan Gros <sgros.ml@gmail.com> wrote:
I also had problems compiling omnet-4.0 using GCC 4.4 (missing stdio.h
includes). Attached is a patch that fixes that.

S

On Mon, Sep 21, 2009 at 4:55 PM, Rudolf Hornig <rudolf...@gmail.com> wrote:
> Thansks for the detailed error report. I have created a bug entry for this
> in the omnetpp bugtracker.
>
> http://dev.omnetpp.org/bugs/view.php?id=107
>
> Rudolf
>
Reply all
Reply to author
Forward
0 new messages