Skip to content

Duplicate and incorrect E_ERROR messages are printed with opcache.jit=1125 #12597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pfustc opened this issue Nov 2, 2023 · 1 comment
Closed

Comments

@pfustc
Copy link
Contributor

pfustc commented Nov 2, 2023

Description

With below INI

opcache.enable_cli=1
opcache.jit=1125
opcache.jit_buffer_size=16M

The following code:

<?php

function test() {
	$k = 1;
	return function () use ($k) {
		foo();
	};
}

ini_set('memory_limit', '2M');

$array = [];
for ($i = 0; $i < 10_000; $i++) {
	$array[] = test();
}

?>

Resulted in this output:

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes) in /mnt/local/www/index.php on line 5

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0

But I expected this output instead:

PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 12288 bytes) in /mnt/local/www/index.php on line 4

PHP Version

PHP master @ 95c8ad2

Operating System

Ubuntu 22.04

@dstogov
Copy link
Member

dstogov commented Nov 2, 2023

Fixed via 77a497d in PHP-8.1 and above

@dstogov dstogov closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants