php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27197 token_get_all() hangs if called twice with huge files
Submitted: 2004-02-09 13:18 UTC Modified: 2004-02-10 09:34 UTC
From: cellog@php.net Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5CVS-2004-02-09 (dev) OS: win32
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: cellog@php.net
New email:
PHP Version: OS:

 

 [2004-02-09 13:18 UTC] cellog@php.net
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-10 09:34 UTC] jan@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Dec 01 16:00:02 2025 UTC