|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-03-27 07:47 UTC] mail at patrickwitte dot de
Description: ------------ This happens no matter if the checked file is syntactically ok or not or even doesn't exists. In all cases the result of php_check_syntax() is the expexted, but if exit (or die()) is called afterwards you get a segfault. Experienced with sapi-module and cli on linux and cli on win32. (win32-sapi not tested) Reproduce code: --------------- <?php echo php_check_syntax(__FILE__) ? "Ok" : "failed"; exit; ?> Expected result: ---------------- Ok Actual result: -------------- Ok segfault Backtrace: #0 _emalloc (size=Cannot access memory at address 0xc ) at /home/patrick/php-5.0.0RC1/Zend/zend_alloc.c:140 140 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
I also stumbled upon this, today. Here is my reproduce code: if (!php_check_syntax(NULL)) { die(); } (segfaults) Seems this is not related to __FILE__ I concur that if exit (die) is not called, no segfault. SVersion 5.0.2 This should do the trick... ==================== diff ext/standard/basic_functions.c.old ext/standard/basic_functions.c 2329a2330 > zend_op_array *op_array; 2345c2346,2349 < if (php_lint_script(&file_handle TSRMLS_CC) != SUCCESS) { --- > op_array = zend_compile_file(&file_handle, ZEND_INCLUDE TSRMLS_CC); > zend_destroy_file_handle(&file_handle TSRMLS_CC); > > if (!op_array) { 2354a2359,2360 > destroy_op_array(op_array TSRMLS_CC); > efree(op_array); ====================