php-src icon indicating copy to clipboard operation
php-src copied to clipboard

opcache crashes on Ubuntu 21.10 - php 8.0.8 (segfault) both within apache2 and cli

Open pk-fr opened this issue 4 years ago • 7 comments

Description

The following code:

<?php

echo "before<br>";
include "obfuscated.php";
echo "after<br>";

?>

obfuscated.php file is here : https://3v4l.org/EUeM7

Normal output with opcache disabled is :

before
after

with opcache enabled and cli:

php test.php 
before<br>Segfault (core dumped)

with opcache enabled and apache : connexion reset within the browser... [core:notice] [pid 374147] AH00051: child pid 374181 exit signal Segmentation fault (11), possible coredump in /etc/apache2

PHP Version

PHP 8.0.8

Operating System

Ubuntu 21.10

pk-fr avatar Mar 12 '22 17:03 pk-fr

is there any specific opcache setting involved (e.g. JIT) ? would it be possible to see if this still crash with, for example, the 8.0.16 release ? Did you only try with the obfuscated version of your code ?

devnexen avatar Mar 12 '22 18:03 devnexen

no specific opcache settings with my cli version , only opcache.enable_cli=1

I have no system with other php version to test with..

I'm the developer of the https://github.com/pk-fr/yakpro-po Obfuscator...

The problem occurs only whith it's Shuffles Statements option which randomize code statements ordering by inserting a goto to the next logical statement to keep the same code workflow.

pk-fr avatar Mar 12 '22 19:03 pk-fr

PHP 8.0.8 is a quite old patch release. I can't reproduce this with a current PHP 8.0 build.

nikic avatar Mar 12 '22 20:03 nikic

I could not reproduce it with PHP 8.0.16 build from source nor with the 8.1.2 package version provided by ubuntu 22.04.

devnexen avatar Mar 12 '22 20:03 devnexen

I am currently migrating my dedicated server as my old one is at end of life and will be desactivated at the end ot this month... I was on Ubuntu 16.04 LTS php 7.0 and I took the newest ubunntu release available which is 21.10 with php 8.0.8

I hope I will migrate in a few months to Ubuntu 22.04 LTS with php8.1...

but anyway, there is a problem on my Ubuntu 21.10 which is officially supported until July 2022... ( 4 months... )

pk-fr avatar Mar 12 '22 20:03 pk-fr

In that case you need to report this on the Ubuntu bugtracker, so they can backport whatever patch is necessary. Or you could use the ondrej PPA and get a recent PHP version.

In any case, I don't think there's anything actionable here from our side, but please do let us know if you still see an issue on a current patch release.

nikic avatar Mar 12 '22 20:03 nikic

For your information, I just made 2 tests within 2 new VMs ...

  • with Ubuntu 21.10 php 8.0.8 : bug occurs...
  • with Ubuntu 22.04 alpha php 8.1.0 : no bug!

I will report it tomorrow to Ubuntu bugtracker as @nikic suggested ;)

pk-fr avatar Mar 12 '22 21:03 pk-fr