php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28391 token_get_all stack underflow error after include call
Submitted: 2004-05-14 00:43 UTC Modified: 2005-02-03 01:00 UTC
Votes:9
Avg. Score:4.7 ± 0.7
Reproduced:8 of 8 (100.0%)
Same Version:1 (12.5%)
Same OS:1 (12.5%)
From: fred at bitwyze dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.0.0RC2 OS: Linux Red Hat 8.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fred at bitwyze dot com
New email:
PHP Version: OS:

 

 [2004-05-14 00:43 UTC] fred at bitwyze dot com
Description:
------------
When there is a parse error in an included file before a call to token_get_all the error is printed out and execution is stoped.

I fix the error in the include file and reload the file that is including it and get;

"Fatal error: start-condition stack underflow in /index.php on line 4"

I reload my browser, same thing.  I hit reload for a minute or two still getting the stack underflow error.  Then magically after some time of hitting refresh it disapears and gives the the correct output.

If I restart the web server the stack underflow error goes away.

It happens is both php5-200405131630 and  5.0.0RC32 compiled with the same flags

'./configure' '--with-apxs=/web/apache/bin/apxs' '--enable-track-vars' '--enable-force-cgi-redirect' '--with-gettext' '--with-mysql=/usr--with-freetype' '--enable-gd-native-ttf' '--with-fdftk=/usr/local' '--with-zlib=/usr' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-tiff-dir=/usr--with-jpeg-dir=/usr' '--with-zlib-dir=/usr' '--with-pdflib=/usr/local' '--with-pdflibpsp=/usr/local' '--with-xml' '--with-expat-dir=/usr' '--with-iconv=/usr/local' '--with-xmlrpc' '--enable-dbase' '--disable-debug' '--with-pgsql' '--with-config-file-path=/usr/local/lib/php5.ini'



Reproduce code:
---------------
<?
include('./somefile.php');

$tokens = token_get_all("<?php if (\$foo) echo \$foo; ");

echo count($tokens);
?>

somefile.php that gets included
<?

fsdo-> 

class style {
    
}
?>

Expected result:
----------------
12

Actual result:
--------------
"Fatal error: start-condition stack underflow in /index.php on line 4"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-26 04:59 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-02-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Feb 11 10:01:29 2025 UTC