Re: MailBox Bug: space after "boundary" element causes proc to wedge
"Anthony D. Urso" <[email protected]> Fri, 15 Oct 2004 23:02:16 -0700
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <[email protected]> |
After further investigation, it is apparent that this problem is actually in
Mail::Message::Head::study, and has nothing to do with MIME.
I've looked at the code for that method, and don't understand it, or at
least I don't understand how it could be broken. Stepping through shows it
to hang at the
return map {$_->study} $self->get(@_)
line.
The symptoms feel like a busy loop. Calling get() on the same header does
not cause the hang.
I've attached the minimal test case that reproduces the problem. Please
check it out.
Thanks,
Anthony
On Fri, Oct 15, 2004 at 02:28:18PM -0700, Anthony D. Urso wrote:
> Since I've recently upgraded to the latest MailBox, to take advantage
> of the reduced memory usage, I've been receieving alot of emails that
> wedge my delivery agent.
>
> It appears that some portion of the MIME parser is broken such that a
> Content-type header with a space after the "boundary" element causes
> the process to wedge with 100% cpu usage.
>
> Here is an example:
>
> Content-type: multipart/alternative; boundary="--whatever"
>
> (there is a space after the final quote)
>
> I can't get a stack trace because Mail::Box overwrites my signal handler
> (is this really neccessary?) but I will look into the code this weekend...
>
> --
> Au
>
> PGP Key ID: 0x385B44CB
> Fingerprint: 9E9E B116 DB2C D734 C090 E72F 43A0 95C4 385B 44CB
> "Maximus vero fugiens a quodam Urso, milite Romano, interemptus est"
> - Getica 235
>
--
Au
PGP Key ID: 0x385B44CB
Fingerprint: 9E9E B116 DB2C D734 C090 E72F 43A0 95C4 385B 44CB
"Maximus vero fugiens a quodam Urso, milite Romano, interemptus est"
- Getica 235
test.pl
(application/x-perl, 118 B)
#!/usr/bin/perl -w
use Mail::Message;
my $mail = Mail::Message->read(\*STDIN);
$mail->head->study("Content-type");
test.msg
(text/plain, 66 B)
Content-Type: multipart/alternative; boundary="--whatever" test