Skip to content

Fix asan jit #8711

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
wants to merge 2 commits into from
Closed
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
19 changes: 15 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ jobs:
fail-fast: false
matrix:
include:
- debug: true
zts: false
- debug: false
# - debug: true
# zts: false
# - debug: false
# zts: true
- configuration_parameters: "CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'"
debug: true
name: '_ASAN_UBSAN'
run_tests_parameters: '--asan'
zts: true
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
name: "LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-20.04
steps:
- name: git checkout
Expand All @@ -40,6 +45,7 @@ jobs:
uses: ./.github/actions/configure-x64
with:
configurationParameters: >-
${{ matrix.configuration_parameters }}
--${{ matrix.debug && 'enable' || 'disable' }}-debug
--${{ matrix.zts && 'enable' || 'disable' }}-zts
- name: make
Expand All @@ -50,16 +56,21 @@ jobs:
uses: ./.github/actions/setup-x64
- name: Test
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
- name: Test Tracing JIT
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-d opcache.jit_buffer_size=16M
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
MACOS_DEBUG_NTS:
if: false
runs-on: macos-10.15
steps:
- name: git checkout
Expand Down
2 changes: 0 additions & 2 deletions ext/opcache/jit/dynasm/dasm_x86.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,6 @@ local map_op = {
rep_0 = "F3",
repe_0 = "F3",
repz_0 = "F3",
endbr32_0 = "F30F1EFB",
endbr64_0 = "F30F1EFA",
-- F4: *hlt
cmc_0 = "F5",
-- F6: test... mb,i; div... mb
Expand Down
13 changes: 0 additions & 13 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -1623,16 +1623,6 @@ static size_t tsrm_tls_offset;
|| }
|.endmacro

|.macro ENDBR
||#if defined (__CET__) && (__CET__ & 1) != 0
| .if X64
| endbr64
| .else
| endbr32
| .endif
||#endif
|.endmacro

static bool reuse_ip = 0;
static bool delayed_call_chain = 0;
static uint32_t delayed_call_level = 0;
Expand Down Expand Up @@ -2302,7 +2292,6 @@ static int zend_jit_hybrid_hot_code_stub(dasm_State **Dst)
*/
static int zend_jit_hybrid_hot_counter_stub(dasm_State **Dst, uint32_t cost)
{
| ENDBR
| mov r0, EX->func
| mov r1, aword [r0 + offsetof(zend_op_array, reserved[zend_func_info_rid])]
| mov r2, aword [r1 + offsetof(zend_jit_op_array_hot_extension, counter)]
Expand Down Expand Up @@ -2373,7 +2362,6 @@ static int zend_jit_hybrid_hot_trace_stub(dasm_State **Dst)

static int zend_jit_hybrid_trace_counter_stub(dasm_State **Dst, uint32_t cost)
{
| ENDBR
| mov r0, EX->func
| mov r1, aword [r0 + offsetof(zend_op_array, reserved[zend_func_info_rid])]
| mov r1, aword [r1 + offsetof(zend_jit_op_array_trace_extension, offset)]
Expand Down Expand Up @@ -3061,7 +3049,6 @@ static int zend_jit_align_func(dasm_State **Dst)

static int zend_jit_prologue(dasm_State **Dst)
{
| ENDBR
if (zend_jit_vm_kind == ZEND_VM_KIND_HYBRID) {
| SUB_HYBRID_SPAD
} else if (GCC_GLOBAL_REGS) {
Expand Down