Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: William Morgan <wmorgan-sup@masanjin.net>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] Recovering a busted ferret db?
Date: Sun, 01 Nov 2009 06:53:31 -0800	[thread overview]
Message-ID: <1257087035-sup-2014@masanjin.net> (raw)
In-Reply-To: <e06498070910301514ud4efe49ic0fb40d181156fab@mail.gmail.com>

Reformatted excerpts from Steven Walter's message of 2009-10-30:
> I am able to Ctrl-C sup-dump when it hangs.  Here's the ruby backtrace:
> 
> /var/lib/gems/1.8/gems/sup-0.9/lib/sup/util.rb:206:in `split': Interrupt
>         from /var/lib/gems/1.8/gems/sup-0.9/lib/sup/util.rb:206:in
> `split_on_commas'

It looks like you have some crazy long recipient email in some list
that's triggering worst-case behavior in a regexp. Can you try again
after applying this patch, please? (And I'd be curious how long the
address list was, if you find out what message is triggering this.)

diff --git a/lib/sup/person.rb b/lib/sup/person.rb
index 4b1c80b..dbedc79 100644
--- a/lib/sup/person.rb
+++ b/lib/sup/person.rb
@@ -105,6 +105,10 @@ class Person
 
   def self.from_address_list ss
     return [] if ss.nil?
+    ## #split_on_commas has some bad behavior for long strings. so here we do
+    ## something nasty and just truncate the string at the nearest comma <= 500
+    ## characters.
+    ss = ss[0, ss.rindex(",", 500)] if ss.length > 500
     ss.split_on_commas.map { |s| self.from_address s }
   end
 
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


  reply	other threads:[~2009-11-01 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-30 17:17 Steven Walter
2009-10-30 21:48 ` William Morgan
2009-10-30 22:14   ` Steven Walter
2009-11-01 14:53     ` William Morgan [this message]
     [not found]       ` <e06498070911011203s66ece542mac80378442073369@mail.gmail.com>
2009-11-02 11:53         ` William Morgan
2009-11-02 12:35           ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257087035-sup-2014@masanjin.net \
    --to=wmorgan-sup@masanjin.net \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox