#27197 [NEW]: token_get_all() hangs if called twice with huge files

From: Date: Mon, 09 Feb 2004 18:18:35 +0000
Subject: #27197 [NEW]: token_get_all() hangs if called twice with huge files
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54632@lists.php.net to get a copy of this message
From: cellog@php.net Operating system: win32 PHP version: 5CVS-2004-02-09 (dev) PHP Bug Type: Reproducible crash Bug description: token_get_all() hangs if called twice with huge files Description: ------------ while testing phpDocumentor 1.3.0RC2 (which is due out today), I discovered a hang at a token_get_all(), but only if I parse two large files in a row. if I parser CHMdefaultConverter.inc and Converter.inc at the same time, the token_get_all() call simply hangs infinitely. If I parse CHMdefaultConverter by itself, the code works perfectly. The problem is that T_DOC_COMMENT is destroyed, but should be treated in the same way as T_COMMENT This patch fixes the bug: Index: ext/tokenizer/tokenizer.c =================================================================== RCS file: /repository/php-src/ext/tokenizer/tokenizer.c,v retrieving revision 1.25 diff -u -r1.25 tokenizer.c --- ext/tokenizer/tokenizer.c 17 Jan 2004 17:44:27 -0000 1.25 +++ ext/tokenizer/tokenizer.c 9 Feb 2004 18:22:57 -0000 @@ -345,6 +345,7 @@ case T_OPEN_TAG_WITH_ECHO: case T_WHITESPACE: case T_COMMENT: + case T_DOC_COMMENT: case T_CLOSE_TAG: destroy = 0; break; Reproduce code: --------------- parse both phpDocumentor/Converter.inc and phpDocumentor/Converters/CHM/default/CHMdefaultConverter.inc using phpDocumentor 1.3.0RC2 in the latest snapshot. Expected result: ---------------- works Actual result: -------------- hangs -- Edit bug report at http://bugs.php.net/?id=27197&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27197&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27197&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27197&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27197&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27197&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27197&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27197&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27197&r=support Expected behavior: http://bugs.php.net/fix.php?id=27197&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27197&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27197&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27197&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27197&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27197&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27197&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27197&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27197&r=float

« previous php.bugs (#54632) next »