[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#83390: marked as done (Apache::Constants loops after bad eval()-block)



Your message dated Wed, 10 Sep 2003 13:01:26 +0200 (CEST)
with message-id <Pine.LNX.4.56.0309101300400.25543@trider-g7.ext.fabbione.net>
and subject line Bug#83390: probably fixed
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 maintonly) by bugs.debian.org; 24 Jan 2001 14:21:00 +0000
>From remco@ch.twi.tudelft.nl Wed Jan 24 08:21:00 2001
Return-path: <remco@ch.twi.tudelft.nl>
Received: from ch.twi.tudelft.nl [::ffff:130.161.156.139] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 14LQnC-0004v9-00; Wed, 24 Jan 2001 08:20:59 -0600
Received: from localhost (remco@localhost)
	by ch.twi.tudelft.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id PAA15531
	for <maintonly@bugs.debian.org>; Wed, 24 Jan 2001 15:20:58 +0100
Date: Wed, 24 Jan 2001 15:20:57 +0100 (CET)
From: Remco Schaar <remco@ch.twi.tudelft.nl>
Reply-To: remco@ch.twi.tudelft.nl
To: maintonly@bugs.debian.org
Subject: Apache::Constants loops after bad eval()-block
Message-ID: <Pine.LNX.4.21.0101241443260.14199-100000@ch.twi.tudelft.nl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: maintonly@bugs.debian.org

Package: libapache-mod-perl
Version: 1.21.20000309-1

Hi,

I ran into a problem somewhere in my code...
After some hacking I found the origin in Apache::Constants. When I use an
eval() containing broken code (e.g. missing a closing bracket), the usage
of some of the constants cause apache to loop infinite and eat up my
memory slowly but surely...

When using the following files in a directory:

================ .htaccess =========
PerlModule Apache::Registry
AddHandler perl-script .pl
PerlHandler Apache::Registry
================ end ===============

================ nobrokeneval.pl ===
#!/usr/bin/perl -w
use Apache::Constants(":common",":response");
main();
sub main()
{
	print "text\n";
	eval("bug();\nbug2();");
	warn $@ if $@;
	print "status:\t" . MOVED . "\n";
}
================ end ===============

================ brokeneval1.pl ====
#!/usr/bin/perl -w
use Apache::Constants(":common",":response");
main();
sub main()
{
	print "text\n";
	eval("bug()\nbug2();");
	warn $@ if $@;
	print "status:\t" . SERVER_ERROR . "\n";
}
================ end ===============

================ brokeneval2.pl ====
#!/usr/bin/perl -w
use Apache::Constants(":common",":response");
main();
sub main()
{
	print "text\n";
	eval("bug()\nbug2();");
	warn $@ if $@;
	print "status:\t" . MOVED . "\n";
}
================ end ===============


When requesting the above files through apache, the first
(nobrokeneval.pl) will warn in the error.log that bug is no valid
function, and return the regular output.

The second (brokeneval1.pl) will warn in the error.log that something
about
the missing bracket, but will still return the regular output.

The third (brokeneval2.pl) will warn the same thing, but will not return
anything. Instead the apache-process starts looping, wasting CPU and
increasing it's memory usage...

The latter happens with "MOVED", but as well with "BAD_REQUEST",
"AUTH_REQUIRED" etc...

When running a
	strace /usr/sbin/apache -X
the code seems to bee looped in breaks and memory-management (brk and
mremap).

Although you might doubt the usefullness of such code, [IMO] there
is. There is an easy fix (just add another
	eval("use Apache::Constants(':response;');");
after the "broken eval", it should not be possible that some broken code
can cause such a problem. Although we don't use any such broken code in
production, it is a annoying thing that a typo can kill a
development-machine when you do not pay attention...

I hope this report is usefull... Further questions are welcome!

Relevant packages (Debian/Potato versions):
- libapache-mod-perl              1.21.20000309-1
- apache                          1.3.9-13.1
- apache-common                   1.3.9-13.1
- perl-5.005                      5.005.03-7.1
- libc6                           2.1.3-10
with a kernel 2.2.18 on a x86-architecture

Greetings,
Remco



---------------------------------------
Received: (at 83390-done) by bugs.debian.org; 10 Sep 2003 11:01:33 +0000
>From fabbione@fabbione.net Wed Sep 10 06:01:29 2003
Return-path: <fabbione@fabbione.net>
Received: from port5.ds1-sby.adsl.cybercity.dk (trider-g7.fabbione.net) [212.242.169.198] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19x2j1-000128-00; Wed, 10 Sep 2003 06:01:27 -0500
Received: from trider-g7.ext.fabbione.net (port5.ds1-sby.adsl.cybercity.dk [212.242.169.198])
	by trider-g7.fabbione.net (Postfix) with ESMTP id 6436E1F;
	Wed, 10 Sep 2003 13:01:26 +0200 (CEST)
Date: Wed, 10 Sep 2003 13:01:26 +0200 (CEST)
From: Fabio Massimo Di Nitto <fabbione@fabbione.net>
Sender: fabbione@trider-g7.ext.fabbione.net
To: Carl Johnstone <carl.johnstone@gmgrd.co.uk>,
	83390-done@bugs.debian.org
Subject: Re: Bug#83390: probably fixed
In-Reply-To: <[🔎] CB7CFFB81937E3498D2DC1A738D2986701DF65B6@EX1.gmnews.co.uk>
Message-ID: <Pine.LNX.4.56.0309101300400.25543@trider-g7.ext.fabbione.net>
References: <[🔎] CB7CFFB81937E3498D2DC1A738D2986701DF65B6@EX1.gmnews.co.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: 83390-done@bugs.debian.org
X-Spam-Status: No, hits=-16.7 required=4.0
	tests=BAYES_30,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
	      QUOTE_TWICE_1,REFERENCES,REPLY_WITH_QUOTES,
	      SIGNATURE_SHORT_SPARSE,USER_AGENT_PINE
	autolearn=ham version=2.53-bugs.debian.org_2003_8_27
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_27 (1.174.2.15-2003-03-30-exp)


Hi Carl,
	thanks for testing this problem. I am closing the bug.

Fabio

On Wed, 10 Sep 2003, Carl Johnstone wrote:

>
> to test I had to change the line
>
> print "text\n";
>
> in the scripts to:
>
> print "Content-type: text/html\n\n";
>
>
> I can't reproduce the error with apache 1.3.27.0-2 and libapache-mod-perl 1.27-4
>
> Carl--------------------------------------------------------

-- 
Our mission: make IPv6 the default IP protocol
"We are on a mission from God" - Elwood Blues

http://www.itojun.org/paper/itojun-nanog-200210-ipv6isp/mgp00004.html



Reply to: