Skip to content

JIT tests fail on aarch64 for 8.5beta2 using clang 19, 20, 21 #19601

Closed

Description

@andypost

Description

Building new beta 2 failed lots of JIT tests on arrch64 for Alpinelinux

FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #81272: Segfault in var[] after array_slice with JIT [ext/opcache/tests/bug81272.phpt]
GH-16186 001 (Non-tracing JIT uses Closure scope) [ext/opcache/tests/gh16186_001.phpt]
GH-16186 002 (Non-tracing JIT uses Closure scope) [ext/opcache/tests/gh16186_002.phpt]
JIT ASSIGN_OBJ: Assign undefined vatiable to property [ext/opcache/tests/jit/assign_obj_002.phpt]
JIT BOOL_NOT: 001 Memory leak in case of reference to bool [ext/opcache/tests/jit/bool_not_001.phpt]
Bug #77857 (Wrong result if executed with JIT) [ext/opcache/tests/jit/bug77857.phpt]
Bug #79888 (Incorrect execution with JIT enabled) [ext/opcache/tests/jit/bug79888.phpt]
Bug #80634 (write_property handler of internal classes is skipped on preloaded JITted code) [ext/opcache/tests/jit/bug80634.phpt]
Bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts) [ext/opcache/tests/jit/bug80745.phpt]
Bug #80786: PHP crash using JIT [ext/opcache/tests/jit/bug80786.phpt]
Bug #80802: zend_jit_fetch_indirect_var assert failure with tracing JIT [ext/opcache/tests/jit/bug80802.phpt]
Bug #80839: PHP problem with JIT [ext/opcache/tests/jit/bug80839.phpt]
Bug #80839: PHP problem with JIT [ext/opcache/tests/jit/bug80861.phpt]
Bug #80959: infinite loop in building cfg during JIT compilation [ext/opcache/tests/jit/bug80959.phpt]
Bug #80839: PHP problem with JIT [ext/opcache/tests/jit/bug81051.phpt]
Bug #81225: Wrong result with pow operator with JIT enabled [ext/opcache/tests/jit/bug81225.phpt]
Bug #81225: Wrong result with pow operator with JIT enabled [ext/opcache/tests/jit/bug81225_2.phpt]
Bug #81226: Integer overflow behavior is different with JIT enabled [ext/opcache/tests/jit/bug81226.phpt]
Bug #81249: Intermittent property assignment failure with JIT enabled [ext/opcache/tests/jit/bug81249.phpt]
Bug #81255: Memory leak in PHPUnit with functional JIT [ext/opcache/tests/jit/bug81255.phpt]
Bug #81256: Assertion `zv != ((void *)0)' failed for "preload" with JIT [ext/opcache/tests/jit/bug81256.phpt]
Bug #81409: Incorrect JIT code for ADD with a reference to array [ext/opcache/tests/jit/bug81409.phpt]
JIT CAST: 001 [ext/opcache/tests/jit/cast_001.phpt]
JIT DEFINED: 001 [ext/opcache/tests/jit/defined_001.phpt]
JIT FETCH_DIM_R: 005 [ext/opcache/tests/jit/fetch_dim_r_005.phpt]
JIT: FETCH_OBJ 005 [ext/opcache/tests/jit/fetch_obj_005.phpt]
GH-12380: JIT+private array property access inside closure accesses private property in child class [ext/opcache/tests/jit/gh12380.phpt]
GH-14082 (Segmentation fault on unknown address 0x600000000018 in ext/opcache/jit/zend_jit.c) [ext/opcache/tests/jit/gh14082.phpt]
GH-15490: use-after-free when traversing call graph [ext/opcache/tests/jit/gh15490.phpt]
GH-16984 (function JIT overflow bug) [ext/opcache/tests/jit/gh16984.phpt]
GH-17190 (Assertion failure ext/opcache/jit/ir/ir_gcm.c) [ext/opcache/tests/jit/gh17190.phpt]
GH-18898 (SEGV zend_jit_op_array_hot with property hooks and preloading) - jit 1235 [ext/opcache/tests/jit/gh18898_1.phpt]
GH-18898 (SEGV zend_jit_op_array_hot with property hooks and preloading) - jit 1233 [ext/opcache/tests/jit/gh18898_2.phpt]
GH-18899 (JIT function crash when emitting undefined variable warning and opline is not set yet) [ext/opcache/tests/jit/gh18899.phpt]
Bug GH-8461 001 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8461-001.phpt]
Bug GH-8461 002 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8461-002.phpt]
Bug GH-8461 003 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8461-003.phpt]
Bug GH-8461 004 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8461-004.phpt]
Bug GH-8461 005 (JIT does not account for function re-compile) [ext/opcache/tests/jit/gh8461-005.phpt]
Bug GH-8461 006 (JIT does not account for function re-compile) [ext/opcache/tests/jit/gh8461-006.phpt]
Bug GH-8461 007 (JIT does not account for function re-compile) [ext/opcache/tests/jit/gh8461-007.phpt]
Bug GH-8461 008 (JIT does not account for function re-compile) [ext/opcache/tests/jit/gh8461-008.phpt]
Bug GH-8591 001 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8591-001.phpt]
Bug GH-8591 002 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8591-002.phpt]
Bug GH-8591 003 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8591-003.phpt]
Bug GH-8591 004 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8591-004.phpt]
Bug GH-8591 001 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8591-005.phpt]
Bug GH-8591 001 (JIT does not account for class re-compile) [ext/opcache/tests/jit/gh8591-006.phpt]
JIT HOT_FUNC: 002 [ext/opcache/tests/jit/hot_func_002.phpt]
JIT: ignored opcodes [ext/opcache/tests/jit/ignored_opcodes.phpt]
Leading zero in opcache.jit option [ext/opcache/tests/jit/ini_leading_zero.phpt]
JIT INIT_FCALL: 003 incorrect init fcall guard (fail with tracing JIT and --repeat 3) [ext/opcache/tests/jit/init_fcall_003.phpt]
JIT HOT LOOP: 002 [ext/opcache/tests/jit/loop_002.phpt]
JIT MOD: 003 [ext/opcache/tests/jit/mod_003.phpt]
JIT MUL: 005 exception and SEND optimization [ext/opcache/tests/jit/mul_005.phpt]
oss-fuzz #64727 [ext/opcache/tests/jit/oss-fuzz-64727.phpt]
oss-fuzz #65498 [ext/opcache/tests/jit/oss-fuzz-65498.phpt]
Register Alloction 004: Check guard before register load [ext/opcache/tests/jit/reg_alloc_004.phpt]
JIT Trampoline 001: trampoline cleanup [ext/opcache/tests/jit/trampoline_001.phpt]
JIT Trampoline 002: trampoline cleanup [ext/opcache/tests/jit/trampoline_002.phpt]

