httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@csbd.org (Alexander Poquet)
Subject libapreq2 2.04-dev, Apache::Request::param resolver error
Date Thu, 24 Feb 2005 01:45:56 GMT
Hey folks.  I'm in the process of upgrading my application to mod_perl2, and
I'm getting some strange behaviour from Apache::Request::param (and also
Apache::Request::args).  Basically, when I run the simple test case that I've
patched in below, I get the following cryptic error:

Apache::Request::param: (137087408) Unknown resolver error at /var/www/root/test.pl line 18

I get nearly the same error when I replace the call to param with args:

Apache::Request::args: (137087408) Unknown resolver error at /var/www/root/test.pl line 18

And the following when replaced with body:

apache request error: Apache::Request::body: (12) Cannot allocate memory at /var/www/root/test.pl
line 18

The args() call does work when called in a scalar context.  I basically have no
idea what is causing this, or where to look.  I'm pretty fluent in C and Perl,
but have very little experience with xs, so I don't even really know how to
trace the call through the perl glue and into the guts of it to (hopefully)
find the root cause of the problem.

An unknown resolver error, as far as I can tell, happens when herror() or
hstrerror() are given (through h_errno or through an argument, respectively)
an error code > 4.  I don't really know what it means, but what I do know is
that neither of these two functions seem to be called by the libapreq2 tree
at all.

I'm not supplying any POST data, so I would expect there to be much for body()
to parse, but an out of memory error is a little bit bizarre.  Also, in the
case of args, should such a huge and seemingly random number be passed as an
error code?  I'm wondering if maybe the reason I'm getting such a strange and
seemingly random error message (Unknown resolver) is simply because that error
number is totally random ... and certainly > 4.

I'm running Apache 2.0.52 on Debian Sarge on x86.

Anyway, here's test.pl:
---- BEGIN ----
#!/usr/bin/perl

use strict;
use warnings;

use Apache2;
use Apache::Request;
use Apache::RequestRec;
use Apache::RequestIO;
use Apache::Const qw(OK);

BEGIN:
{
        my $r = shift;
        my $apr = Apache::Request->new($r);
        my @foo;

        eval { @foo = $apr->param("foo") };

        if ($@ && ref($@) && $@->isa("Apache::Request::Error")) {
                $r->content_type("text/plain");
                $r->print("apache request error: $@\n");
                return OK;
        }

        $r->content_type("text/plain");
        $r->print("hello, world\n");
        $r->print("$foo[1]\n");
}

1;
---- END ----

Any help anyone could give me on this problem would be greatly appreciated.
It's driving me nuts.

Thanks,
Alexander

Mime
View raw message