#28391 [NEW]: token_get_all stack underflow error after include call

From: Date: Thu, 13 May 2004 22:43:28 +0000
Subject: #28391 [NEW]: token_get_all stack underflow error after include call
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59604@lists.php.net to get a copy of this message
From: fred at bitwyze dot com Operating system: Linux Red Hat 8.0 PHP version: 5.0.0RC2 PHP Bug Type: Zend Engine 2 problem Bug description: token_get_all stack underflow error after include call 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" -- Edit bug report at http://bugs.php.net/?id=28391&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28391&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28391&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28391&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28391&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28391&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28391&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28391&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28391&r=support Expected behavior: http://bugs.php.net/fix.php?id=28391&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28391&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28391&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28391&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28391&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28391&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28391&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28391&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28391&r=float

« previous php.bugs (#59604) next »