# Thread deadlock issue

**URL:** <https://www.ruby-forum.com/t/thread-deadlock-issue/75947>\
**Category:** Ruby\
**Created:** [November 14, 2006, 5:36pm UTC](https://www.ruby-forum.com/t/thread-deadlock-issue/75947 "2006-11-14T17:36:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 14, 2006, 5:36pm UTC](https://www.ruby-forum.com/t/thread-deadlock-issue/75947/1 "2006-11-14T17:36:59Z")

</div>

can anyone interpret this

deadlock 0xb7d8ff3c: sleep:T(1000000000000000019884624838656.000000) -  
/usr/local/ruby-1.8.4/lib/ruby/site\_ruby/slave.rb:306  
deadlock 0xb7d90888: sleep:F(4) -  
/usr/local/ruby-1.8.4/lib/ruby/site\_ruby/drb/unix.rb:87  
deadlock 0xb7d8fe9c: sleep:S -  
/usr/local/ruby-1.8.4/lib/ruby/site\_ruby/drb/drb.rb:127  
^^  
^^  
^^  
^^  
the bit in question

??

-a

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 14, 2006, 6:03pm UTC](https://www.ruby-forum.com/t/thread-deadlock-issue/75947/2 "2006-11-14T18:03:06Z")

</div>

I am interesting in this. Would you provide us your abridged program  
codes  
that can reproduce the deadlock issue? Then we could have an insight  
into  
it.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 14, 2006, 9:01pm UTC](https://www.ruby-forum.com/t/thread-deadlock-issue/75947/3 "2006-11-14T21:01:56Z")

</div>

On Nov 14, 2006, at 8:35 AM, removed\_email\_address@domain.invalid wrote:

> ```
> ^^
> ^^
> ^^
> the bit in question
> 
> ```

```
FOREACH_THREAD_FROM(curr, th) {
    warn_printf("deadlock 0x%lx: %s:",
		th->thread, thread_status_name(th->status));
    if (th->wait_for & WAIT_FD) warn_printf("F(%d)", th->fd);
    if (th->wait_for & WAIT_SELECT) warn_printf("S");
    if (th->wait_for & WAIT_TIME) warn_printf("T(%f)", th->delay);
    if (th->wait_for & WAIT_JOIN)
	warn_printf("J(0x%lx)", th->join ? th->join->thread : 0);
    if (th->wait_for & WAIT_PID) warn_printf("P");
    if (!th->wait_for) warn_printf("-");
    warn_printf(" %s - %s:%d\n",
		th==main_thread ? "(main)" : "",
		th->node->nd_file, nd_line(th->node));
}

```

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 14, 2006, 11:02pm UTC](https://www.ruby-forum.com/t/thread-deadlock-issue/75947/4 "2006-11-14T23:02:14Z")

</div>

On Wed, 15 Nov 2006, Eric H. wrote:

> > site\_ruby/drb/drb.rb:127  
> > if (th-\>wait\_for & WAIT\_SELECT) warn\_printf(“S”);  
> > if (th-\>wait\_for & WAIT\_TIME) warn\_printf(“T(%f)”, th-\>delay);  
> > if (th-\>wait\_for & WAIT\_JOIN)  
> > warn\_printf(“J(0x%lx)”, th-\>join ? th-\>join-\>thread : 0);  
> > if (th-\>wait\_for & WAIT\_PID) warn\_printf(“P”);  
> > if (!th-\>wait\_for) warn\_printf("-");  
> > warn\_printf(" %s - %s:%d\n",  
> > th==main\_thread ? “(main)” : “”,  
> > th-\>node-\>nd\_file, nd\_line(th-\>node));  
> > }

so, this seems like a bug. the thread in T state has made a call to  
‘sleep’ -  
if that thread is sleeping, and the other two are blocked on io/select,  
why  
wouldn’t it simply continue to sleep?

regards.

-a
