found 584344 2.22-12
thanks

On Wed, Aug 18, 2010 at 11:21:13PM +0300, Niko Tyni wrote:
> On Sun, Aug 15, 2010 at 09:45:42PM +0300, Niko Tyni wrote:
> > > On Thu, Jun 03, 2010 at 12:01:36PM +0200, Lucas Nussbaum wrote:
> > > > Source: speedy-cgi-perl
> > > > Version: 2.22-11
> > > > Severity: serious
> > > > Tags: squeeze sid
> > > > User: debian...@lists.debian.org
> > > > Usertags: qa-ftbfs-20100602 qa-ftbfs
> > > 
> > > > Justification: FTBFS on amd64
> > > > > Test Summary Report
> > > > > -------------------
> > > > > t/detach.t          (Wstat: 0 Tests: 2 Failed: 1)
> > > > >   Failed test:  2
> 
> > My best guess is that it's somehow related to bigger pipe buffers on
> > systems with more memory than mine or something like that, but I can't
> > see the problem in the code no matter how much I glare at it.
> 
> Close enough, the thing that matters here is the socket write buffer size.

> I suppose the most correct thing to do here would be to check the size
> of the socket write buffer with SO_SNDBUF (see socket(7)) and set the
> data and frontend buffer size accordingly. However, I think I'll take
> the lazy route at least for squeeze and use my earlier patch that just
> hardcodes bigger numbers.

It turns out that this made the first test in detach.t fail on "smaller"
(?) systems, at least armel and mipsel. I've therefore implemented a
better fix that adjusts the test according to the socket write buffer
size.

I'm attaching the new patch and reopening the bug.

Lucas, could you please set me up for access to a test system again
so that I could confirm that this works there too?
-- 
Niko Tyni   nt...@debian.org
Author: Niko Tyni <nt...@debian.org>
Description: fix the detach test on systems with a large socket buffer size (#584344)
--- speedy-cgi-perl.orig/speedy/t/detach.t
+++ speedy-cgi-perl/speedy/t/detach.t
@@ -6,9 +6,22 @@
 
 use strict;
 use IO::File;
+use Socket;
 
 my $smbuf	=   8 * 1024;
-my $lgbuf	= 512 * 1024;
+my $lgbuf;
+
+# find out the size of the socket write buffer
+# see http://bugs.debian.org/584344
+my $s;
+if (socket($s, AF_UNIX, SOCK_STREAM, 0) &&
+    (my $packed_size = getsockopt($s, SOL_SOCKET, SO_SNDBUF))) {
+    $lgbuf = $smbuf + 2 * unpack("I", $packed_size);
+} else {
+    warn("socket() or getsockopt() failed: $!");
+}
+
+$lgbuf = 512 * 1024 if $lgbuf < 512 * 1024;
 my $scr		= 't/scripts/detach';
 
 use vars qw(@open_files @pids %children);
@@ -23,7 +36,7 @@
     $| = 1; print ""; $| = 0;
     my $child;
     if (($child = open($fh, "-|")) == 0) {
-	open(F, "$ENV{SPEEDY} -- -B$sz $scr |");
+	open(F, "$ENV{SPEEDY} -- -B$sz $scr $lgbuf |");
 	print scalar <F>;
 	close(STDOUT);
 	sleep 60;	# Simulate slow drain of output
--- speedy-cgi-perl.orig/speedy/t/scripts/detach
+++ speedy-cgi-perl/speedy/t/scripts/detach
@@ -1,3 +1,6 @@
 $| = 1;
+# the data should not fit in the socket write buffer
+# see http://bugs.debian.org/584344
+my $size = shift || (512 * 1024);
 print "$$\n";
-print 'x' x (500*1024);
+print 'x' x int(500 / 512 * $size);

Reply via email to