Skip to content

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

Closed

Description

@pfustc

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

Activity

  1. dstogov commented on Nov 2, 2023

    @dstogov
    Member

    Fixed via 77a497d in PHP-8.1 and above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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