Apache crashes with munmap_chunk (): invalid pointer after upgrading to php7 on Jessie

I recently upgraded to php 7.0.4 on my server running Debian 8.

this is what dpkg -l | grep php dpkg -l | grep php gives me:

 ii libapache2-mod-php7.0 7.0.4-1~dotdeb+8.1 amd64 server-side, HTML-embedded scripting language (Apache 2 module) ii php-common 21-1~dotdeb+8.1 all Common files for PHP packages ii php-readline 21-1~dotdeb+8.1 all readline module for PHP [default] ii php7.0 7.0.4-1~dotdeb+8.1 all server-side, HTML-embedded scripting language (metapackage) ii php7.0-cli 7.0.4-1~dotdeb+8.1 amd64 command-line interpreter for the PHP ing language ii php7.0-common 7.0.4-1~dotdeb+8.1 all Common files for packages built from the PHP source ii php7.0-curl 7.0.4-1~dotdeb+8.1 amd64 CURL module for PHP ii php7.0-gd 7.0.4-1~dotdeb+8.1 amd64 GD module for PHP ii php7.0-imap 7.0.4-1~dotdeb+8.1 amd64 IMAP module for PHP ii php7.0-intl 7.0.4-1~dotdeb+8.1 amd64 Internationalisation module for PHP ii php7.0-json 7.0.4-1~dotdeb+8.1 amd64 JSON module for PHP ii php7.0-mcrypt 7.0.4-1~dotdeb+8.1 amd64 libmcrypt module for PHP ii php7.0-mysql 7.0.4-1~dotdeb+8.1 amd64 MySQL module for PHP ii php7.0-opcache 7.0.4-1~dotdeb+8.1 amd64 Zend OpCache module for PHP ii php7.0-readline 7.0.4-1~dotdeb+8.1 amd64 readline module for PHP 

My php applications work fine in most cases. But for some requests, I just get a page that is created for no predictable reason.

In this case, the state is /var/log/apache2/error.log :

 *** Error in `/usr/sbin/apache2': munmap_chunk(): invalid pointer: 0x00007efc6ddb4a50 *** *** Error in `/usr/sbin/apache2': munmap_chunk(): invalid pointer: 0x00007efc6dd5cad0 *** [Wed Mar 09 11:26:44.940931 2016] [core:notice] [pid 28486] AH00052: child pid 29338 exit signal Aborted (6) [Wed Mar 09 11:26:44.941017 2016] [core:notice] [pid 28486] AH00052: child pid 29344 exit signal Aborted (6) *** Error in `/usr/sbin/apache2': munmap_chunk(): invalid pointer: 0x00007efc6dd5cad0 *** [Wed Mar 09 11:26:46.942581 2016] [core:notice] [pid 28486] AH00052: child pid 29347 exit signal Aborted (6) 

I will provide additional information:

Syntax:

 $ apachectl configtest Syntax OK 

Version:

 apachectl -v Server version: Apache/2.4.10 (Debian) Server built: Nov 28 2015 14:05:48 

Before updating php, I did not see these errors. What is wrong here? Or how should I find the source? I got lost here because this error is random. Sometimes the same request fails with this error a minute ago. I would advise you to help.

+7
memory debian apache php-7
source share
4 answers

Now for the second time, we have been hit hard by the same problem.

This happens when running PHP 7.0 on an updated debian. This will disrupt any type of system that reuses a lot of regular expression. We saw this iwth Neos (neos.io) or Typo3 (since 6.2).

If it is not possible to use the test version of libpcre3. Someone may disable compilation during php.ini

  • Edit php.ini add pcre.jit=0 anywhere you like
  • Restart apache
  • be happy
+12
source share

I have the same version and can be solved by updating libpcre3 , as @Kevin Fischer writes.

I updated libpcre3 package form 2: 8.35-3.3 + deb8u4 (stable) to version 2: 8.38-3.1 (testing).

Step by step:

  • Add deb http://ftp.us.debian.org/debian testing main contrib non-free line deb http://ftp.us.debian.org/debian testing main contrib non-free to /etc/apt/sources.list
  • Create the file /etc/apt/apt.conf.d/99default-release with the content: APT::Default-Release "stable";
  • Run apt-get update command from root
  • Run the apt-get -t testing install libpcre3 to install the test version of libpcre3
  • Reboot the server and check the logs, the error should disappear.

For more information on installing the test package, see this question .

A warning! Package testing may not work correctly! Update your own risk or wait for a new release.

+2
source share

We only had a similar situation when one of our infrastructure components could not us:

*** Error in `php': munmap_chunk(): invalid pointer: 0x00007fdce5550060 ***

I can not say anything about the error itself, but the reason for this was a broken version of libpcre3 , namely 8.35-3.3+deb8u4 . We run the custom build because PHP7 requires JIT support from libpcre3, which is not part of the standard version of Ubuntu with the version ( Ubuntu 14.04 LTS, 8.31-2ubuntu2.3 ). Upgrading the libpcre3 version resolved the issue for us.

+1
source share

I also continued to get these nasty Apache crashes, but none of the solutions above and on other sites worked for me. After a lot of trial and error, I found out the root cause of my system. I manually edited the PHP configuration and added two extensions. And for Microsoft SQL Server. I added the following lines in php.ini

 extension=sqlsrv.so extension=pdo_sqlsrv 

I did not notice that I fogot ".so" in the pdo driver. After modifying the strings as shown below, the Apache service works fine again.

 extension=sqlsrv.so extension=pdo_sqlsrv.so 
0
source share

All Articles