# DRb freezes YARV?

**URL:** <https://www.ruby-forum.com/t/drb-freezes-yarv/88076>\
**Category:** Ruby\
**Created:** [March 7, 2007, 10:49pm UTC](https://www.ruby-forum.com/t/drb-freezes-yarv/88076 "2007-03-07T22:49:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meinrad\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecae2f/32.png) [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Post date:** [March 7, 2007, 10:49pm UTC](https://www.ruby-forum.com/t/drb-freezes-yarv/88076/1 "2007-03-07T22:49:12Z")

</div>

dear all,

Has anyone tried out drb on latest ruby1.9 including VM? Well, I tried  
out drb and found that DRb#start\_service won’t return on YARV as it  
does on Ruby1.8. It is so strange that I can not find a reasonable  
explanation for the behaviour.

Let me explain what I found out by (manually) tracing the threads of  
execution in drb:

The main thread enters DRbServer#initialize and enters DRbServer#run.  
In run a new thread (the main\_loop of the DRBServer) is startet that  
runs concurrently until it blocks in Socket#accept. The strange thing  
is, that exactly after the main\_loop thread begins to block the main  
thread won’t run any further! Right before the end of  
DRbServer#initialize it stops and does not jump out though there is  
nothing left to do.

Next thing I tried is replacing the Socket#accept by something else. I  
replaced it by a sleep( 5). With this the main thread is able to jump  
out of DRbServer#initialize … suggesting that the bug lies in  
Socket#accept. However I made up a simple test script with a socket  
and put the line socket.accept in a thread. This test script runs as  
it should on both yarv and on 1.8.5 without blocking the main thread.

I’m sorry, that I was not yet able to reproduce the freeze in a  
minimal test script.

I’d say it smells like a deadlock but I am definitely not a threading  
expert and I don’t know much about Sockets and the internals of YARV  
so I leave the interpretation of the facts to the experts among you.

cheers,  
– henon

---

<div class="post-metadata">

**Author:** ![Meinrad\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecae2f/32.png) [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Post date:** [March 8, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/drb-freezes-yarv/88076/2 "2007-03-08T13:21:49Z")

</div>

dear all,

(This post did not get any replies at ruby-talk so maybe it is better  
posted here.)

Has anyone tried out drb on latest ruby1.9 including VM? Well, I tried  
out drb and found that DRb#start\_service won’t return on YARV as it  
does on Ruby1.8. It is so strange that I can not find a reasonable  
explanation for the behaviour.

Let me explain what I found out by (manually) tracing the threads of  
execution in drb:

The main thread enters DRbServer#initialize and enters DRbServer#run.  
In run a new thread (the main\_loop of the DRBServer) is startet that  
runs concurrently until it blocks in Socket#accept. The strange thing  
is, that exactly after the main\_loop thread begins to block the main  
thread won’t run any further! Right before the end of  
DRbServer#initialize it stops and does not jump out though there is  
nothing left to do.

Next thing I tried is replacing the Socket#accept by something else. I  
replaced it by a sleep( 5). With this the main thread is able to jump  
out of DRbServer#initialize … suggesting that the bug lies in  
Socket#accept. However I made up a simple test script with a socket  
and put the line socket.accept in a thread. This test script runs as  
it should on both yarv and on 1.8.5 without blocking the main thread.

I’m sorry, that I was not yet able to reproduce the freeze in a  
minimal test script.

I’d say it smells like a deadlock but I am definitely not a threading  
expert and I don’t know much about Sockets and the internals of YARV  
so I leave the interpretation of the facts to the experts among you,  
while I look into it a bit more … but any hints what might be the  
issue would help me very much!

cheers,  
– henon

---

<div class="post-metadata">

**Author:** ![Meinrad\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecae2f/32.png) [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Post date:** [March 12, 2007, 6:39pm UTC](https://www.ruby-forum.com/t/drb-freezes-yarv/88076/3 "2007-03-12T18:39:17Z")

</div>

shall i file a bug on rubyforge? why is there no reply of any kind? is  
this not the right place to post? I feel a bit ignored …

regards,  
–henon

---

<div class="post-metadata">

**Author:** ![Meinrad\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecae2f/32.png) [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Post date:** [March 12, 2007, 7:09pm UTC](https://www.ruby-forum.com/t/drb-freezes-yarv/88076/4 "2007-03-12T19:09:24Z")

</div>

Hi,

In message “Re: DRb freezes YARV?”  
on Tue, 13 Mar 2007 02:38:09 +0900, “Meinrad R.”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|shall i file a bug on rubyforge? why is there no reply of any kind? is  
|this not the right place to post? I feel a bit ignored …

I’m sorry, we saw the report. I think it would take bit longer to  
identify and fix the problem.

```
          matz.

```
