[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Curious error from Rake

Daniel Berger

4/7/2007 6:16:00 AM

Hi,

Ruby 1.8.6

I accidentally made a rake task a prerequisite of itself like so:

task :foo => [:foo] do
puts "hello"
end

And I got this output:

stopping only thread
note: use sleep to stop forever

No complaints really. Just thought it was an odd error, and I got zero
hits when I searched the ruby-talk archives. Anyone have an
explanation?

Regards,

Dan


2 Answers

Leslie Viljoen

4/9/2007 9:16:00 AM

0

On 4/7/07, Daniel Berger <djberg96@gmail.com> wrote:
> Hi,
>
> Ruby 1.8.6
>
> I accidentally made a rake task a prerequisite of itself like so:
>
> task :foo => [:foo] do
> puts "hello"
> end
>
> And I got this output:
>
> stopping only thread
> note: use sleep to stop forever

Maybe an infinite loop causing a stack overflow?

Christian Neukirchen

4/9/2007 1:07:00 PM

0

"Daniel Berger" <djberg96@gmail.com> writes:

> Hi,
>
> Ruby 1.8.6
>
> I accidentally made a rake task a prerequisite of itself like so:
>
> task :foo => [:foo] do
> puts "hello"
> end
>
> And I got this output:
>
> stopping only thread
> note: use sleep to stop forever
>
> No complaints really. Just thought it was an odd error, and I got zero
> hits when I searched the ruby-talk archives. Anyone have an
> explanation?

2#878<p5>lilith:~/mess/current$ ruby -e 'Thread.stop'
-e:1:in `stop': stopping only thread (ThreadError)
note: use sleep to stop forever from -e:1

rake.rb:
def invoke
@lock.synchronize do
...
end
end

In short, you dead-locked the Rack mutex.

> Regards,
>
> Dan
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneuk...