# Curious error from Rake

**URL:** <https://www.ruby-forum.com/t/curious-error-from-rake/91353>\
**Category:** Ruby\
**Created:** [April 7, 2007, 8:16am UTC](https://www.ruby-forum.com/t/curious-error-from-rake/91353 "2007-04-07T08:16:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [April 7, 2007, 8:16am UTC](https://www.ruby-forum.com/t/curious-error-from-rake/91353/1 "2007-04-07T08:16:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [April 9, 2007, 11:17am UTC](https://www.ruby-forum.com/t/curious-error-from-rake/91353/2 "2007-04-09T11:17:20Z")

</div>

On 4/7/07, Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> And I got this output:
> 
> stopping only thread  
> note: use sleep to stop forever

Maybe an infinite loop causing a stack overflow?

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [April 9, 2007, 3:07pm UTC](https://www.ruby-forum.com/t/curious-error-from-rake/91353/3 "2007-04-09T15:07:48Z")

</div>

“Daniel B.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> 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#878lilith:~/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.
