Skip to content

JIT buffer relocation fails with 64bit packing #11265

Closed
@LoongT4o

Description

@LoongT4o

Description

JIT buffer relocation failed when WordPress workload is running with 64bit packing.

64bit packing places PHP and its libraries together at 64b memory space by using Ubuntu-native dynamic loader while executing php-fpm program, e.g. /lib64/ld-linux-x86-64.so.2 /usr/local/sbin/php-fpm
Here is the maps of php-fpm:

40000000-48000000 rw-s 00000000 00:0f 38927338  /anon_hugepage (deleted)
48000000-49400000 r-xs 08000000 00:0f 38927338  /anon_hugepage (deleted)
7ffff6dae000-7ffff6ea6000 r--p 00000000 08:02 11538447  /usr/local/sbin/php-fpm
7ffff6ea6000-7ffff6fae000 ---p 000f8000 08:02 11538447  /usr/local/sbin/php-fpm
7ffff6fae000-7ffff735c000 r-xp 00200000 08:02 11538447  /usr/local/sbin/php-fpm

We can see that the memory address distance between opcache/JIT buffer and PHP .text segment is greater than 4GB.
Actually, there is an available free segment between 49400000 and 7ffff6dae000 to place the JIT buffer to meet the 4GB distance requirement.

Patch #8890 's method is to traverse each free memory segment, and then verify whether the candidate at the beginning of the current segment meets the requirements (that is, from the end address of the last non-free memory segment). However, if the address range of the current free segment is large, the algorithm may fail to find candidates (the address of the second half of the current free segment may meet the 4GB requirement).

PHP Version

PHP 8.2

Operating System

Ubuntu22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions