#38449 [Fbk->Csd]: Segfault when token_get_all is used

From: Date: Mon, 14 Aug 2006 15:44:03 +0000
Subject: #38449 [Fbk->Csd]: Segfault when token_get_all is used
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100780@lists.php.net to get a copy of this message
ID: 38449 User updated by: scottmacvicar at ntlworld dot com Reported By: scottmacvicar at ntlworld dot com -Status: Feedback +Status: Closed Bug Type: Reproducible crash Operating System: FreeBSD 4.10-RELEASE-p5 PHP Version: 4.4.3 New Comment: I edited the ports Makefile to add --enable-tokenizer and removed the tokenizer as an extension and there was no crash. I tried a similar setup on my debian box following the same procedure with tokenizer as an extension and had no problem. I'm going to look a little closer later on and see if I can identify what in particular is causing this on the FreeBSD box. Previous Comments: ------------------------------------------------------------------------ [2006-08-14 12:05:55] tony2001@php.net Works just fine on Linux and FreeBSD 5.4-RELEASE. ------------------------------------------------------------------------ [2006-08-14 11:37:00] scottmacvicar at ntlworld dot com Description: ------------ Customer reported this issue and we've tracked it down to a segfault within token_get_all, we can't reproduce it on Linux or Windows but can on FreeBSD. php -v PHP 4.4.3 (cli) (built: Aug 14 2006 04:34:25) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies Reproduce code: --------------- <?php $tokens = token_get_all('<?php $var = 2; ?>'); var_dump($tokens); ?> Expected result: ---------------- Some output Actual result: -------------- Program received signal SIGSEGV, Segmentation fault. 0x80d216d in _efree () (gdb) bt #0 0x80d216d in _efree () #1 0x80de408 in _zval_dtor () #2 0x4861f8e6 in tokenize () from /usr/local/lib/php/20020429/tokenizer.so #3 0x48620041 in zif_token_get_all () from /usr/local/lib/php/20020429/tokenizer.so #4 0x80f14bb in execute () #5 0x80df699 in zend_execute_scripts () #6 0x80ba79f in php_execute_script () #7 0x80f8241 in main () #8 0x805cf86 in _start () ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38449&edit=1

« previous php.bugs (#100780) next »