From 1674c96c0b7ab05809a9a3e51a96901a4c424274 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 1 Dec 2020 16:43:05 +0300 Subject: [PATCH] Bug #80447 (Strange out of memory error when running with JIT) --- NEWS | 1 + ext/opcache/jit/zend_jit_trace.c | 2 +- ext/opcache/tests/jit/bug80447.phpt | 34 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ext/opcache/tests/jit/bug80447.phpt diff --git a/NEWS b/NEWS index a60ed29a1c..695ae7408d 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ PHP NEWS . Fixed bug #80377 (Opcache misses executor_globals). (Nikita) . Fixed bug #80433 (Unable to disable the use of the AVX command when using JIT). (Nikita) + . Bug #80447 (Strange out of memory error when running with JIT). (Dmitry) - OpenSSL: . Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 19db7c54bb..33658f8e86 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -3662,7 +3662,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par zend_jit_label(&dasm_state, 0); /* start of of trace loop */ - if (ra && trace_buffer->stop == ZEND_JIT_TRACE_STOP_LOOP) { + if (ra) { zend_ssa_phi *phi = ssa->blocks[1].phis; while (phi) { diff --git a/ext/opcache/tests/jit/bug80447.phpt b/ext/opcache/tests/jit/bug80447.phpt new file mode 100644 index 0000000000..b09ff5c698 --- /dev/null +++ b/ext/opcache/tests/jit/bug80447.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #80447 (Strange out of memory error when running with JIT) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +opcache.protect_memory=1 +--SKIPIF-- + +--FILE-- +