[ndnSIM] SIGSEGV when simply assigning one smart pointer to another?

Ashlesh Gawande (agawande) agawande at memphis.edu
Tue Apr 11 05:26:59 PDT 2017


So after gdb is done you need to put bt to get the backtrace:

Program received signal SIGSEGV, Segmentation fault.
std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x2710)
    at /usr/include/c++/5/bits/shared_ptr_base.h:147
147        if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
(gdb) bt


Ashlesh

________________________________
From: John Baugh <jpbaugh at umich.edu>
Sent: Monday, April 10, 2017 11:13:19 PM
To: Spyridon (Spyros) Mastorakis
Cc: Ashlesh Gawande (agawande); ndnsim
Subject: Re: [ndnSIM] SIGSEGV when simply assigning one smart pointer to another?

This seems to imply a thread resource contention of some sort...  but I'm hoping there is a resolution to this?

And what is causing the issue?  That would be the question.

On Tue, Apr 11, 2017 at 12:05 AM, John Baugh <jpbaugh at umich.edu<mailto:jpbaugh at umich.edu>> wrote:
Ashlesh, Spyridon, and ndnSIM friends,

As requested, the gdb output:

jpbaugh at Janeway:~/ndnSIM/my-simulations$ gdb --args ./build/jpb-pop1
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/jpb-pop1...done.
(gdb) run
Starting program: /home/jpbaugh/ndnSIM/my-simulations/build/jpb-pop1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Inside ctor for PStrat
Inside ctor for PStrat
Inside ctor for PStrat
Inside ctor for PStrat
In jpb-pop1 main: 0x7fffffffd6a0
About to get forwarder
Just got forwarder.  About to get strategy choice
Just got strategy choice, about to get effectiveStrategy
Just got effective strategy, about to set popularity manager for it.
About to set Popularity Manager inside PStrat
Before assignment line

Program received signal SIGSEGV, Segmentation fault.
std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x2710)
    at /usr/include/c++/5/bits/shared_ptr_base.h:147
147        if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
(gdb)




Thanks,

John

On Mon, Apr 10, 2017 at 8:53 PM, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu<mailto:mastorakis at cs.ucla.edu>> wrote:
Hi John,

as Ashlesh mentioned, please post a gdb backtrace, so that we can take a look.

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
Computer Science Department
UCLA

On Apr 10, 2017, at 1:20 PM, Ashlesh Gawande (agawande) <agawande at memphis.edu<mailto:agawande at memphis.edu>> wrote:

Perhaps you can post the gdb backtrace so that other people can take a look.

Ashlesh
________________________________
From: ndnSIM <ndnsim-bounces at lists.cs.ucla.edu<mailto:ndnsim-bounces at lists.cs.ucla.edu>> on behalf of John Baugh <jpbaugh at umich.edu<mailto:jpbaugh at umich.edu>>
Sent: Monday, April 10, 2017 2:55:10 PM
To: ndnsim
Subject: Re: [ndnSIM] SIGSEGV when simply assigning one smart pointer to another?

I think maybe I'm mailing the list when no one is awake :)

If anyone has any ideas, I'd be very interested in hearing them.  This is a true Heisenbug

On Apr 9, 2017 11:36 PM, "John Baugh" <jpbaugh at umich.edu<mailto:jpbaugh at umich.edu>> wrote:
Greetings all,

I posted this question before but received no responses, so I figured I'd give it another shot.

I've updated my Github repository with the updated code:
profjpbaugh/ndnSIM-strategy1

The scenario in question is jpb-pop1.  The offending code seems to be when I pass my PopularityManager object to a set method, and then do the actual assignment.  I created the PopularityManager as an adapter object (and go-between) between the PStrat (strategy) and the PopularityPolicy (policy).

In order to establish my definition of "popularity", I require the interest information (which PStrat has), and to control caching / replacement ultimately (which is in PopularityPolicy), I need this information about interests.

I am able to print (using cout) just before the assignment occurs, but it seems the segfault happens right then.

I used GDB and it does indeed say there's a SIGSEGV, but I cannot for the life of me figure out why this is happening.  It happens if I try to set the data member (popularityManager) to anything.

So I don't think it's the parameter (or argument) being passed in.

Any assistance would be appreciated.  This may be some peculiar smart pointer issue, but I'm not sure.


Thanks,

John




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170411/2cc88a28/attachment-0001.html>


More information about the ndnSIM mailing list