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

Report information
The Basics
Id:
86857
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
hsk [...] fli-leibniz.de
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
1.2906
Fixed in:
1.2907



Subject: t/setrlimit.t failure
test-suite for bsd-resource-1.2906 on opensuse 12.2 / perl 5.18.0 fails for me; error message from setrlimit.t: "setrlimit(RLIMIT_STACK, 6291456, 0) failed: Invalid argument" shouldn't the rounding-down thing be done as follows ? --- t/setrlimit.t__ 2013-07-07 16:39:30.000000000 +0200 +++ t/setrlimit.t 2013-07-11 16:23:29.896165919 +0200 @@ -49,7 +49,7 @@ my $n = 4096; print "# Rounding down to $n byte boundary\n"; ($try_soft, $try_hard) = - map { int($_ / $n) * $n } ($try_soft, $try_hard); + map { ($_ == RLIM_INFINITY) ? RLIM_INFINITY : (int($_ / $n) * $n) } ($try_soft, $try_hard); } print "# try_soft = $try_soft, try_hard = $try_hard\n"; my $success = setrlimit($lim, $try_soft, $try_hard);
Something else is going on because if you look at just a few lines earlier we should not even get to the rounding part if we have RLIM_INFINITY. Could you please debug some more?
From: paul@city-fan.org
On Thu Jul 11 11:01:04 2013, JHI wrote:
Show quoted text
> Something else is going on because if you look at just a few lines > earlier we should not even get to the rounding part if we have > RLIM_INFINITY. Could you please debug some more?
The problem occurs when the hard limit is RLIM_INFINITY and the soft limit isn't. Only the soft limit is checked. I came up with the same fix myself.
On Thu Jul 11 11:08:38 2013, paul@city-fan.org wrote:
Show quoted text
> On Thu Jul 11 11:01:04 2013, JHI wrote:
> > Something else is going on because if you look at just a few lines > > earlier we should not even get to the rounding part if we have > > RLIM_INFINITY. Could you please debug some more?
> > The problem occurs when the hard limit is RLIM_INFINITY and the soft > limit isn't. Only the soft limit is checked. I came up with the same > fix myself.
Ah, indeed. Thanks for the fix. I'll try to roll out a new version soon. In the meanwhile, I'll delete the 1.2906 since it has no benefits to anything else than cygwin.
From: hsk@fli-leibniz.de
On Thu Jul 11 11:01:04 2013, JHI wrote:
Show quoted text
> Something else is going on because if you look at just a few lines > earlier we should not even get to the rounding part if we have > RLIM_INFINITY. Could you please debug some more? >
but you only look at $try_soft... output of "make test TEST_VERBOSE=1 TEST_FILES=t/setrlimit.t" see attachment
Subject: make_test.out

Message body not shown because it is not plain text.

On Thu Jul 11 11:13:43 2013, hsk@fli-leibniz.de wrote:
Show quoted text
> On Thu Jul 11 11:01:04 2013, JHI wrote:
> > Something else is going on because if you look at just a few lines > > earlier we should not even get to the rounding part if we have > > RLIM_INFINITY. Could you please debug some more? > >
> > but you only look at $try_soft... > > output of "make test TEST_VERBOSE=1 TEST_FILES=t/setrlimit.t" see attachment
Actually, could you please try the attached patch *instead* of the suggested patch. I think I now remember why the skipping: if the limit is infinity, it is too messy to try to test it. So the attached patch skips the test if either limit is infinity.
Subject: patch

Message body not shown because it is not plain text.

On Thu Jul 11 10:42:13 2013, hsk@fli-leibniz.de wrote:
Show quoted text
> test-suite for bsd-resource-1.2906 on opensuse 12.2 / perl 5.18.0 > fails for me; error message from setrlimit.t: > "setrlimit(RLIMIT_STACK, 6291456, 0) failed: Invalid argument" > > shouldn't the rounding-down thing be done as follows ? > > --- t/setrlimit.t__ 2013-07-07 16:39:30.000000000 +0200 > +++ t/setrlimit.t 2013-07-11 16:23:29.896165919 +0200 > @@ -49,7 +49,7 @@ > my $n = 4096; > print "# Rounding down to $n byte boundary\n"; > ($try_soft, $try_hard) = > - map { int($_ / $n) * $n } ($try_soft, $try_hard); > + map { ($_ == RLIM_INFINITY) ? RLIM_INFINITY : (int($_ / > $n) * $n) } ($try_soft, $try_hard); > } > print "# try_soft = $try_soft, try_hard = $try_hard\n"; > my $success = setrlimit($lim, $try_soft, $try_hard);
Similarly, please try the patch I just posted instead.
Ping?
From: hsk@fli-leibniz.de
On Fri Jul 12 14:20:37 2013, JHI wrote:
Show quoted text
> Ping?
ahh - sorry - thanks, your patch is working for me, i.e, now no failures in test suite


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.