Or maybe I crash it and don’t know why. Here is the setup:
I have an action that will crash my debian sarge development box
using fcgid, fastcgi and scgi running with Apache2, as well as
fastcgi running with lighttpd, every time. Here is the action from
the controller:
def crashme
@orders = Order.find(:all, :order => "id
ASC", :offset =>
0, :limit => 200)
emails_array = Array.new
@orders.each{ |order|
a_email = OrderMailer.create_a(order, price, pre_tax_price,
sales_tax)
emails_array << a_email
if order.confirmed_email?
verification_email = OrderMailer.create_a_verification
(order, pre_tax_price, sales_tax)
emails_array << verification_email
end
}
flash[:notice] = 'Array Size: ’ + emails_array.size.to_s
emails_array.each{ |email|
email.set_content_type(“text/html”)
OrderMailer.deliver(email)
}
redirect_to :action => “list”
end
It doesn’t even start sending mails - it crashes somewhere in the
arrays when doing ‘.each’. The order model is ~40 fields, mostly
ints and dates, but some varchar. If I cut the limit down to ~50, it
will run ok.
When it “crashes”, I get a line in my apache server log for my rails
virtualhost like this:
[Wed Jul 19 11:30:01 2006] [error] [client 204.11.129.35] Premature
end of script headers: dispatch.fcgi
And no other logs (grrr).
I also get this output on my ssh session sometimes when I run the
action and make it crash:
(eval):1: [BUG] Segmentation fault ruby 1.8.2 (2005-04-11) [x86_64-
linux]
Can anyone share any insight? Am I running out of memory or
something? How could I tell? Or is there a bug in my ruby like the
console output tells me?
Thanks in advance,
Nicholas P. Mueller