Rt-mailgate bouncing with Encode.pm error

Hi,

Since about 3.03pre2 we’ve been having mail sent to the mailgate bounce with
the following message:

contact@syd.harbour.anchor.net.au: Command died with status 32:
"/usr/bin/rt-mailgate --queue enquiries --action correspond --url
https://rt.engineroom.anchor.net.au/". Command output: RT server error.
The RT server which handled your email did not behave as expected. It said:

System error

error:  panic: sv_setpvn called with negative strlen at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Encode.pm line
140.
context: 



<td
nowrap="nowra

The error hidden inside that mess is

panic: sv_setpvn called with negative strlen at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Encode.pm line 140.

and then some context.

I’ve upgraded to rc2, rc4, and now the released 3.0.3 with no improvement,
the mailgate is still bouncing mails that come in. It’s not every mail,
though, and I can’t yet see a pattern in the mails to see what’s causing it.

jaq@spacepants.org http://spacepants.org/jaq.gpg

 
136:  unless(defined $enc){
137:  require Carp;
138:  Carp::croak(“Unknown encoding
’$name’”);
139:  }
140:  my $octets =
$enc->encode($string,$check);
141:  return undef if ($check &&
length($string));
142:  return $octets;
143:  }
144: 

At Mon, 23 Jun 2003 15:35:56 +1000,
Jamie Wilkinson wrote:

Since about 3.03pre2 we’ve been having mail sent to the mailgate bounce with
the following message:
panic: sv_setpvn called with negative strlen at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Encode.pm line 140.
and then some context.
I’ve upgraded to rc2, rc4, and now the released 3.0.3 with no improvement,
the mailgate is still bouncing mails that come in. It’s not every mail,
though, and I can’t yet see a pattern in the mails to see what’s causing it.

- This is something coming from deep inside the guts of perl.
  RT may be triggering it, but "blaming" RT for this kind of bug
  isn't fair.  

- What is line 140 in your Encode.pm?  

- What version of Encode do you have installed?  You may wish to
  upgrade to the latest one.  If you've just upgraded Encode, you
  may wish to downgrade.

- If you could make some of the problem emails available, it would
  help.

-R

This one time, at band camp, Robert Spier wrote:

  • This is something coming from deep inside the guts of perl.
    RT may be triggering it, but “blaming” RT for this kind of bug
    isn’t fair.

Yeah, I can see that. I’m not blaming anyone, I just want to work out
what’s causing this so I can fix it.

The encode function:

131 sub encode($$;$)
132 {
133     my ($name, $string, $check) = @_;
134     $check ||=0;
135     my $enc = find_encoding($name);
136     unless(defined $enc){
137         require Carp;
138         Carp::croak("Unknown encoding '$name'");
139     }
140     my $octets = $enc->encode($string,$check);
141     return undef if ($check && length($string));
142     return $octets;
143 }
  • What version of Encode do you have installed? You may wish to
    upgrade to the latest one. If you’ve just upgraded Encode, you
    may wish to downgrade.

It’s the version that comes with Red Hat, the $Id$ string at the top of the
file says:

  2 # $Id: Encode.pm,v 1.83 2002/11/18 17:28:29 dankogai Exp $

and the package version that owns this file:

perl-5.8.0-88

  • If you could make some of the problem emails available, it would
    help.

I’ll see if I can find a pattern; I don’t think I would be able to republish
the emails.

jaq@spacepants.org http://spacepants.org/jaq.gpg

This one time, at band camp, Jamie Wilkinson wrote:

It’s the version that comes with Red Hat, the $Id$ string at the top of the
file says:

 2 # $Id: Encode.pm,v 1.83 2002/11/18 17:28:29 dankogai Exp $

and the package version that owns this file:

perl-5.8.0-88

I fired up cpan and found a newer version, 1.96, so installed that. I think
it’s fixed the problem. We’ll know for sure tomorrow.

jaq@spacepants.org http://spacepants.org/jaq.gpg