DRb freezes YARV?

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

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

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

Hi,

In message “Re: DRb freezes YARV?”
on Tue, 13 Mar 2007 02:38:09 +0900, “Meinrad R.”
[email protected] 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.