Skip Menu |

This queue is for tickets about the BSD-Resource CPAN distribution.

Report information
The Basics
Id: 108955
Status: resolved
Priority: 0/
Queue: BSD-Resource

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc: CARNIL [...] cpan.org
gregoa [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.2908
Fixed in: 1.2909



Subject: No constants exported for the new RLIMIT values
The new rlimits like RLIMIT_MSGQUEUE and RLIMIT_NICE don't have exported constants like the old ones, even though they're in the get_rlimits() hash. % perl -MBSD::Resource -le 'print RLIMIT_CORE' 4 % perl -MBSD::Resource -le 'print RLIMIT_NICE' RLIMIT_NICE is not a valid BSD::Resource macro at -e line 1. % perl -MBSD::Resource -le 'print ((get_rlimits())->{RLIMIT_NICE})' 13 As it happens, this breaks the mod_perl2 test suite (in t/modules/apache_resource.t), because Apache2::Resource now generates a fatal warning.
On Sun Nov 15 03:58:30 2015, ntyni@iki.fi wrote: Show quoted text
> The new rlimits like RLIMIT_MSGQUEUE and RLIMIT_NICE don't have > exported constants like the old ones, even though they're in the > get_rlimits() hash. > > % perl -MBSD::Resource -le 'print RLIMIT_CORE' > 4 > > % perl -MBSD::Resource -le 'print RLIMIT_NICE' > RLIMIT_NICE is not a valid BSD::Resource macro at -e line 1. > > % perl -MBSD::Resource -le 'print ((get_rlimits())->{RLIMIT_NICE})' > 13 > > As it happens, this breaks the mod_perl2 test suite (in > t/modules/apache_resource.t), because Apache2::Resource now generates > a fatal warning.
What operating system is this? That it would be only those two constants and not the others added in 1.2908 would be strange, since all of them were added using the same pattern. (Which is the same pattern used before.)
Subject: Re: [rt.cpan.org #108955] No constants exported for the new RLIMIT values
Date: Sun, 15 Nov 2015 17:23:26 +0200
To: Jarkko_Hietaniemi via RT <bug-BSD-Resource [...] rt.cpan.org>
From: Niko Tyni <ntyni [...] iki.fi>
On Sun, Nov 15, 2015 at 08:13:10AM -0500, Jarkko_Hietaniemi via RT wrote: Show quoted text
> > What operating system is this?
Debian unstable, amd64. Show quoted text
> That it would be only those two constants and not the others added in 1.2908 would be strange, since all of them were added using the same pattern. (Which is the same pattern used before.)
Sure it applies to all the new ones, those two were just examples. Sorry for being unclear. % perl -MBSD::Resource -le 'my $r = get_rlimits(); for my $res (keys %$r) { my $val = eval "&BSD::Resource::${res}()"; print "$res $r->{$res} <$val>" }' RLIMIT_FSIZE 1 <1> RLIMIT_RTTIME 15 <> RLIMIT_SIGPENDING 11 <> RLIMIT_OFILE 7 <7> RLIMIT_VMEM 9 <9> RLIMIT_RSS 5 <5> RLIMIT_LOCKS 10 <10> RLIMIT_CORE 4 <4> RLIMIT_DATA 2 <2> RLIMIT_OPEN_MAX 7 <7> RLIMIT_RTPRIO 14 <> RLIMIT_AS 9 <9> RLIMIT_NICE 13 <> RLIMIT_NPROC 6 <6> RLIMIT_CPU 0 <0> RLIMIT_STACK 3 <3> RLIMIT_NOFILE 7 <7> RLIMIT_MEMLOCK 8 <8> RLIMIT_MSGQUEUE 12 <> -- Niko Tyni ntyni@debian.org
On Sun Nov 15 10:23:43 2015, ntyni@iki.fi wrote: Show quoted text
> On Sun, Nov 15, 2015 at 08:13:10AM -0500, Jarkko_Hietaniemi via RT > wrote:
> > > > What operating system is this?
> > Debian unstable, amd64. >
> > That it would be only those two constants and not the others added in > > 1.2908 would be strange, since all of them were added using the same > > pattern. (Which is the same pattern used before.)
> > Sure it applies to all the new ones, those two were just examples. > Sorry > for being unclear. > > % perl -MBSD::Resource -le 'my $r = get_rlimits(); for my $res (keys > %$r) { my $val = eval "&BSD::Resource::${res}()"; print "$res $r-
> >{$res} <$val>" }'
> RLIMIT_FSIZE 1 <1> > RLIMIT_RTTIME 15 <> > RLIMIT_SIGPENDING 11 <> > RLIMIT_OFILE 7 <7> > RLIMIT_VMEM 9 <9> > RLIMIT_RSS 5 <5> > RLIMIT_LOCKS 10 <10> > RLIMIT_CORE 4 <4> > RLIMIT_DATA 2 <2> > RLIMIT_OPEN_MAX 7 <7> > RLIMIT_RTPRIO 14 <> > RLIMIT_AS 9 <9> > RLIMIT_NICE 13 <> > RLIMIT_NPROC 6 <6> > RLIMIT_CPU 0 <0> > RLIMIT_STACK 3 <3> > RLIMIT_NOFILE 7 <7> > RLIMIT_MEMLOCK 8 <8> > RLIMIT_MSGQUEUE 12 <>
Hmm. In this case it smells like the t/modules/apache_resource.t needs some looking into. What is it actually trying to test? And what does "man getrlimit" say about those missing constants? What it now looks like is that those constants are defined in the system headers (since they get compiled in) but then ... they do not work?
Subject: Re: [rt.cpan.org #108955] No constants exported for the new RLIMIT values
Date: Sun, 15 Nov 2015 17:49:57 +0200
To: Jarkko_Hietaniemi via RT <bug-BSD-Resource [...] rt.cpan.org>
From: Niko Tyni <ntyni [...] iki.fi>
On Sun, Nov 15, 2015 at 10:30:59AM -0500, Jarkko_Hietaniemi via RT wrote: Show quoted text
Show quoted text
> Hmm. In this case it smells like the t/modules/apache_resource.t needs some looking into. What is it actually trying to test?
Yes, the test should probably use the get_rlimits() hash values instead of the exported constants, if the lack of the latter is intentional. I assumed it isn't. Show quoted text
> And what does "man getrlimit" say about those missing constants? What it now looks like is that those constants are defined in the system headers (since they get compiled in) but then ... they do not work?
I think the problem is just that the new RLIMIT_* names aren't listed in constant() in Resource.xs like the old ones are. -- Niko Tyni ntyni@debian.org
On Sun Nov 15 10:50:17 2015, ntyni@iki.fi wrote: Show quoted text
> I think the problem is just that the new RLIMIT_* names aren't listed > in constant() in Resource.xs like the old ones are.
Ahh. That might be it. I'll roll out a new release within the next 24h.
I believe this is fixed in 1.2909.