[Nfd-dev] How to send command interests from NFD to NLSR?

Nick Gordon nmgordon at memphis.edu
Tue Feb 21 23:31:51 PST 2017


I have solved the problem. The issue was that I was default-constructing the shared_ptr to nullptr. This would normally be okay, except that
to assign to a ScopedEventId, it compares the EventId members. To do this, it compares their EventInfo's, which are kept as weak_ptrs. If
all of this stuff is not default-constructed, it is in an invalid state. I fixed this by changing

std::shared_ptr<scheduler::ScopedEventId> m_retryEventId = nullptr;

to

std::shared_ptr<scheduler::ScopedEventId> m_retryEventId = std::make_shared<scheduler::ScopedEventId>();

This wasn't caught at the unit test level because of a gap in coverage; I have no unit tests that test for scheduled retries of
advertise/withdraw events.

Anyway, thank you Junxiao for suggesting to get the backtrace from gdb. I definitely couldn't have solved this without that.

-Nick

On 02/21/2017 10:47 PM, Nick Gordon wrote:
> Since I don't think this change is on gerrit, m_retryEventId is a shared_ptr<scheduler::ScopedEventId>. It was necessary to do this in order
> to make ReadvertisedRoutes copyable for the RouteContainer.
> 
> -Nick
> 
> On 02/21/2017 10:41 PM, Nick Gordon wrote:
>> Junxiao,
>>
>> I can only post the top #13 calls, because if I ask for more, it loops infinitely for some reason in gdb. However, I have those, and the
>> problem is in this code:
>>
>> void
>> ReadvertisedRoute::scheduleRetryEvent(RetryState state, time::milliseconds delay,
>>                                       std::function<void()> command)
>> {
>>   BOOST_ASSERT(state != RetryState::NONE);
>>   if (m_retryState == RetryState::NONE || m_retryState != state) {
>>     m_retryState = state;
>>     *m_retryEventId = scheduler::schedule(delay, command); <-- line 72
>>   }
>> }
>>
>> The backtrace is attached.
>>
>> -Nick
>>
>> On 02/21/2017 06:57 PM, Junxiao Shi wrote:
>>> Hi Nick
>>>
>>> Can you include gdb 'bt full' logs, for crashes?
>>> See http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2016-May/001748.html
>>>
>>> On Feb 21, 2017 3:33 PM, "Nick Gordon" <nmgordon at memphis.edu <mailto:nmgordon at memphis.edu>> wrote:
>>>
>>>     NFD on that router crashes.
>>>
> _______________________________________________
> Nfd-dev mailing list
> Nfd-dev at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
> 


More information about the Nfd-dev mailing list