Apache 2.4.12 (64) restarts randomly

Started by graff, March 14, 2016, 12:44:28 PM

Previous topic - Next topic

graff

Hello,

The problem seems mainly to occur when multiple request are made to the server. In that request we call to php pages that handles files.

Enviroment:
Windows Server 2012R2 64bits
Apache 2.4.12 (64) VC11
PHP 5.6.10 (64) VC11


This is error.log


zend_mm_heap corrupted
[Thu Mar 10 18:10:50.759283 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00428: Parent: child process 2460 exited with status 1 -- Restarting.
[Thu Mar 10 18:10:51.634342 2016] [ssl:warn] [pid 1120:tid 472] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 10 18:10:52.087493 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00455: Apache/2.4.12 (Win64) OpenSSL/1.0.1m PHP/5.6.10 configured -- resuming normal operations
[Thu Mar 10 18:10:52.087493 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00456: Server built: Mar 20 2015 00:36:56
[Thu Mar 10 18:10:52.087493 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH80000: Distributed by: The Apache Haus
[Thu Mar 10 18:10:52.087493 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH80001: Compiled with: Visual Studio 2012
[Thu Mar 10 18:10:52.087493 2016] [core:notice] [pid 1120:tid 472] AH00094: Command line: 'D:\\opt\\Apache24\\bin\\httpd.exe -d D:/opt/Apache24'
[Thu Mar 10 18:10:52.103120 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00418: Parent: Created child process 2504
[Thu Mar 10 18:10:52.587535 2016] [ssl:warn] [pid 2504:tid 364] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 10 18:10:52.759424 2016] [ssl:warn] [pid 2504:tid 364] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 10 18:10:53.150072 2016] [mpm_winnt:notice] [pid 2504:tid 364] AH00354: Child: Starting 64 worker threads.
[Thu Mar 10 18:12:05.389204 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00428: Parent: child process 2504 exited with status 255 -- Restarting.
[Thu Mar 10 18:12:06.295515 2016] [ssl:warn] [pid 1120:tid 472] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 10 18:12:06.670541 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00455: Apache/2.4.12 (Win64) OpenSSL/1.0.1m PHP/5.6.10 configured -- resuming normal operations
[Thu Mar 10 18:12:06.670541 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00456: Server built: Mar 20 2015 00:36:56
[Thu Mar 10 18:12:06.670541 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH80000: Distributed by: The Apache Haus
[Thu Mar 10 18:12:06.670541 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH80001: Compiled with: Visual Studio 2012
[Thu Mar 10 18:12:06.670541 2016] [core:notice] [pid 1120:tid 472] AH00094: Command line: 'D:\\opt\\Apache24\\bin\\httpd.exe -d D:/opt/Apache24'
[Thu Mar 10 18:12:06.670541 2016] [mpm_winnt:notice] [pid 1120:tid 472] AH00418: Parent: Created child process 9960
[Thu Mar 10 18:12:07.123691 2016] [ssl:warn] [pid 9960:tid 364] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 10 18:12:07.295577 2016] [ssl:warn] [pid 9960:tid 364] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 10 18:12:07.686237 2016] [mpm_winnt:notice] [pid 9960:tid 364] AH00354: Child: Starting 64 worker threads.



This is the httpd.conf (only clean all comments)


Define SRVROOT "D:/opt/Apache24"
ServerRoot "${SRVROOT}"
Listen 80

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule status_module modules/mod_status.so
LoadModule php5_module D:/opt/php5/php5apache2_4.dll

<IfModule php5_module>
    DirectoryIndex index.html index.php
    AddType application/x-httpd-php .php
    PHPIniDir "D:/opt/php5"
</IfModule>

<IfModule unixd_module>
User daemon
Group daemon
</IfModule>

ServerAdmin [email protected]
ServerName localhost:80
<Directory />
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "${SRVROOT}/htdocs"

<Directory "${SRVROOT}/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error.log"
LogLevel debug

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access.log" common
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"
</IfModule>

<IfModule cgid_module>
</IfModule>

<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-vhosts.conf

<IfModule proxy_html_module>
Include conf/extra/httpd-proxy-html.conf
</IfModule>

<IfModule ssl_module>
Include conf/extra/httpd-ahssl.conf
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


This is the php.ini (only clean all comments)


[PHP]
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
engine = On
short_open_tag = On
asp_tags = Off
precision = 14
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On

;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;
expose_php = On

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 180
max_input_time = 120
memory_limit = 1024M

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = On
html_errors = On
variables_order = "EGPCS"
request_order = "GP"
register_argc_argv = On
auto_globals_jit = On
post_max_size = 80M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
doc_root =
user_dir =
extension_dir = "D:\opt\php5\ext"
enable_dl = On
file_uploads = On
upload_max_filesize = 200M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

extension=php_curl.dll
extension=php_gd2.dll
extension=php_imap.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_pdo_oci.dll
extension=php_sockets.dll
extension=php_xmlrpc.dll

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[CLI Server]
cli_server.color = On

[Date]
date.timezone = Europe/Madrid

[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=

[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On

[SQL]
sql.safe_mode = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1


[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"

[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off

[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = On

[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[bcmath]
bcmath.scale = 0

[browscap]
browscap="D:\opt\php5\extras\php_browscap.ini"

[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
mssql.secure_connection = Off

[Tidy]
tidy.clean_output = Off

[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5

[ldap]
ldap.max_links = -1

[Zend]
zend_extension_ts="D:\opt\php5\ext\ioncube_loader_win_5.6.dll"




Gregg

zend_mm_heap corrupted

This looks like a php problem. php crashes and brings the server down with it. This is why many use mod_fcgid for php rather than loading php's apache module.

One thing that was suggested by php back a couple versions ago was if running the Apache module one should raise the ThreadStackSize in Apache to 8mb (8388608).

I see other suggestions when googling up that zend error, you might want to look yourself.

Maybe Mario knows, he's the PHP guy here.

graff

Hi,

Thanks for the reply.

The "zend_mm_heap corrupted" line not appear always. I had tried raise the ThreadStackSize, but I tried again and the server restart with other memory errors.


[Tue Mar 15 10:31:38.777068 2016] [mpm_winnt:notice] [pid 6512:tid 460] AH00428: Parent: child process 864 exited with status 255 -- Restarting.
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(393): AH00821: shmcb_init allocated 512000 bytes of shared memory
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(407): AH00822: for 511944 bytes (512000 including header), recommending 32 subcaches, 88 indexes each
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(444): AH00824: shmcb_init_memory choices follow
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(446): AH00825: subcache_num = 32
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(448): AH00826: subcache_size = 15992
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(450): AH00827: subcache_data_offset = 2128
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(452): AH00828: subcache_data_size = 13864
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:debug] [pid 6512:tid 460] mod_socache_shmcb.c(454): AH00829: index_num = 88
[Tue Mar 15 10:31:42.605301 2016] [socache_shmcb:info] [pid 6512:tid 460] AH00830: Shared memory socache initialised
[Tue Mar 15 10:31:43.964716 2016] [mpm_winnt:notice] [pid 6512:tid 460] AH00455: Apache/2.4.12 (Win64) OpenSSL/1.0.1m PHP/5.6.10 configured -- resuming normal operations
[Tue Mar 15 10:31:43.964716 2016] [mpm_winnt:notice] [pid 6512:tid 460] AH00456: Server built: Mar 20 2015 00:36:56
[Tue Mar 15 10:31:43.964716 2016] [mpm_winnt:notice] [pid 6512:tid 460] AH80000: Distributed by: The Apache Haus
[Tue Mar 15 10:31:43.964716 2016] [mpm_winnt:notice] [pid 6512:tid 460] AH80001: Compiled with: Visual Studio 2012
[Tue Mar 15 10:31:43.964716 2016] [core:notice] [pid 6512:tid 460] AH00094: Command line: 'd:\\opt\\Apache24\\bin\\httpd.exe -d D:/opt/Apache24'
[Tue Mar 15 10:31:43.980340 2016] [mpm_winnt:notice] [pid 6512:tid 460] AH00418: Parent: Created child process 12180
[Tue Mar 15 10:31:43.980340 2016] [mpm_winnt:debug] [pid 6512:tid 460] mpm_winnt.c(422): AH00402: Parent: Sent the scoreboard to the child
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(393): AH00821: shmcb_init allocated 512000 bytes of shared memory
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(407): AH00822: for 511944 bytes (512000 including header), recommending 32 subcaches, 88 indexes each
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(444): AH00824: shmcb_init_memory choices follow
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(446): AH00825: subcache_num = 32
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(448): AH00826: subcache_size = 15992
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(450): AH00827: subcache_data_offset = 2128
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(452): AH00828: subcache_data_size = 13864
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:debug] [pid 12180:tid 352] mod_socache_shmcb.c(454): AH00829: index_num = 88
[Tue Mar 15 10:31:44.667865 2016] [socache_shmcb:info] [pid 12180:tid 352] AH00830: Shared memory socache initialised
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(1708): AH00453: Child process is running
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(343): AH00391: Child: Retrieved our scoreboard from the parent.
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(458): AH00403: Child: Waiting for data for listening socket 0.0.0.0:443
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 6512:tid 460] mpm_winnt.c(505): AH00408: Parent: Duplicating socket 428 (0.0.0.0:443) and sending it to child process 12180
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 6512:tid 460] mpm_winnt.c(505): AH00408: Parent: Duplicating socket 424 ([::]:443) and sending it to child process 12180
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 6512:tid 460] mpm_winnt.c(505): AH00408: Parent: Duplicating socket 420 (0.0.0.0:80) and sending it to child process 12180
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 6512:tid 460] mpm_winnt.c(505): AH00408: Parent: Duplicating socket 392 ([::]:80) and sending it to child process 12180
[Tue Mar 15 10:31:45.542876 2016] [mpm_winnt:debug] [pid 6512:tid 460] mpm_winnt.c(524): AH00411: Parent: Sent 4 listeners to child 12180
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(458): AH00403: Child: Waiting for data for listening socket [::]:443
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(458): AH00403: Child: Waiting for data for listening socket 0.0.0.0:80
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(458): AH00403: Child: Waiting for data for listening socket [::]:80
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 352] mpm_winnt.c(483): AH00407: Child: retrieved 4 listeners from parent
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 352] child.c(1021): AH00352: Child: Acquired the start mutex.
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:notice] [pid 12180:tid 352] AH00354: Child: Starting 64 worker threads.
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 1040] child.c(399): AH00334: Child: Accept thread listening on [::]:443 using AcceptFilter data
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 1164] child.c(399): AH00334: Child: Accept thread listening on 0.0.0.0:443 using AcceptFilter data
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 1216] child.c(399): AH00334: Child: Accept thread listening on 0.0.0.0:80 using AcceptFilter data
[Tue Mar 15 10:31:45.558502 2016] [mpm_winnt:debug] [pid 12180:tid 1244] child.c(399): AH00334: Child: Accept thread listening on [::]:80 using AcceptFilter data



Turning to the other restarts, I was checking the windows event viewer and I found this:

Nombre de la aplicación con errores: httpd.exe, versión: 2.4.12.0, marca de tiempo: 0x550bce1a
Nombre del módulo con errores: KERNELBASE.dll, versión: 6.3.9600.18202, marca de tiempo: 0x569e7eb1
Código de excepción: 0xc0000005
Desplazamiento de errores: 0x0000000000008a5c
Id. del proceso con errores: 0x2fbc
Hora de inicio de la aplicación con errores: 0x01d17b81cbc1e8dd
Ruta de acceso de la aplicación con errores: D:\opt\Apache24\bin\httpd.exe
Ruta de acceso del módulo con errores: C:\Windows\system32\KERNELBASE.dll
Id. del informe: c89c7b3b-e779-11e5-8107-005056bb11da


Now, I'll to try load the php as mod_fcgid.

mario

Código de excepción: 0xc0000005

That is an error of access violation. Might be because of the shared memory.

From the debug I see you are usign AcceptFilter

You may try to add the following to httpd.conf

AcceptFilter https none
AcceptFilter http none
EnableSendfile Off
EnableMMAP off