Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #203760 from NixOS/backport-203634-to-release-22.11

[Backport release-22.11] php8*: disable PCRE2 JIT SEAlloc to avoid crashes when forking

authored by Elis Hirwing and committed by GitHub d41e186f 596a8e82

Changed files
+16 -6
nixos
tests
php
pkgs
top-level
+13 -3
nixos/tests/php/pcre.nix
··· 1 1 let 2 2 testString = "can-use-subgroups"; 3 3 in 4 - import ../make-test-python.nix ({ lib, php, ... }: { 4 + import ../make-test-python.nix ({ pkgs, lib, php, ... }: { 5 5 name = "php-${php.version}-httpd-pcre-jit-test"; 6 6 meta.maintainers = lib.teams.php.members; 7 7 ··· 31 31 ''; 32 32 }; 33 33 }; 34 - testScript = { ... }: 35 - '' 34 + testScript = let 35 + # PCRE JIT SEAlloc feature does not play well with fork() 36 + # The feature needs to either be disabled or PHP configured correctly 37 + # More information in https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630 38 + pcreJitSeallocForkIssue = pkgs.writeText "pcre-jit-sealloc-issue.php" '' 39 + <?php 40 + preg_match('/nixos/', 'nixos'); 41 + $pid = pcntl_fork(); 42 + pcntl_wait($pid); 43 + ''; 44 + in '' 36 45 machine.wait_for_unit("httpd.service") 37 46 # Ensure php evaluation by matching on the var_dump syntax 38 47 response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/index.php") 39 48 expected = 'string(${toString (builtins.stringLength testString)}) "${testString}"' 40 49 assert expected in response, "Does not appear to be able to use subgroups." 50 + machine.succeed("${php}/bin/php -f ${pcreJitSeallocForkIssue}") 41 51 ''; 42 52 })
+3 -3
pkgs/top-level/all-packages.nix
··· 15762 15762 php82 = callPackage ../development/interpreters/php/8.2.nix { 15763 15763 stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv; 15764 15764 pcre2 = pcre2.override { 15765 - withJitSealloc = !stdenv.isDarwin; 15765 + withJitSealloc = false; # See https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630 15766 15766 }; 15767 15767 }; 15768 15768 php82Extensions = recurseIntoAttrs php82.extensions; ··· 15772 15772 php81 = callPackage ../development/interpreters/php/8.1.nix { 15773 15773 stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv; 15774 15774 pcre2 = pcre2.override { 15775 - withJitSealloc = !stdenv.isDarwin; 15775 + withJitSealloc = false; # See https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630 15776 15776 }; 15777 15777 }; 15778 15778 php81Extensions = recurseIntoAttrs php81.extensions; ··· 15782 15782 php80 = callPackage ../development/interpreters/php/8.0.nix { 15783 15783 stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv; 15784 15784 pcre2 = pcre2.override { 15785 - withJitSealloc = !stdenv.isDarwin; 15785 + withJitSealloc = false; # See https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630 15786 15786 }; 15787 15787 }; 15788 15788 php80Extensions = recurseIntoAttrs php80.extensions;