php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79550 Reloading the httpd service repeatedly causes a memory corruption error.
Submitted: 2020-05-01 07:33 UTC Modified: 2021-03-14 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: kitagawa at sraoss dot co dot jp Assigned: cmb (profile)
Status: No Feedback Package: Apache2 related
PHP Version: 7.3.17 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kitagawa at sraoss dot co dot jp
New email:
PHP Version: OS:

 

 [2020-05-01 07:33 UTC] kitagawa at sraoss dot co dot jp
Description:
------------
Hi,

I'm running Apache 2.4.41 on CentOS 6.4 server.

There was a problem (memory corruption),
when graceful reloading the httpd service many times.

The version of each app is as follows:
 - httpd-2.4.41
 - apr-1.5.2
 - apr-util-1.5.4
 - php-7.3.4

The following steps will cause the problem.

 # cat /opt/httpd/htdocs/index.php
 ------
 <?php
 phpinfo();
 ?>
 ------

 # /etc/init.d/httpd start
 Starting httpd:                                            [  OK  ]


Display phpinfo() in your browser and check that it is working.
 http://localhost/index.php


Now, when I run the following script, an error occurs (about 1023 times).

 # for i in $(seq 1030) ; do echo $i; /opt/httpd/bin/httpd -k graceful;  done

 # less /opt/httpd/log/error_log
 ・・・・
 [XXX XXX XX 16:05:23.261688 2020] [mpm_prefork:notice] [pid 2875] AH00171: Graceful restart requested, doing restart
 *** glibc detected *** /opt/httpd/bin/httpd: malloc(): memory corruption: 0x00000000021a4010 ***
 *** glibc detected *** /opt/httpd/bin/httpd: malloc(): memory corruption: 0x00000000021a4010 ***



This bug occurs when loading the libphp7.so module.
Different libphp7.so versions have the same result.
But that doesn't happen with the libphp5.so module.
It occurs on CentOS 7 as well as CentOS 6.

Thanks,
Regards.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-01 08:25 UTC] bugreports at gmail dot com
chck out which extensions are loaded, on Fedora for some time "imap.so" loaded had a similar result so that i switched to restart instead of reload on machins which need it
 [2020-05-07 02:10 UTC] kitagawa at sraoss dot co dot jp
Thank you for your comment.
Did a similar problem occur with "imap.so"?

Currently, we continue to provide services including restart, 
but we want to restart and operate as safely as possible.

Also, there are many servers that are graceful restart all over the world(including logrotate),
so I would like to ask for a fundamental response.
 [2021-03-04 12:38 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-03-04 12:38 UTC] cmb@php.net
If that memory corruption still happens for you with any of the
actively supported PHP versions[1], we would at least need a stack
backtrace[2] to have a chance to resolve the issue.

[1] <https://www.php.net/supported-versions.php>
[2] <https://bugs.php.net/bugs-generating-backtrace.php>
 [2021-03-14 04:22 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 "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 21 19:01:26 2021 UTC