On Wed, 2 Oct 2019 at 11:03, Pete Houston <p...@openstrike.co.uk> wrote:
>
> On Wed, Oct 02, 2019 at 08:13:59AM +0100, Steve Hay wrote:
> >
> > I think the last line of the log extracts above is the clue, but I'm
> > not going to be able to fix this myself. Line 119 in
> > Apache2/Resource.pm is:
> >
> >         my ($soft, $hard) = getrlimit $val;
> >
> > So it looks like $val is blank. That comes from line 118:
> >
> >         my $val = eval "&BSD::Resource::${res}()";
> >
> > where $res is one of the keys of the $lim hashref, which comes from line 
> > 112:
> >
> >     my $lim = get_rlimits();
> >
> > Both getrlimit() and get_rlimits() are further BSD::Resource
> > functions, which I see the error log also has further references to
> > above (several uninitialized value warnings), but is not a thing that
> > I have access to on Windows. Unless anyone else can help here then
> > we'll have to let this one go for now. Hopefully it's not a
> > showstopper.
>
> Thanks for this diagnosis. Going through the resources here I do see
> some which were undef and thus causing getrlimit to complain. Attached
> is the trivial patch which now makes the test pass for me. It seemed
> reasonable to simply omit undef resources but you might have a contrary
> view.
>
> For the record the undef resources I see are:
>
>         RLIMIT_NICE
>         RLIMIT_SIGPENDING
>         RLIMIT_RTTIME
>         RLIMIT_RTPRIO
>         RLIMIT_MSGQUEUE
>

I'm not sure about this area, but if it works for with your patch then
it's probably an improvement :-)

Just out of interest, does the following alternative patch work?

Index: lib/Apache2/Resource.pm
===================================================================
--- lib/Apache2/Resource.pm     (revision 1866274)
+++ lib/Apache2/Resource.pm     (working copy)
@@ -115,8 +115,7 @@
                   "</tr>");

     for my $res (keys %$lim) {
-        my $val = eval "&BSD::Resource::${res}()";
-        my ($soft, $hard) = getrlimit $val;
+        my ($soft, $hard) = getrlimit($lim->{$res});
         (my $limit = $res) =~ s/^RLIMIT_//;
         ($soft, $hard) = ("$soft " . BM($soft), "$hard ". BM($hard))
             if $is_mb{$limit};

This avoids making the &BSD::Resource::${res}() calls, which are what
is returning undef for you in some cases. Or does this fail just the
same because some of the values of %$lim are also undef anyway?

Attachment: Resource-v2.patch
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org

Reply via email to