Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/apk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ runs:
set -x
OPCACHE_TLS_TESTS_DEPS="clang gcc binutils-gold lld"
# compiler-rt provides libclang_rt.asan-x86_64.a for clang20
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.22
ASAN_DEPS="clang20 compiler-rt"
apk update -q
apk add \
Expand Down Expand Up @@ -52,8 +55,9 @@ runs:
net-snmp-dev \
openldap-dev \
unixodbc-dev \
postgresql14-dev \
postgresql-dev \
tzdata \
musl-locales \
musl-locales-lang \
$OPCACHE_TLS_TESTS_DEPS
$OPCACHE_TLS_TESTS_DEPS \
$ASAN_DEPS
13 changes: 4 additions & 9 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,16 @@ jobs:
ALPINE:
if: inputs.run_alpine
name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: 'alpine:3.20.1'
image: 'alpine:3.22'
steps:
- name: git checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: apk
uses: ./.github/actions/apk
- name: LLVM 17 (ASAN-only)
# libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17:
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20
run: |
apk add clang17 compiler-rt
- name: System info
run: |
echo "::group::Show host CPU info"
Expand All @@ -122,8 +117,8 @@ jobs:
configurationParameters: >-
CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC"
LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function"
CC=clang-17
CXX=clang++-17
CC=clang-20
CXX=clang++-20
--enable-debug
--enable-zts
skipSlow: true # FIXME: This should likely include slow extensions
Expand Down
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_func_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define ZEND_FUNC_JIT_ON_PROF_REQUEST (1<<14) /* used by JIT */
#define ZEND_FUNC_JIT_ON_HOT_COUNTERS (1<<15) /* used by JIT */
#define ZEND_FUNC_JIT_ON_HOT_TRACE (1<<16) /* used by JIT */

#define ZEND_FUNC_JITED (1<<17) /* used by JIT */

typedef struct _zend_func_info zend_func_info;
typedef struct _zend_call_info zend_call_info;
Expand Down
10 changes: 7 additions & 3 deletions ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3098,8 +3098,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV zend_runtime_jit(Z
bool do_bailout = 0;

zend_shared_alloc_lock();
jit_extension = (zend_jit_op_array_extension*)ZEND_FUNC_INFO(op_array);

if (ZEND_FUNC_INFO(op_array)) {
if (jit_extension && !(jit_extension->func_info.flags & ZEND_FUNC_JITED)) {

SHM_UNPROTECT();
zend_jit_unprotect();
Expand All @@ -3111,11 +3112,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV zend_runtime_jit(Z
opline++;
}
}
jit_extension = (zend_jit_op_array_extension*)ZEND_FUNC_INFO(op_array);
((zend_op*)opline)->handler = jit_extension->orig_handler;

/* perform real JIT for this function */
zend_real_jit_func(op_array, NULL, NULL, ZEND_JIT_ON_FIRST_EXEC);

jit_extension->func_info.flags |= ZEND_FUNC_JITED;
} zend_catch {
do_bailout = true;
} zend_end_try();
Expand Down Expand Up @@ -3182,7 +3184,7 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend
zend_shared_alloc_lock();
jit_extension = (zend_jit_op_array_hot_extension*)ZEND_FUNC_INFO(op_array);

if (jit_extension) {
if (jit_extension && !(jit_extension->func_info.flags & ZEND_FUNC_JITED)) {
SHM_UNPROTECT();
zend_jit_unprotect();

Expand All @@ -3195,6 +3197,8 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend

/* perform real JIT for this function */
zend_real_jit_func(op_array, NULL, opline, ZEND_JIT_ON_HOT_COUNTERS);

jit_extension->func_info.flags |= ZEND_FUNC_JITED;
} zend_catch {
do_bailout = 1;
} zend_end_try();
Expand Down
Loading