From: James Edward Gray II Date: 2005-11-17T00:22:33+09:00 Subject: Re: DRb Crashing On Nov 15, 2005, at 6:50 PM, Hugh Sasse wrote: > On Wed, 16 Nov 2005, James Edward Gray II wrote: > > >> If I launch this server: >> > [...] > >> __END__ >> >> Then run this client: >> >> #!/usr/local/bin/ruby -w >> >> require "drb" >> require "rinda/tuplespace" >> >> DRb.start_service >> tuplespace = Rinda::TupleSpaceProxy.new( >> DRbObject.new_with_uri("druby://localhost:61676") >> ) >> >> while problem = tuplespace.take(["Problem", %r{^\d+(?: [-+*/] \d+)+ >> $}]) >> tuplespace.write(["Result", "#{problem.last} = #{eval >> problem.last}"]) >> end >> >> __END__ >> >> The client crashes, generally within a few seconds. Adding a >> sleep inside the >> server loop seems to resolve the issue. >> >> Anyone know why? >> > > No, I don't. What happens if you match the old way? Like: > while problem = tuplespace.take(["Problem", nil]) The Regexp is pretty critical in this case. It validates the data before an otherwise dangerous call to eval(). James Edward Gray II