From 39365c53b282f02754302ea78907fc92f901613c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 25 Oct 2023 12:06:34 +0200 Subject: [PATCH 1/4] Improve JIT config in fuzzer SAPI --- sapi/fuzzer/fuzzer-function-jit.c | 3 ++- sapi/fuzzer/fuzzer-tracing-jit.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sapi/fuzzer/fuzzer-function-jit.c b/sapi/fuzzer/fuzzer-function-jit.c index bd99299984ae4..ea8f97f012886 100644 --- a/sapi/fuzzer/fuzzer-function-jit.c +++ b/sapi/fuzzer/fuzzer-function-jit.c @@ -58,7 +58,8 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) { "zend_extension=%s\n" "opcache.validate_timestamps=0\n" "opcache.file_update_protection=0\n" - "opcache.jit_buffer_size=256M", + "opcache.jit_buffer_size=256M" + "opcache.protect_memory=1", opcache_path); free(opcache_path); diff --git a/sapi/fuzzer/fuzzer-tracing-jit.c b/sapi/fuzzer/fuzzer-tracing-jit.c index 7113bf0796913..2a89b4b0537ef 100644 --- a/sapi/fuzzer/fuzzer-tracing-jit.c +++ b/sapi/fuzzer/fuzzer-tracing-jit.c @@ -62,12 +62,18 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) { "zend_extension=%s\n" "opcache.validate_timestamps=0\n" "opcache.file_update_protection=0\n" - "opcache.jit_buffer_size=256M\n" + "opcache.memory_consumption=1024\n" + "opcache.jit_buffer_size=1024M\n" "opcache.jit_hot_func=1\n" "opcache.jit_hot_loop=1\n" "opcache.jit_hot_return=1\n" "opcache.jit_hot_side_exit=1\n" - "opcache.jit_max_root_traces=32768", + "opcache.jit_max_root_traces=100000\n" + "opcache.jit_max_side_traces=100000\n" + "opcache.jit_max_exit_counters=100000\n" + "opcache.jit_blacklist_root_trace=255\n" + "opcache.jit_blacklist_side_trace=255\n" + "opcache.protect_memory=1\n", opcache_path); free(opcache_path); From df6ee531ca5f86a2ba53567abdcee6043b15e906 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 11 Nov 2023 19:25:44 +0100 Subject: [PATCH 2/4] Fix --- sapi/fuzzer/fuzzer-function-jit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/fuzzer/fuzzer-function-jit.c b/sapi/fuzzer/fuzzer-function-jit.c index ea8f97f012886..2510d8b556d03 100644 --- a/sapi/fuzzer/fuzzer-function-jit.c +++ b/sapi/fuzzer/fuzzer-function-jit.c @@ -58,7 +58,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) { "zend_extension=%s\n" "opcache.validate_timestamps=0\n" "opcache.file_update_protection=0\n" - "opcache.jit_buffer_size=256M" + "opcache.jit_buffer_size=128M" "opcache.protect_memory=1", opcache_path); free(opcache_path); From 80c39b9c5cce90aef9f429bba3743925dad04aff Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 11 Nov 2023 19:44:16 +0100 Subject: [PATCH 3/4] Fix --- sapi/fuzzer/fuzzer-tracing-jit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/fuzzer/fuzzer-tracing-jit.c b/sapi/fuzzer/fuzzer-tracing-jit.c index 2a89b4b0537ef..646f2c7b1d6e7 100644 --- a/sapi/fuzzer/fuzzer-tracing-jit.c +++ b/sapi/fuzzer/fuzzer-tracing-jit.c @@ -63,7 +63,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) { "opcache.validate_timestamps=0\n" "opcache.file_update_protection=0\n" "opcache.memory_consumption=1024\n" - "opcache.jit_buffer_size=1024M\n" + "opcache.jit_buffer_size=128M\n" "opcache.jit_hot_func=1\n" "opcache.jit_hot_loop=1\n" "opcache.jit_hot_return=1\n" From 14b193dad7ea8fe124d9bc8a1feefb9713443294 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 13 Nov 2023 15:12:09 +0100 Subject: [PATCH 4/4] Update --- sapi/fuzzer/fuzzer-tracing-jit.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sapi/fuzzer/fuzzer-tracing-jit.c b/sapi/fuzzer/fuzzer-tracing-jit.c index 646f2c7b1d6e7..437938d090278 100644 --- a/sapi/fuzzer/fuzzer-tracing-jit.c +++ b/sapi/fuzzer/fuzzer-tracing-jit.c @@ -71,8 +71,6 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) { "opcache.jit_max_root_traces=100000\n" "opcache.jit_max_side_traces=100000\n" "opcache.jit_max_exit_counters=100000\n" - "opcache.jit_blacklist_root_trace=255\n" - "opcache.jit_blacklist_side_trace=255\n" "opcache.protect_memory=1\n", opcache_path); free(opcache_path);