#34782 [Opn->Csd]: token_get_all gives wrong result
| From: | dmitry@php.net | Date: | Fri, 21 Oct 2005 09:34:33 +0000 |
| Subject: | #34782 [Opn->Csd]: token_get_all gives wrong result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86853@lists.php.net to get a copy of this message | ||
ID: 34782
Updated by: dmitry@php.net
Reported By: linus at mccabe dot nu
-Status: Open
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5CVS-2005-10-08 (snap)
-Assigned To:
+Assigned To: dmitry
New Comment:
Ficed in CVS HEAD, PHP_5_1 and PHP_5_0.
Previous Comments:
------------------------------------------------------------------------
[2005-10-08 18:29:43] linus at mccabe dot nu
I put my phpinfo's in
http://x.mccabe.nu/public/traces/
one for the linux box and one for the windows box.
On windows I have apache2, binaries supplied by apache foundation.
On Linux I use debian's apache packages, but it's apache 1.3
------------------------------------------------------------------------
[2005-10-08 18:22:25] linus at mccabe dot nu
I did another test and altered test.php to look like:
<?php
header('Content-Type: text/plain');
register_shutdown_function('term');
$first = token_get_all('<?php $a=$b;');
print_r($first);
require('error.php');
function term()
{
apache_child_terminate();
}
?>
After that it gives the correct result every time.
This is of course not an ideal solution, but I thought it might give
yet another hint that the failing has something to do with the previous
script's error.
Also, I've tried with other errors than parsing errors (like doing
division by zero, trigger_error, etc) but nothing else seems to get php
into 'error mode'.
------------------------------------------------------------------------
[2005-10-08 18:21:58] sniper@php.net
What configure line did you use? What MPM you use in Apache2?
------------------------------------------------------------------------
[2005-10-08 14:50:52] linus at mccabe dot nu
Here you'll find some valgrind outputs:
http://x.mccabe.nu/public/traces/
I didnt build apache from source, so I used:
valgrind --log-file=./trace1 /usr/sbin/apache -X
I hope its good enough anyway?
The result can be seen in trace1.log, trace2.log and trace3.log.
trace1.log shows was on a request on a small php file that did not
include any parsing error or use token_get_all.
trace2.log shows the request of earlier mentioned 'test.php' requested
once.
trace3.log shows the request of 'test.php' requested twice and the
second time it gave the wrong result.
traceX_full.log is the same request all over again, but using:
valgrind --leak-check=full --log-file=./trace1 /usr/sbin/apache -X
Hope this helps and let me know if there's anything else i can do!
/Linus
------------------------------------------------------------------------
[2005-10-08 13:37:45] derick@php.net
This is probably related to the strange reports about highlight_string
doing weird things. If you can, please try to run this:
sudo valgrind /path/to/apachesrc/src/httpd -X
and request the same file twice. If valgrind gives any errors, please
put the trace online and provide a link here. With this we see if it is
indeed multiple requests causeing this problem.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34782
--
Edit this bug report at http://bugs.php.net/?id=34782&edit=1