From: scottmacvicar at ntlworld dot com
Operating system: FreeBSD 4.10-RELEASE-p5
PHP version: 4.4.3
PHP Bug Type: Reproducible crash
Bug description: Segfault when token_get_all is used
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 bug report at http://bugs.php.net/?id=38449&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38449&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38449&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38449&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38449&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38449&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38449&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38449&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38449&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38449&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38449&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38449&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38449&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38449&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38449&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38449&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38449&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38449&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38449&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38449&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38449&r=mysqlcfg