Your message dated Sun, 04 Sep 2005 08:02:10 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#326442: fixed in speedy-cgi-perl 2.22-2
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 3 Sep 2005 10:18:16 +0000
>From [EMAIL PROTECTED] Sat Sep 03 03:18:16 2005
Return-path: <[EMAIL PROTECTED]>
Received: from sirppi.helsinki.fi [128.214.205.27]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1EBV6F-0007O7-00; Sat, 03 Sep 2005 03:18:16 -0700
Received: from sirppi.helsinki.fi (localhost [127.0.0.1])
by sirppi.helsinki.fi (8.13.2/8.13.2) with ESMTP id j83AICXB517075
for <[EMAIL PROTECTED]>; Sat, 3 Sep 2005 13:18:12 +0300 (EEST)
Received: (from [EMAIL PROTECTED])
by sirppi.helsinki.fi (8.13.2/8.13.2/Submit) id j83AICSh501399
for [EMAIL PROTECTED]; Sat, 3 Sep 2005 13:18:12 +0300 (EEST)
Date: Sat, 3 Sep 2005 13:18:12 +0300
From: Niko Tyni <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: speedy-cgi-perl: error messages from die() are lost
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk"
Content-Disposition: inline
User-Agent: Mutt/1.4.2i
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2005_01_02
--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Package: speedy-cgi-perl
Version: 2.22-1
Tags: patch,upstream
Severity: normal
Hi,
I have already reported this in the
upstream bugzilla as SourceForge bug 1279867,
http://sourceforge.net/tracker/index.php?func=detail&aid=1279867&group_id=2208&atid=102208
but since it seems pretty quiet there (no bug or CVS activity for almost
two years), I'm sending it here as well.
I'd be glad if somebody could try to reproduce the bug and see if
the patch helps. I'm not a C wizard, and there might well be a better
fix. Anyhow, the bug affects Smokeping development and I'd like to see
it fixed.
Upstream bug report follows:
-----------------------------
I think I have run into a race condition in the communication between
the speedy frontend and Apache. When the perl script running in the
backend calls die(), the error message doesn't always reach the web
server error log.
The problem is 100% reproducible for me with SpeedyCGI 2.22 on Debian
Sarge using this CGI script:
-------------------
#!/usr/bin/speedy -w
use strict;
use CGI;
my $q = new CGI;
print $q->header;
print "foo\n";
die("bar\n");
-------------------
When invoked with a browser (Firefox), the first "bar" always ends up
in the error log, but nearly none of subsequent ones (about 1/10 or
thereabouts) from a reload do.
When using curl from the command line, the behaviour is similar to
Firefox.
When using the 'GET' perl program from the libwww-perl library, no error
messages are lost. The difference seems to be the 'Connection: close'
HTTP header that libwww-perl sends but Firefox and curl don't.
>From studying the strace output of 'apache -X', it seems that the problem
triggers when the speedy frontend closes its STDOUT (going to Apache).
Apache then reacts by killing the CGI with SIGTERM, and sometimes this
happens before the frontend has had time to read the error output from
the backend and copy it to its own STDERR.
The STDOUT closing apparently happens in try_close(), called from around
line 350 in src/speedy_main.c. The copy loop there handles and closes
STDOUT before handling STDERR, which AIUI causes the bug.
I'm attaching a proposed patch, which fixes the behaviour completely for
me. Hope it makes sense. I can also provide strace outputs if you want,
but they are obviously quite lengthy.
Versions of relevant programs on my system:
- SpeedyCGI: 2.22 (speedy-cgi-perl 2.22-1)
- Apache: 1.3.33 (apache 1.3.33-6)
- Perl: 5.8.4 (perl 5.8.4-8)
(I have also reproduced the problem with the CVS version of
speedy_main.c, containing the 'Frontend was turning off O_APPEND flag
on stdout/stderr' patch, so it's not the same problem.)
-----------------------------
Thanks,
--
Niko Tyni [EMAIL PROTECTED]
--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="speedy-stdout.patch"
--- src/speedy_main.c 2005/08/31 19:56:57 1.1
+++ src/speedy_main.c 2005/08/31 19:57:42
@@ -299,6 +299,7 @@
/* Copy streams */
while (1) {
/* Do reads/writes */
+ int close_stdout_delayed = 0;
for (i = 0; i < NUMFDS; ++i) {
register CopyBuf *b = cb + i;
int do_read = my_canread(b) &&
@@ -346,10 +347,17 @@
/* Try to close files now, so we can wake up the backend
* and do more I/O before dropping into select
*/
- if (!do_read && !do_write)
- try_close(b);
- }
- }
+ if (!do_read && !do_write) {
+ if (i == 1)
+ /* delay closing STDOUT until all the other fds are
closed */
+ close_stdout_delayed = 1;
+ else
+ try_close(b);
+ }
+ }
+ }
+ if (close_stdout_delayed)
+ try_close(cb+1);
/* All done with reads/writes after backend exited */
if (backend_exited) {
--qDbXVdCdHGoSgWSk--
---------------------------------------
Received: (at 326442-close) by bugs.debian.org; 4 Sep 2005 15:08:35 +0000
>From [EMAIL PROTECTED] Sun Sep 04 08:08:35 2005
Return-path: <[EMAIL PROTECTED]>
Received: from katie by spohr.debian.org with local (Exim 3.36 1 (Debian))
id 1EBw0Y-0005Ym-00; Sun, 04 Sep 2005 08:02:10 -0700
From: Jose Carlos Garcia Sogo <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
X-Katie: $Revision: 1.56 $
Subject: Bug#326442: fixed in speedy-cgi-perl 2.22-2
Message-Id: <[EMAIL PROTECTED]>
Sender: Archive Administrator <[EMAIL PROTECTED]>
Date: Sun, 04 Sep 2005 08:02:10 -0700
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 3
Source: speedy-cgi-perl
Source-Version: 2.22-2
We believe that the bug you reported is fixed in the latest version of
speedy-cgi-perl, which is due to be installed in the Debian FTP archive:
libapache-mod-speedycgi_2.22-2_i386.deb
to pool/main/s/speedy-cgi-perl/libapache-mod-speedycgi_2.22-2_i386.deb
speedy-cgi-perl_2.22-2.diff.gz
to pool/main/s/speedy-cgi-perl/speedy-cgi-perl_2.22-2.diff.gz
speedy-cgi-perl_2.22-2.dsc
to pool/main/s/speedy-cgi-perl/speedy-cgi-perl_2.22-2.dsc
speedy-cgi-perl_2.22-2_i386.deb
to pool/main/s/speedy-cgi-perl/speedy-cgi-perl_2.22-2_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jose Carlos Garcia Sogo <[EMAIL PROTECTED]> (supplier of updated
speedy-cgi-perl package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Sun, 4 Sep 2005 16:28:41 +0200
Source: speedy-cgi-perl
Binary: libapache-mod-speedycgi speedy-cgi-perl
Architecture: source i386
Version: 2.22-2
Distribution: unstable
Urgency: low
Maintainer: Jose Carlos Garcia Sogo <[EMAIL PROTECTED]>
Changed-By: Jose Carlos Garcia Sogo <[EMAIL PROTECTED]>
Description:
libapache-mod-speedycgi - apache module to speed up perl scripts by making
them persistent
speedy-cgi-perl - speed up perl scripts by making them persistent
Closes: 247866 325763 326442
Changes:
speedy-cgi-perl (2.22-2) unstable; urgency=low
.
* libapache-mod-speedycgi.post{inst,rm}: Install module using apache-modconf
util and don't ask for restarting Apache webserver (Closes: #247866,
#325763)
* debian/rules: convert to allow dpatch use.
* debian/control: build-depend on dpatch.
* Applied patch to avoid error messages in die() being lost. Thanks to Niko
Tyni for it (Closes: #326442)
Files:
fb9cd80d1716c3020313130d83bccfa7 663 interpreters optional
speedy-cgi-perl_2.22-2.dsc
6fee4966a3a6fcc5bf28bf34d7e96e88 6418 interpreters optional
speedy-cgi-perl_2.22-2.diff.gz
94f31b0fc25090654d45430a6d2c5d26 96374 interpreters optional
speedy-cgi-perl_2.22-2_i386.deb
1794e89e0b678579c41328a885537f6a 28618 web optional
libapache-mod-speedycgi_2.22-2_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDGwquS+BYJZB4jhERAuKpAKCglP64btXXGrEy1FW/xIheqLb1LwCePA4Q
eUXm5Q1wJAmeT8a0g61mBEg=
=cyG0
-----END PGP SIGNATURE-----
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]