cout causes SIGSEGV

394 views
Skip to first unread message

Trish Deutsch

unread,
Sep 16, 2014, 1:20:39 PM9/16/14
to ns-3-...@googlegroups.com
I am running external source code using DCE. There are some cout statements in the main of this external code that cause SIGSEGV. Running under gdb shows that the segmentation fault occurs at:
in std::ostream::sentry::sentry(std::ostream&) () from elf-cache/0/libstdc++.so.6

My understanding of this error (which could of course be wrong) is that this error is due to the cout not being constructed/initialized when the call is made. The code works correctly when run outside of DCE (i.e., no seg fault except when run in NS3 using DCE).
Why would cout not yet be constructed/init'd? Is there something in my NS3 code that I need to do in my code when running DCE in order to support cout? 

Thanks!
Trish

Hajime Tazaki

unread,
Sep 21, 2014, 10:11:34 AM9/21/14
to ns-3-...@googlegroups.com

hi,

do you mind if you shared the code to reproduce your issue ?

in a test case of dce, it successfully uses cout with a
simple code though.

http://code.nsnam.org/ns-3-dce/file/cf2dc191b558/test/test-name.cc

-- Hajime

At Tue, 16 Sep 2014 10:20:39 -0700 (PDT),
Trish Deutsch wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]

Trish Deutsch

unread,
Sep 22, 2014, 2:24:15 PM9/22/14
to ns-3-...@googlegroups.com
Hajime,

I would have to put together some sample code as I can not release the actual code. Please give me a few days to get to this.

Thanks
Trish

babupol

unread,
Jan 25, 2016, 2:59:52 PM1/25/16
to ns-3-users
Hello Trish, Hajime,
   I am having the same issue. Can you let me know if any changes helped for you? I appreciate your help with this. 

Thank you,
Babu

Trish Deutsch

unread,
Mar 27, 2019, 4:55:50 PM3/27/19
to ns-3-users
I know this is several years old but re-posting because this issue continues to pop up.  cout causes segfault and replacing is with printf works.
Are there any updates to perhaps a possible issue with ostream?
Reply all
Reply to author
Forward
0 new messages