# Bug in IRB

**URL:** <https://www.ruby-forum.com/t/bug-in-irb/146838>\
**Category:** Ruby\
**Created:** [August 26, 2008, 4:54am UTC](https://www.ruby-forum.com/t/bug-in-irb/146838 "2008-08-26T04:54:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![crazyhat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@crazyhat](https://www.ruby-forum.com/u/crazyhat)\
**Post date:** [August 26, 2008, 4:54am UTC](https://www.ruby-forum.com/t/bug-in-irb/146838/1 "2008-08-26T04:54:37Z")

</div>

Running ruby version ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]  
with Rails 1.2.3, getting the following error trying to create one of my  
app objects from the console:  
Errno::ENOMEM: Not enough space  
from c:/ruby/lib/ruby/1.8/irb.rb:298:in `write' from c:/ruby/lib/ruby/1.8/irb.rb:298:in`printf’  
from c:/ruby/lib/ruby/1.8/irb.rb:298:in `output_value' from c:/ruby/lib/ruby/1.8/irb.rb:151:in`eval\_input’  
from c:/ruby/lib/ruby/1.8/irb.rb:259:in `signal_status' from c:/ruby/lib/ruby/1.8/irb.rb:147:in`eval\_input’  
from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:244:in  
`each_top_level_statement' from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:230:in`loop’  
from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:230:in  
`each_top_level_statement' from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:229:in`catch’  
from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:229:in  
`each_top_level_statement' from c:/ruby/lib/ruby/1.8/irb.rb:146:in`eval\_input’  
from c:/ruby/lib/ruby/1.8/irb.rb:70:in `start' from c:/ruby/lib/ruby/1.8/irb.rb:69:in`catch’  
from c:/ruby/lib/ruby/1.8/irb.rb:69:in `start’  
from c:/ruby/bin/irb.bat:15  
Maybe IRB bug!!

Has anyone seen this and knows what the problem is?

---

<div class="post-metadata">

**Author:** ![crazyhat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@crazyhat](https://www.ruby-forum.com/u/crazyhat)\
**Post date:** [August 26, 2008, 9:11am UTC](https://www.ruby-forum.com/t/bug-in-irb/146838/2 "2008-08-26T09:11:23Z")

</div>

On 26.08.2008 04:50, Glenn Potter wrote:

> ```
> from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:244:in
> from c:/ruby/lib/ruby/1.8/irb.rb:69:in `start'
> from c:/ruby/bin/irb.bat:15
> 
> ```
> 
> Maybe IRB bug!!
> 
> Has anyone seen this and knows what the problem is?

The error looks like you were trying to write to a filesystem which has  
no space left. But from the stack trace it looks like the error would  
occur during screen writing. I’d look at c:/ruby/lib/ruby/1.8/irb.rb  
line 298 to determine what IRB was trying to do there.

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![crazyhat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@crazyhat](https://www.ruby-forum.com/u/crazyhat)\
**Post date:** [August 26, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/bug-in-irb/146838/3 "2008-08-26T14:58:04Z")

</div>

Robert K. wrote:

> On 26.08.2008 04:50, Glenn Potter wrote:
> 
> > ```
> > from c:/ruby/lib/ruby/1.8/irb/ruby-lex.rb:244:in
> > from c:/ruby/lib/ruby/1.8/irb.rb:69:in `start'
> > from c:/ruby/bin/irb.bat:15
> > 
> > ```
> > 
> > Maybe IRB bug!!
> > 
> > Has anyone seen this and knows what the problem is?
> 
> The error looks like you were trying to write to a filesystem which has  
> no space left. But from the stack trace it looks like the error would  
> occur during screen writing. I’d look at c:/ruby/lib/ruby/1.8/irb.rb  
> line 298 to determine what IRB was trying to do there.
> 
> Kind regards
> 
> robert

Thanks Robert, i looked at the irb code but couldn’t see any problem. I  
started hacking away at the code and replaced a .find(:all,  
:conditions =\> [where\_clause, @station\_ae\_title, @start\_time,  
@end\_time], :order =\> “pps\_start”)  
statement with an equivalent .find\_by\_sql call and the error went away.

---

<div class="post-metadata">

**Author:** ![crazyhat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dc4da7/32.png) [@crazyhat](https://www.ruby-forum.com/u/crazyhat)\
**Post date:** [August 26, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/bug-in-irb/146838/4 "2008-08-26T18:40:52Z")

</div>

On 26.08.2008 14:58, Glenn Potter wrote:

> Thanks Robert, i looked at the irb code but couldn’t see any problem. I  
> started hacking away at the code and replaced a .find(:all,  
> :conditions =\> [where\_clause, @station\_ae\_title, @start\_time,  
> @end\_time], :order =\> “pps\_start”)  
> statement with an equivalent .find\_by\_sql call and the error went away.

Sounds as if you replaced an in memory search by a DB search. Maybe  
your dataset is so huge that the in memory search failed to allocate  
more memory and bombed. Searching through large sets of data is usually  
more efficient when done inside the DBMS.

Kind regards

robert
