From: Bill Kelly <billk@...>
Date: 2010-07-21T21:41:45+09:00
Subject: [ruby-core:31403] Re: [Bug #3523][Assigned] win32 exception c0000029 on exit using fibers

Hi,

U.Nakamura wrote:
> 
> But I've found a workaround for you, Bill.
> 
> In definition of ZZZZ::PROTO::RPCMessageDispatcher#rpc_connection_unbind,
> you should use
>     @msg_portmap[MSGPORT_ROOT].call(true, :rpc_unbind)
> instead of
>     rpc_dispatch(MSGPORT_ROOT, MSGPORT_ROOT, :rpc_unbind)
> .

Interesting.

Do we know why it is unsafe to use run_in_fiber specifically during the
unbind callback?

Note that test_em_fiber4f.rb represents an extremely simplified version
of the system, and that normally rpc_dispatch is also frequently called
from another EventMachine callback: receive_data.

So I am wondering if we have a reason to believe that it is *only* the
unbind callback that is unsafe?  And if we should expect the
receive_data callback to be safe for run_in_fiber, unlike unbind?

(Unfortunately, unlike c0000029, I'm not yet able to reproduce the
current memory corruption crash when running tests that exercise the
real system.  So I don't know if this change in test_em_fiber4f.rb
makes a difference in the real system or not, since I can't get the
real system to crash either way, yet.)


Thanks,

Bill