php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60758 require() crashes Apache
Submitted: 2012-01-14 22:19 UTC Modified: 2013-02-18 00:35 UTC
Votes:21
Avg. Score:4.3 ± 0.8
Reproduced:17 of 19 (89.5%)
Same Version:6 (35.3%)
Same OS:14 (82.4%)
From: bugzilla33 at gmail dot com Assigned: dmitry (profile)
Status: No Feedback Package: Reproducible crash
PHP Version: 5.4.0RC5 OS: Windows
Private report: No CVE-ID: None
 [2012-01-14 22:19 UTC] bugzilla33 at gmail dot com
Description:
------------
require() crashes Apache

Test script:
---------------
<?php
 file_put_contents('test.php',str_repeat('passed, ',1024));
 require('test.php');
?>

Expected result:
----------------
require() requires test.php

Actual result:
--------------
require() crashes Apache

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-15 03:30 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2012-01-15 03:30 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2012-01-15 10:08 UTC] bugzilla33 at gmail dot com
-Status: Feedback +Status: Open
 [2012-01-15 10:08 UTC] bugzilla33 at gmail dot com
Thank you for this manual. https://bugs.php.net/bugs-generating-backtrace-win32.php
This tool works on Win 7 only as (Analisys only) mode. 
"Options and settings" tab looks otherwise.
There is no "Add a rule" button.

Please update the handbook as soon as possible.

---

Does anybody can do backtrace for laruence ??
 [2012-01-16 18:18 UTC] bugzilla33 at gmail dot com
Here you are:
http://host0001.webd.pl/bugs/php/reports/CrashHang_Report__PID_1080__01162012191518294.zip
 [2012-01-28 00:47 UTC] rasmus@php.net
-Operating System: +Operating System: Windows
 [2012-01-28 00:47 UTC] rasmus@php.net
Works fine on Linux. Doesn't seem like this should be an OS-specific thing. Can 
anybody else reproduce this on Windows?
 [2012-01-28 09:35 UTC] pajoye@php.net
-Status: Open +Status: Not a bug
 [2012-01-28 09:35 UTC] pajoye@php.net
There is no bug, sadly he is spamming bugs.php.net with "crash bugs" which are 
actually configuration issues.
 [2012-01-30 02:26 UTC] homma dot teppei+php at gmail dot com
The same problem occurred with CLI version.
The file to be 'include' (or 'require'), PHP will crash if its size is multiples 
of 4096 bytes.

OS:
both Windows 7 Professional (x64) and Windows 7 Home Premium (32bit)

PHP:
5.3.9 (thread safe, with no extension)

Test case:
First of all, I prepared the file is filled with 4096bytes white spaces.
And save as 'test.txt'.

with command prompt
c:\php-sdk\> php.exe -a
<?php
require 'test.txt';
^Z[Ctrl+z enter]
 -> then crash.

another case:
test.php
<?php
file_put_contents('test.txt', str_pad('', 4096));
include('./test.txt');
?>

with command prompt
c:\php-sdk\> php.exe test.php
 -> then crash.

Call Stack:
>	php5ts_debug.dll!lex_scan(_zval_struct * zendlval, void * * * tsrm_ls)  
line 942 + 0x12 bytes	C
 	php5ts_debug.dll!zendlex(_znode * zendlval, void * * * tsrm_ls)  line 
4975 + 0x10 bytes	C
 	php5ts_debug.dll!zendparse(void * tsrm_ls)  line 3285 + 0xd bytes	
C
 	php5ts_debug.dll!compile_file(_zend_file_handle * file_handle, int type, 
void * * * tsrm_ls)  line 364 + 0x9 bytes	C
 	php5ts_debug.dll!compile_filename(int type, _zval_struct * filename, 
void * * * tsrm_ls)  line 407 + 0x14 bytes	C
 	
php5ts_debug.dll!ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(_zend_execute_data * 
execute_data, void * * * tsrm_ls)  line 
1966 + 0x14 bytes	C
 	php5ts_debug.dll!execute(_zend_op_array * op_array, void * * * tsrm_ls)  
line 107 + 0x11 bytes	C
 	php5ts_debug.dll!zend_execute_scripts(int type, void * * * tsrm_ls, 
_zval_struct * * retval, int file_count, ...)  line 
1236 + 0x21 bytes	C
 	php5ts_debug.dll!php_execute_script(_zend_file_handle * primary_file, 
void * * * tsrm_ls)  line 2308 + 0x1b bytes	C
 	php.exe!main(int argc, char * * argv)  line 1184 + 0x13 bytes	C
 	php.exe!__tmainCRTStartup()  line 555 + 0x19 bytes	C
 	php.exe!mainCRTStartup()  line 371	C
 	kernel32.dll!7718339a()
 [2012-01-30 12:49 UTC] pajoye@php.net
@homma dot teppei+php at gmail dot com

This bug has been fixed already and is totally different issue.

Thanks for your feedback.
 [2012-02-06 08:06 UTC] hannes at dorn dot cc
FYI I had this problem in 5.3.9, but it is fixed in 5.3.10.
 [2012-02-06 08:11 UTC] hannes at dorn dot cc
Ups, sorry, 4096 byte require bug still exists in 5.3.10
 [2012-02-08 17:30 UTC] mmoreno at pobox dot com
I too am experiencing this same problem on 5.3.10 running on Windows 2008 SP2.  I have also confirmed that this is crashing when trying to include() a file that happens to be exactly 4096 bytes.

Can you explain how this is "has already been fixed" and/or "is a different issue"?  Am I missing something?  Unfortunately, I don't have the means to build and test a snapshot.


Full Call Stack



Function     Arg 1     Arg 2     Arg 3     Arg 4   Source 
php5ts!lex_scan+d12     0363e348     027adb48     027adb48     0363e374   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_language_scanner.c @ 2507 + 12 
php5ts!zendlex+4e     0363e340     027adb48     06826510     027adb48   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_compile.c @ 4975 + b 
php5ts!zendparse+1d4     027adb48     06826510     00000002     00000040   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_language_parser.c @ 3285 + b 
php5ts!compile_file+e4     0363f99c     00000008     027adb00     027adb48   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_language_scanner.l @ 365 
php5ts!phar_compile_file+1e6     0363f99c     00000008     027adb48     027adb48   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\ext\phar\phar.c @ 3393 + 1b 
php5ts!ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER+251     040d6eb8     0363fab4     027adb48     03b70124   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_vm_execute.h @ 22510 
php5ts!execute+2e8     041e7fb0     027adb01     027adb48     052690a0   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_vm_execute.h @ 107 + a 
php5ts!zend_call_function+862     00000000     0363faa0     03b70280     00000000   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_execute_api.c @ 969 + 1b 
php5ts!zif_call_user_func_array+63     00000002     06623018     00000000     00000000   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\ext\standard\basic_functions.c @ 4803 + 18 
php5ts!zend_do_fcall_common_helper_SPEC+920     03b70280     027adb00     027adb48     03b70280   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_vm_execute.h @ 320 + 41 
php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+11a     027adb48     0363fbb8     00000000     0363fe44   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_vm_execute.h @ 1640 + e 
php5ts!execute+2e8     03b3e5e0     027adb00     027adb48     00000000   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend_vm_execute.h @ 107 + a 
php5ts!zend_execute_scripts+fe     00000008     027adb48     00000000     00000003   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\zend\zend.c @ 1237 
php5ts!php_execute_script+24c     0363fe44     027adb48     00000005     018a416c   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\main\main.c @ 2308 + 12 
php5apache2_2!php_handler+634     0268f050     0268f050     018a4ce0     6eecd540   c:\php-sdk\snap_5_3\vc9\x86\php-5.3.10-ts\sapi\apache2handler\sapi_apache2.c @ 669 + e 
libhttpd!ap_run_handler+25
 [2012-03-07 20:50 UTC] chris at deskpro dot com
I can also report this problem still exists in PHP 5.3.10 - Windows 7 64 bit with distro from http://www.wampserver.com/en/ - arises when loading Symfony: https://github.com/symfony/symfony/issues/3216
 [2012-03-07 20:55 UTC] pajoye@php.net
It is already fixed in svn, use a snapshot if you like to confirm it. 5.3.11 will 
have the fix (5.4.0 has it).
 [2012-03-08 18:53 UTC] mmoreno at pobox dot com
I've confirmed this problem has NOT been fixed using this snapshot (2012-03-08):
http://windows.php.net/downloads/snaps/php-5.3/r324022/php-5.3-ts-windows-vc9-x86-
r324022.zip
 [2012-03-08 23:59 UTC] pajoye@php.net
-Status: Not a bug +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2012-03-08 23:59 UTC] pajoye@php.net
hi Dmitry,

Seems that we have it back :P
 [2012-04-11 03:11 UTC] mmoreno at pobox dot com
Any progress on this issue?
 [2012-04-11 05:32 UTC] pajoye@php.net
Reminder for Dmitry now that we have the mails back on bugs :)
 [2012-05-02 19:53 UTC] mmoreno at pobox dot com
Looks like this issue has been fixed in 5.3.11.
 [2012-05-21 13:56 UTC] dmitry@php.net
It must be fixed long time ago.
 [2012-05-21 13:56 UTC] dmitry@php.net
-Status: Assigned +Status: Feedback
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2015-11-18 12:22 UTC] webcoder31 at gmail dot com
I too am experiencing this same problem on 5.3.9 running on Windows 7 professional.  I have also confirmed that this is crashing when trying to require() a file that happens to be exactly 16384 bytes (4 x 4096).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC