You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Allan <cr...@gmail.com> on 2009/11/11 01:44:43 UTC

Cookie.pm bug in FreeBSD?

I'm using mod_perl2/libapreq2.2 on FreeBSD both installed from ports.

I'm getting a strange error from Apache:

[Wed Nov 11 19:32:39 2009] [error] [client 68.39.99.22] apreq_xs_object2sv
failed: target class Apache2::Cookie::Jar=SCALAR(0x718470) isn't derived
from APR::Request at
/usr/local/lib/perl5/site_perl/5.10.1/mach/Apache2/Cookie.pm line 105.\n,
referer:

I'm just the sysadmin so not sure if this is a bug in the module or the code
that is being used. Here's the snippet from Cookie.pm with line 105 in it:

sub new {
    my $class = shift;
    my $jar = $class->APR::Request::Apache2::handle(shift); # line 105
    my %attrs = @_;
    while (my ($k, $v) = each %attrs) {
        $k =~ s/^-//;
        my $method = lc $k;
        $jar->$method($v);
    }
    return $jar;
}

The code that is calling the function:

sub handler {
    my $r = shift;
...
    my $cookiejar = Apache2::Cookie::Jar->new($r);
...
}

Handler is what is being used to handle requests from Apache. Any help on
this is greatly appreciated.

Thanks,

Allan Feid
Unix Administrator
B.S. Network Engineering

Re: Cookie.pm bug in FreeBSD?

Posted by Joe Schaefer <jo...@yahoo.com>.
Are you sure you don't have a 

$jar->new($r)

call somewhere in your code?
(new only works with the class call, not with an object).


>
>From: Allan <cr...@gmail.com>
>To: apreq-dev <ap...@httpd.apache.org>
>Sent: Tue, November 10, 2009 4:44:43 PM
>Subject: Cookie.pm bug in FreeBSD?
>
>I'm using mod_perl2/libapreq2.2 on FreeBSD both installed from ports.
>
>I'm getting a strange error from Apache:
>
>[Wed Nov 11 19:32:39 2009] [error] [client 68.39.99.22] apreq_xs_object2sv failed: target class Apache2::Cookie::Jar=SCALAR(0x718470) isn't derived from APR::Request at /usr/local/lib/perl5/site_perl/5.10.1/mach/Apache2/Cookie.pm line 105.\n, referer: 
>
>I'm just the sysadmin so not sure if this is a bug in the module or the code that is being used. Here's the snippet from Cookie.pm with line 105 in it:
>
>sub new {
>    my $class = shift;
>    my $jar = $class->APR::Request::Apache2::handle(shift); # line 105
>>
>    my %attrs = @_;
>    while (my ($k, $v) = each %attrs) {
>        $k =~ s/^-//;
>        my $method = lc $k;
>        $jar->$method($v);
>    }
>    return $jar;
>}
>
>The code that is calling the function:
>
>sub handler {
>    my $r = shift;
>...  
>    my $cookiejar = Apache2::Cookie::Jar->new($r);
>...
>}
>
>Handler is what is being used to handle requests from Apache. Any help on this is greatly appreciated. 
>
>Thanks,
>
>Allan Feid
>Unix Administrator
>B.S. Network Engineering
>