PHP Version

8.5beta2

Operating System

Alpinelinux

Activity

  1. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    probably related #19569

  2. iluuu1994 commented on Aug 26, 2025

    @iluuu1994
    Member

    What does the diff say?

  3. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    Mostly returns empty line like

    TEST 10585/19453 [ext/opcache/tests/jit/bug80634.phpt]
    ========DIFF========
    001- Fatal error: Uncaught Error: Cannot modify readonly property DatePeriod::$current in %spreload_bug80634.inc:7
    002- Stack trace:
    003- #0 %sbug80634.php(2): SomeClass->__construct(5)
    004- #1 {main}
    005-   thrown in %spreload_bug80634.inc on line 7
    001+ 
    ========DONE========
    
  4. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    I'm building it using clang 20.1.8

  5. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    maybe this one more informative

    TEST 10633/19453 [ext/opcache/tests/jit/fetch_dim_r_005.phpt]
    ========DIFF========
         Warning: Undefined array key -1 in %sfetch_dim_r_005.php on line 4
    002- 
    003- Warning: Undefined array key -1 in %sfetch_dim_r_005.php on line 4
    004- 
    005- Warning: Undefined array key -1 in %sfetch_dim_r_005.php on line 4
    006- 
    007- Warning: Undefined array key -1 in %sfetch_dim_r_005.php on line 4
    008- 
    009- Warning: Undefined array key -1 in %sfetch_dim_r_005.php on line 4
    010- array(5) {
    011-   [0]=>
    012-   NULL
    013-   [1]=>
    014-   NULL
    015-   [2]=>
    016-   NULL
    017-   [3]=>
    018-   NULL
    019-   [4]=>
    020-   NULL
    021- }
    ========DONE========
    
  6. ndossche commented on Aug 26, 2025

    @ndossche
    Member

    Is this ZTS or no? If you use --enable-debug-assertions, do you get an assertion about the TSRM?
    What was the last version that worked? May be related to opcache now being bundled, my gut tells me this is related to thread local storage.

  7. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    none-zts, gonna add --enable-debug-assertions as it fails only on arch64

  8. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    @nielsdos sadly this argument has no effect

    TEST 10411/19453 [ext/opcache/tests/gh16186_001.phpt]
    ========DIFF========
    001- Warning: Undefined property: stdClass::$x in %s on line %d
    002- object(stdClass)#%d (1) {
    003-   ["x"]=>
    004-   int(2)
    005- }
    001+ 
    ========DONE========
    FAIL GH-16186 001 (Non-tracing JIT uses Closure scope) [ext/opcache/tests/gh16186_001.phpt] 
    TEST 10412/19453 [ext/opcache/tests/gh16186_002.phpt]
    ========DIFF========
    001- Warning: Undefined property: stdClass::$x in %s on line %d
    002- object(stdClass)#%d (1) {
    003-   ["x"]=>
    004-   int(2)
    005- }
    001+ 
    ========DONE========
    FAIL GH-16186 002 (Non-tracing JIT uses Closure scope) [ext/opcache/tests/gh16186_002.phpt] 
    

    a bit more

    TEST 10761/19453 [ext/opcache/tests/jit/hot_func_002.phpt]
    ========DIFF========
         string(5) "hello"
         string(5) "hello"
    003- string(5) "hello"
    ========DONE========
    FAIL JIT HOT_FUNC: 002 [ext/opcache/tests/jit/hot_func_002.phpt] 
    TEST 10762/19453 [ext/opcache/tests/jit/icall_001.phpt]PASS JIT ICALL: 001 [ext/opcache/tests/jit/icall_001.phpt] 
    TEST 10763/19453 [ext/opcache/tests/jit/identical_001.phpt]PASS JIT IDENTICAL: 001 [ext/opcache/tests/jit/identical_001.phpt] 
    TEST 10764/19453 [ext/opcache/tests/jit/identical_002.phpt]PASS JIT IDENTICAL: 002 Comparison with NaN [ext/opcache/tests/jit/identical_002.phpt] 
    TEST 10765/19453 [ext/opcache/tests/jit/identical_003.phpt]PASS JIT IDENTICAL: 003 register allocation [ext/opcache/tests/jit/identical_003.phpt] 
    TEST 10766/19453 [ext/opcache/tests/jit/identical_004.phpt]PASS JIT IDENTICAL: 004 undefined error [ext/opcache/tests/jit/identical_004.phpt] 
    TEST 10767/19453 [ext/opcache/tests/jit/ignored_opcodes.phpt]
    ========DIFF========
         <!-- init '%s' -->
         <file '%s'>
    003-   <!-- opcode: 'ZEND_BEGIN_SILENCE' in user handler -->
    004-   <!-- opcode: 'ZEND_END_SILENCE' in user handler -->
    005-   <!-- init exit() -->
    006-   <exit>
    007-     <!-- Exception: UnwindExit -->
    008-   </exit>
    009-   <!-- Exception: UnwindExit -->
    010- </file '%s'>
    ========DONE========
    FAIL JIT: ignored opcodes [ext/opcache/tests/jit/ignored_opcodes.phpt] 
    
  9. ndossche commented on Aug 26, 2025

    @ndossche
    Member

    And you added that flag to the configure command, right?
    Well I guess this needs a proper debug session. I only ever debugged Alpine+Aarch64 under emulation, which works but is extremely slow. I can maybe take a look tomorrow evening but can't make promises.

  10. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    Yes, added to configure so tomorrow I will try clang19 and gcc (alpine moved to 15.2 but there's some issues building so maybe it's not an option)

  11. iluuu1994 commented on Aug 26, 2025

    @iluuu1994
    Member

    Do the processes crash? Maybe you can run them with Valgrind in CI (run-tests.php -m)? So we an idea of what's going on.

  12. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    I see no crashes, is it enough to add -m to run tests? or needs to install something special?

  13. iluuu1994 commented on Aug 26, 2025

    @iluuu1994
    Member

    Just Valgrind. Yes, that should be it. Note that it's extremely slow, so you want to restrict to the failing tests.

  14. 2 remaining items

  15. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    started, but with --enable-debug0assertion ppc64le also started to fail https://gitlab.alpinelinux.org/alpine/aports/-/jobs/1987524

  16. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    will check tomorrow with fresh head as somehow valgrind is not used(

    EDIT tests running here https://gitlab.alpinelinux.org/alpine/aports/-/jobs/1987681

  17. andypost commented on Aug 26, 2025

    @andypost
    ContributorAuthor

    locally in docker x86-84 fails too

    /mnt/testing/php85 $ TESTS=' --show-diff -m ext/opcache/tests/jit/ignored_opcodes.phpt' abuild check
    
    Build complete.
    Don't forget to run 'make test'.
    
    
    =====================================================================
    PHP         : /mnt/testing/php85/src/php-8.5.0beta2/sapi/cli/php 
    PHP_SAPI    : cli
    PHP_VERSION : 8.5.0beta2
    ZEND_VERSION: 4.5.0-dev
    PHP_OS      : Linux - Linux 98cb65295527 6.14.0-28-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 23 12:05:14 UTC 2025 x86_64
    INI actual  : /mnt/testing/php85/src/php-8.5.0beta2/tmp-php.ini
    More .INIs  :  
    ---------------------------------------------------------------------
    PHP         : /mnt/testing/php85/src/php-8.5.0beta2/sapi/cgi/php-cgi 
    PHP_SAPI    : cgi-fcgi
    PHP_VERSION : 8.5.0beta2
    ZEND_VERSION: 4.5.0-dev
    PHP_OS      : Linux - Linux 98cb65295527 6.14.0-28-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 23 12:05:14 UTC 2025 x86_64
    INI actual  : /mnt/testing/php85/src/php-8.5.0beta2/tmp-php.ini
    More .INIs  : 
    --------------------------------------------------------------------- 
    ---------------------------------------------------------------------
    PHP         : /mnt/testing/php85/src/php-8.5.0beta2/sapi/phpdbg/phpdbg 
    PHP_SAPI    : phpdbg
    PHP_VERSION : 8.5.0beta2
    ZEND_VERSION: 4.5.0-dev
    PHP_OS      : Linux - Linux 98cb65295527 6.14.0-28-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 23 12:05:14 UTC 2025 x86_64
    INI actual  : /mnt/testing/php85/src/php-8.5.0beta2/tmp-php.ini
    More .INIs  : 
    ---------------------------------------------------------------------
    CWD         : /mnt/testing/php85/src/php-8.5.0beta2
    Extra dirs  : 
    VALGRIND    : valgrind-3.25.1 (memcheck)
    =====================================================================
    Running selected tests.
    LEAK JIT: ignored opcodes [ext/opcache/tests/jit/ignored_opcodes.phpt] 
    =====================================================================
    Number of tests :     1                 1
    Tests skipped   :     0 (  0.0%) --------
    Tests warned    :     0 (  0.0%) (  0.0%)
    Tests failed    :     0 (  0.0%) (  0.0%)
    Tests leaked    :     1 (100.0%) (100.0%)
    Tests passed    :     0 (  0.0%) (  0.0%)
    ---------------------------------------------------------------------
    Time taken      : 6.927 seconds
    =====================================================================
    
    =====================================================================
    LEAKED TEST SUMMARY
    ---------------------------------------------------------------------
    JIT: ignored opcodes [ext/opcache/tests/jit/ignored_opcodes.phpt]
    =====================================================================
    make: *** [Makefile:282: test] Error 1
    >>> ERROR: php85: check failed
    

    ignored_opcodes.zip

  18. changed the title [-]JIT tests fail on aarch64 for 8.5beta2[/-] [+]JIT tests fail on aarch64 for 8.5beta2 using clang 19, 20, 21[/+] on Aug 28, 2025
  19. andypost commented on Aug 28, 2025

    @andypost
    ContributorAuthor

    used to build with gcc 15.4 and all tests are passed, so the issue in clang

  20. iluuu1994 commented on Aug 28, 2025

    @iluuu1994
    Member

    Oh, ok. May be related to 73b98a3 then.

  21. added a commit that references this issue on Aug 29, 2025
  22. self-assigned this
    on Aug 29, 2025
  23. arnaud-lb commented on Sep 1, 2025

    @arnaud-lb
    Member

    Fixed, thank you @andypost!

  24. added a commit that references this issue on Sep 1, 2025
    95d52d5
  25. andypost commented on Sep 1, 2025

    @andypost
    ContributorAuthor

    Thank you! now tests on aarch64 running somehow faster)

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions