Edit report at https://bugs.php.net/bug.php?id=72729&edit=1
ID: 72729
Comment by: caaguado at xcentra dot com
Reported by: caaguado at xcentra dot com
Summary: php-cgi.exe/php_mbstring.dll crash Exception
0xc0000005 Fault offset 0x00026831
Status: Feedback
Type: Bug
Package: mbstring related
Operating System: Windows 10 64bit, Windows 7 64bi
PHP Version: 7.1.0beta1
Block user comment: N
Private report: N
New Comment:
Hi @ab,
You can reproduce it by using Apache Lounge's Apache 2.4.23 binaries available here:
http://www.apachelounge.com/download/VC14/binaries/httpd-2.4.23-win32-VC14.zip
It requires Microsoft Visual C++ 2015 (v14.0) Redistributable Package Update 3:
https://www.microsoft.com/en-us/download/details.aspx?id=52982
... and PHP 7.1.0beta2 binaries available here:
http://windows.php.net/qa/
You can use the Apache 2.4.23 configuration file I included in this bug report (only adapting the
paths configured into the file to match the actual folders you would use in your system). Here it is
again for your convenience:
---------------------------------------------------------------------------
ServerRoot "S:\xtack"
PidFile "S:\xtack\logs\apache24.pid"
Listen 80
LoadModule access_compat_module S:\xtack\bin\a24\modules\mod_access_compat.so
LoadModule actions_module S:\xtack\bin\a24\modules\mod_actions.so
LoadModule alias_module S:\xtack\bin\a24\modules\mod_alias.so
LoadModule allowmethods_module S:\xtack\bin\a24\modules\mod_allowmethods.so
LoadModule asis_module S:\xtack\bin\a24\modules\mod_asis.so
LoadModule auth_basic_module S:\xtack\bin\a24\modules\mod_auth_basic.so
LoadModule authn_core_module S:\xtack\bin\a24\modules\mod_authn_core.so
LoadModule authn_file_module S:\xtack\bin\a24\modules\mod_authn_file.so
LoadModule authz_core_module S:\xtack\bin\a24\modules\mod_authz_core.so
LoadModule authz_groupfile_module S:\xtack\bin\a24\modules\mod_authz_groupfile.so
LoadModule authz_host_module S:\xtack\bin\a24\modules\mod_authz_host.so
LoadModule authz_user_module S:\xtack\bin\a24\modules\mod_authz_user.so
LoadModule autoindex_module S:\xtack\bin\a24\modules\mod_autoindex.so
LoadModule cgi_module S:\xtack\bin\a24\modules\mod_cgi.so
LoadModule dir_module S:\xtack\bin\a24\modules\mod_dir.so
LoadModule env_module S:\xtack\bin\a24\modules\mod_env.so
LoadModule include_module S:\xtack\bin\a24\modules\mod_include.so
LoadModule isapi_module S:\xtack\bin\a24\modules\mod_isapi.so
LoadModule log_config_module S:\xtack\bin\a24\modules\mod_log_config.so
LoadModule mime_module S:\xtack\bin\a24\modules\mod_mime.so
LoadModule negotiation_module S:\xtack\bin\a24\modules\mod_negotiation.so
LoadModule rewrite_module S:\xtack\bin\a24\modules\mod_rewrite.so
LoadModule setenvif_module S:\xtack\bin\a24\modules\mod_setenvif.so
LoadModule unique_id_module S:\xtack\bin\a24\modules\mod_unique_id.so
ServerAdmin admin@example.com
ServerName localhost
<Directory />
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DocumentRoot "S:\xtack\www"
<Directory "S:\xtack\www">
Options FollowSymLinks ExecCGI
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 phpinfo.php
DirectoryIndex index.php52 index.php53 index.php54 index.php55 index.php56 index.php70
index.php71
DirectoryIndex index.p52 index.p53 index.p54 index.p55 index.p56 index.p70 index.p71 index.cgi
DirectoryIndex default.html default.htm default.php home.html home.htm home.php
</IfModule>
<Files ".ht*">
Require all denied
</Files>
<Files "(~$|\.bak$|\.BAK$)">
Require all denied
</Files>
ErrorLog "S:\xtack\logs\xtack_apache24_error.log"
LogLevel trace8
<IfModule log_config_module>
LogFormat "%h %l %u %{[%Y-%m-%d %H:%M]}t \"%r\" %>s %b
\"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %{[%Y-%m-%d %H:%M]}t \"%r\" %>s %b
\"%{Referer}i\" \"%{User-Agent}i\" \"%{error-notes}n\"" combinede
<IfModule logio_module>
LogFormat "%h %l %u %t{[%Y-%m-%d %H:%M]} \"%r\" %>s %b
\"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "S:\xtack\logs\xtack_apache24_access.log" combined
CustomLog "S:\xtack\logs\xtack_apache24_super.log" combinede
</IfModule>
<IfModule alias_module>
Alias /docs "S:\xtack\docs"
Alias /pma "S:\xtack\bin\pma"
Alias /pga "S:\xtack\bin\pga"
ScriptAlias /cgi-bin "S:\xtack\bin\cgi-bin"
ScriptAlias /p52 "S:\xtack\bin\p52"
ScriptAlias /p53 "S:\xtack\bin\p53"
ScriptAlias /p54 "S:\xtack\bin\p54"
ScriptAlias /p55 "S:\xtack\bin\p55"
ScriptAlias /p56 "S:\xtack\bin\p56"
ScriptAlias /p70 "S:\xtack\bin\p70"
ScriptAlias /p71 "S:\xtack\bin\p71"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "S:\xtack\bin\cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\docs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\pma">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\pga">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p52">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p53">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p54">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p55">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p56">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p70">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "S:\xtack\bin\p71">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<IfModule mime_module>
TypesConfig S:\xtack\bin\a24\conf\mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php2
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php5
AddType application/x-httpd-php .p52
AddType application/x-httpd-php .php52
AddType application/x-httpd-php .p53
AddType application/x-httpd-php .php53
AddType application/x-httpd-php .p54
AddType application/x-httpd-php .php54
AddType application/x-httpd-php .p55
AddType application/x-httpd-php .php55
AddType application/x-httpd-php .p56
AddType application/x-httpd-php .php56
AddType application/x-httpd-php .p70
AddType application/x-httpd-php .php70
AddType application/x-httpd-php .p71
AddType application/x-httpd-php .php71
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .phps
AddType application/x-httpd-php .sphp
AddType application/x-httpd-php .inc
AddType application/x-httpd-php .class
AddType application/x-httpd-php .module
AddType application/x-tar .tgz
AddType application/x-httpd-perl .pl
AddType application/x-httpd-python .py
AddType application/x-httpd-python .pyc
AddType application/x-httpd-python .pyo
AddType application/x-httpd-python .pyw
AddType application/x-httpd-ruby .rb
AddHandler cgi-script .cgi .pl .py .pyc .pyo .pyw .rb
AddHandler type-map var
</IfModule>
Action application/x-httpd-php /p56/php-cgi.exe
<IfDefine PHP52CGI>
Action application/x-httpd-php /p52/php-cgi.exe
</IfDefine>
<IfDefine PHP53CGI>
Action application/x-httpd-php /p53/php-cgi.exe
</IfDefine>
<IfDefine PHP54CGI>
Action application/x-httpd-php /p54/php-cgi.exe
</IfDefine>
<IfDefine PHP55CGI>
Action application/x-httpd-php /p55/php-cgi.exe
</IfDefine>
<IfDefine PHP56CGI>
Action application/x-httpd-php /p56/php-cgi.exe
</IfDefine>
<IfDefine PHP70CGI>
Action application/x-httpd-php /p70/php-cgi.exe
</IfDefine>
<IfDefine PHP71CGI>
Action application/x-httpd-php /p71/php-cgi.exe
</IfDefine>
<IfModule mpm_winnt_module>
ThreadsPerChild 150
MaxConnectionsPerChild 0
</IfModule>
IndexOptions FancyIndexing HTMLTable VersionSort
Alias /icons "S:\xtack\bin\icons"
<Directory "S:\xtack\bin\icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
AddIconByEncoding (CMP,S:\xtack\bin\icons\compressed.gif) x-compress x-gzip
AddIconByType (TXT,S:\xtack\bin\icons\text.gif) text/*
AddIconByType (IMG,S:\xtack\bin\icons\image2.gif) image/*
AddIconByType (SND,S:\xtack\bin\icons\sound2.gif) audio/*
AddIconByType (VID,S:\xtack\bin\icons\movie.gif) video/*
AddIcon S:\xtack\bin\icons\binary.gif .bin .exe
AddIcon S:\xtack\bin\icons\binhex.gif .hqx
AddIcon S:\xtack\bin\icons\tar.gif .tar
AddIcon S:\xtack\bin\icons\world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon S:\xtack\bin\icons\compressed.gif .Z .z .tgz .gz .zip
AddIcon S:\xtack\bin\icons\a.gif .ps .ai .eps
AddIcon S:\xtack\bin\icons\layout.gif .html .shtml .htm .pdf
AddIcon S:\xtack\bin\icons\text.gif .txt
AddIcon S:\xtack\bin\icons\c.gif .c
AddIcon S:\xtack\bin\icons\p.gif .pl .py
AddIcon S:\xtack\bin\icons\f.gif .for
AddIcon S:\xtack\bin\icons\dvi.gif .dvi
AddIcon S:\xtack\bin\icons\uuencoded.gif .uu
AddIcon S:\xtack\bin\icons\script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon S:\xtack\bin\icons\tex.gif .tex
AddIcon S:\xtack\bin\icons\bomb.gif core
AddIcon S:\xtack\bin\icons\back.gif ..
AddIcon S:\xtack\bin\icons\hand.right.gif README
AddIcon S:\xtack\bin\icons\folder.gif ^^DIRECTORY^^
AddIcon S:\xtack\bin\icons\blank.gif ^^BLANKICON^^
DefaultIcon S:\xtack\bin\icons\unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
<IfModule mod_userdir>
UserDir "S:\xtack\www\users"
</IfModule>
<IfModule proxy_html_module>
Include S:\xtack\bin/a24\conf\extra\proxy-html.conf
</IfModule>
Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
UseCanonicalName Off
AccessFileName .htaccess
ServerTokens Full
ServerSignature Off
HostnameLookups Off
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
<IfModule setenvif_module>
BrowserMatch "MSIE 10.0;" bad_DNT
</IfModule>
<IfModule headers_module>
RequestHeader unset DNT env=bad_DNT
</IfModule>
---------------------------------------------------------------------------
Apache has to be started with:
"C:\PATH\TO\bin\httpd.exe" -f "C:\PATH\TO\apache24.conf" -D PHP71CGI
Please kindly note that I already attached a backtrace to this bug report,
although I'm not sure whether it is usable, as I didn't manage to get MS'
DebugDiag tool v2.2 to properly find the PHP 7.1.0beta2 PDB files included
in its Debug Pack at http://windows.php.net/qa/
I could try to get a new backtrace in another system/Windows version if needed.
Kindly also remember that I use _exactly the same_ Apache stack that I successfully use (without any
modifications) with PHP 7.0, 5.6, 5.5, 5.4, 5.3 and 5.2 (so the root cause of the fault can't
be generated by Apache).
Finally, the fault is _NOT_ visible when using PHP 7.1.0beta2 in conjuction with Nginx 1.11.3,
meaning that the mbstring changes introduced in beta2 have
corrected the fault for Nginx, but not for Apache.
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2016-08-10 14:05:26] ab@php.net
@caaguado thanks for the further checks. We still miss usable backtrace (fe check #72451) or
reproduce scenario, so then it's impossible to say what the issue is or what is fixed :( I was
lately trying NGINX+FCGI, but still couldn't reproduce any crash with pure PHP core, all
extensions loaded.
Thanks.
------------------------------------------------------------------------
[2016-08-05 13:46:09] caaguado at xcentra dot com
Hi again, sorry for the confusion, but now I took some more time to perform my test cases again for
this fault in detail and while it is _indeed_solved_ with Nginx 1.11.x, I have now confirmed that
unfortunately it _continues_failing_ with Apache 2.4.23 (Apache Lounge binaries).
So, part of the fault (the one specifically related to Apache) is still present.
Kindly let me know whether you need anything from me to help with the investigation.
------------------------------------------------------------------------
[2016-08-05 09:42:29] caaguado at xcentra dot com
Hi,
I'm happy to report that this fault has been fixed on PHP 7.1.0beta2.
According to the "news.txt" changelog, the following fixed for mbstring were implemented:
. Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
(cmb)
. Fixed bug #72693 (mb_ereg_search increments search position when a match
zero-width). (cmb)
. Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
position). (cmb)
. Fixed bug #72710 (mb_ereg causes buffer overflow on regexp compile error).
(ju1ius)
It is clear that this fault was related to one or several of them, and maybe even to other bugs
fixed along beta2.
You can close this ticket if you want. Thanks a lot for your support!
------------------------------------------------------------------------
[2016-08-02 18:15:12] caaguado at xcentra dot com
As Iâm not able to attach the MS DebugDiag v2.2.backtrace file that I have generated to this
bug report, I've sent it directly to the person assigned via email. I'm mentioning it here
for future traceability.
Please kindly let me know whether the backtrace is actually useful to you, as even though the PDB
filesâ location was correctly defined in the tool, it remained saying that it couldnât
reach the php_mbstring PDB during analysis, so Iâm afraid that the backtrace could be not good
enough for troubleshooting.
If thatâs the case, I will try something else or will use an older version of the tool.
------------------------------------------------------------------------
[2016-08-02 11:32:30] caaguado at xcentra dot com
Actually, I have now found out why php-cgi.exe crashes twice on Nginx: Once when launching the
process to listen on port 9000, and another time when actually processing the request for the given
PHP script via Nginx.
When it comes to the PHP script itself, it is a very very basic one, including only a call to
function phpinfo(); -and nothing else but this call, so I guess it's not even related to the
actual PHP code executed-
I'm still struggling with MS' Debug Diag tool for it to find the PHP 7.1.0beta1 PDB files
during analysis phase. I'm looking for ways to fix it. I might need to resort to a version
older than v2.2 (¿?).
I will come back to you asap...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=72729
--
Edit this bug report at https://bugs.php.net/bug.php?id=72729&edit=1