php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26341 Bug/Segfault in virtual()
Submitted: 2003-11-21 01:42 UTC Modified: 2003-12-02 04:24 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: karmak-php at karmak dot org Assigned:
Status: No Feedback Package: Apache related
PHP Version: 4.3.3 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-11-21 01:42 UTC] karmak-php at karmak dot org
Description:
------------
I've found two problems with virtual() that seem likely to be related.

The first is that virtual() does not behave quite like the apache #include virtual="": When virtual() is used to call another php script, the query string in the virtual() call is ignored. For example, if you call virtual("/file?x=y"), the variable "x" will not be set in the included php script. An example of this is posted at:

  http://staging.karmak.org/2003/php-virtual-bug/a1

The source for the two files used in this example are at:

  http://staging.karmak.org/2003/php-virtual-bug/a1-php.txt
  http://staging.karmak.org/2003/php-virtual-bug/a2-php.txt

However, if you call the first script as "a1?x=y", the variable "x" will be set to "y" in the second script. 

This is not the way the Apache virtual function behaves: With Apache, the query string in the virtual call is passed to the script, as can be seen in the following shtml file:

  http://staging.karmak.org/2003/php-virtual-bug/a3

The source to this file is at:

 http://staging.karmak.org/2003/php-virtual-bug/a3-shtml.txt

Furthermore, all query string variables are reset when the virtual call is issued. This can be seen by calling the shtml file:

  http://staging.karmak.org/2003/php-virtual-bug/a4?x=y

With the corresponding source code at:

 http://staging.karmak.org/2003/php-virtual-bug/a4-shtml.txt

Note that the x=y declaration is not passed to the php script.

--------------------------------------------

The second problem is more critical, as it leads to a segfault which is displayed in the error logs, but nothing is reported in the browser and only a partial page will be displayed. An example of this is at:

  http://staging.karmak.org/2003/php-virtual-bug/a2

This page should end with the word "END", but instead it is cut off mid-sentence. The source for the two files used in this example are at:

  http://staging.karmak.org/2003/php-virtual-bug/b1-php.txt
  http://staging.karmak.org/2003/php-virtual-bug/b2-php.txt




Reproduce code:
---------------
See the description for source code URLs.


Expected result:
----------------
See description.

Actual result:
--------------
See description.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-21 01:49 UTC] karmak-php at karmak dot org
The link to the segfault example was wrong. It should have been:

   http://staging.karmak.org/2003/php-virtual-bug/b1
 [2003-11-27 18:12 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2003-12-02 04:24 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC