FS#64799 - [pcre2] --enable-jit-sealloc causes crashes in forking applications, including php scripts

Attached to Project: Arch Linux
Opened by xnor (xnor) - Tuesday, 10 December 2019, 20:08 GMT
Last edited by Pierre Schmitz (Pierre) - Wednesday, 18 December 2019, 19:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
pcre2 PKDBUILD was recently changed to include --enable-jit-sealloc. Not only is this experimental, it's incompatible with fork.

Various php scripts use pcre2 with jit enabled by default and fork, such as the tiny tiny rss update daemon.

Here is the upstream bug report:
https://bugs.php.net/bug.php?id=78927

The title for the recent pcre2 PKGBUILD change is "Fix pcre-jit errors in PHP 7.4 due to MemoryDenyWriteExecute in system unit".
This is not the correct solution.

php-fpm 7.4 ships with MemoryDenyWriteExecute=true in it's service file. If a user wants to use pcre2 jit then he has to disable this (MemoryDenyWriteExecute=false) in the service file.
If you want to work this by default then you should either patch php.ini to default to pcre.jit=0 or patch php-fpm.service to MemoryDenyWriteExecute=falsen
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Wednesday, 18 December 2019, 19:27 GMT
Reason for closing:  Fixed
Comment by Pierre Schmitz (Pierre) - Wednesday, 18 December 2019, 12:53 GMT
PHP 7.4.1 no longer ships with MemoryDenyWriteExecute (and other problematic defaults). I suggest to disable this flag in pcre as PHP crashes regulary atm.
Comment by Pierre Schmitz (Pierre) - Wednesday, 18 December 2019, 14:55 GMT
I have put pcre2 10.34-3 into [testing] that fixes the problem for me.
Comment by xnor (xnor) - Wednesday, 18 December 2019, 18:51 GMT
Thank you. Fyi, I've been running pcre2 recompiled without --enable-jit-sealloc for the past week and haven't had a single php crash since then.

Loading...