Subject: Re: [dtn-users] Problem DTN2 daemon

From: Nik Ansell <[email-masked]>
Date: Mon, 4 Jan 2016 09:03:19 +0400

Hi Kevin,

I am pretty new to DTN2, so not really the best person to give advice.
However, I did come across a similar spin lock error during my recent
testing.
In my case, the spin lock error was a symptom of an unrelated problem i.e a
red herring, I ended up fixing my problem by updating my configs.
This view is also shared by the N4C project, who hid the spin lock error by
changing the log level to INFO/NOTICE.

http://www.n4c.eu/Download/8.4/n4c-wp8-006-M8.5-summer_test_2010_Slovenia_V06.pdf

Good luck fixing your problem.

Kind Regards,
Nik

On Thu, Dec 31, 2015 at 12:17 PM, kevin prima <[email-masked]>
wrote:

> Dear all,
>
> I want to run 5 DTN node in 2 hop topology scenario with DTLSR routing,
> source and destination node connected with dtn node 1,2,and 3 but couldn't
> reach each other.
> When I try to send ping packet use dtnping, sometimes it show error like
> this in node 1, node 2, and node 3:
>
> warning: Bundle::del_ref is waiting for spin lock held by (null), which
> has reached spin limit
> STACK TRACE: 0x76f51c84 0x3eda8 0x3ed00 0x59444
>
> The impact is node 1, 2 or 3 become unavailable. What should I do to fix
> this problem ?
>
> Thanks,
> Kevin
>
> _______________________________________________
> dtn-users mailing list
> [email-masked]
> https://www.irtf.org/mailman/listinfo/dtn-users
>
>

---

From: Nik Ansell <[email-masked]>
Date: Wed, 27 Jan 2016 19:41:25 +0400

Hi Kevin,

I have been doing some digging and managed to find a fix which works on my
tested.
Assuming your configuration files are correct, you may want to try my fix
and see how you get on, you can always back-out the change if you back up
the original files.

My fix has been posted to the dtn-users forum, in response to my post on
frequent spinlock errors, but I have copied the fixes into the email below
FYI.
After making the changes, simply re-run make && make install from the oasys
directory.

1. Add the following code to the start of the function, to allow locking or
unlocking when lock_holder_name_ is NULL.

Lock.h -> is_locked_by_me():

    bool is_locked_by_me()
    {

        if (lock_holder_name_ == NULL) {
         return is_locked() && true;
        }

2. Add the following 11,000 microsecond pause, if the thread is waiting to
acquire a lock:

SpinLock.cc -> SpinLock::lock():

    while (atomic_cmpxchg32(&lock_count_, 0, 1) != 0)
    {
        Thread::spin_yield();
        // 0.011 sec sleep
        usleep(11000);

Kind Regards,
Nik