Re: Globals bug??
| From: | troy at recipezaar dot com | Date: | Tue, 02 Jul 2002 01:53:58 +0000 |
| Subject: | Re: Globals bug?? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104822@lists.php.net to get a copy of this message | ||
When I said "process" I meant "request". Sorry. Is it possible that the PHP
globals are being used across requests (i.e., within the same process)? We
noticed this when upgrading from a version of PHP (4.0.6?) prior to the new
super-globals being added to PHP 4.1.2.
The code in this case is so straightforward that I can't see any other
explanation. The variable in question comes from the URL. For example, if the
URL is http://foo.com/page.php?var=abc, $var in the
PHP is a different value
in these rare cases. And the variable we use here is in a very specific
format and it is a valid value just that it's a different value from the one
in the URL.
Also note that we've only seen this problem when the variable has a longer
string than the one in the URL. Using the URL from the above example again,
$var has a value like "abcdef" which is valid value but longer (in addition to
being wrong). It's as if PHP is re-using memory from a previous request and is
not truncating the string properly for the next request.
Does that make more sense? Possible?
Rasmus Lerdorf <rasmus@php.net> wrote:
> I don't see how. But if what you are saying is actually happening, then
> it is a Linux kernel-level bug if memory is leaking from one process to
> another. No matter how badly we screwed up in PHP, the kernel prevents
> such a screwup from infecting a separate process.
> I'd suggest having a close look at your code.
> -Rasmus
> On 30 Jun 2002 troy@recipezaar.com wrote:
>> We are seeing a rare bug that seems to imply that there is a bug in PHP's
>> global variables across httpd processes. To make a long story short, it
>> appears that on rare occassions our script gets the value of a HTTP_GET_VARS
>> variable from another user's process. Is this possible? BTW, it seems to occur
>> when using HTTP_GET_VARS and the new 'super globals'.
>>
>> FWIW, we're using PHP 4.1.2 on (Red Hat) Linux 2.4.9 with Apache 1.3.12.
>>
>> Thanks!
>>
>> (please reply via email in addition to posting here if possible)
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>