Skip to content

8.5beta1 JIT: zend_mm_heap corrupted error #19486

@tbali0524

Description

@tbali0524

Description

The following code:

// see attached file

[hard_cg_surface2.php](https://github.com/user-attachments/files/21791424/hard_cg_surface2.php)

Resulted in this output:

"zend_mm_heap corrupted" output in stderr

But I expected this output instead:

"359997" output in stdout

Note: the code works with 8.4.11 (JIT OFF and ON) and with 8.5.beta1 (JIT OFF), so only 8.5 JIT fails (including alpha1, alpha 4, beta1)
The test case is very heavy on recursion so this might be a JIT memory problem.
Interestingly with a slight modification (see source) I could get "Implicit conversion from float 2.67E-322 to int loses precision" warning which might be an arithmethic problem in JIT (as there is no float in code, only integers).
With some smaller test cases where recusrion is not this deep, the code works fine also with 8.5.beta1 (JIT ON).

php.ini settings (all other opcache setting on default):

opcache.enable = 1
opcache.enable_cli = 1
opcache.jit_buffer_size = 256M
opcache.jit = tracing

PHP Version

PHP 8.5.0-dev (cli) (built: Aug 12 2025 15:24:05) (ZTS Visual C++ 2022 x64)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0-dev, Copyright (c), by Zend Technologies

Operating System

Windows 11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions