Skip to content

Assertion `jit->ra[var].flags & (1<<0)' failed #16837

Closed

Description

@danog

Description

Got the following assertion when running multiple Psalm unit tests:

ext/opcache/jit/zend_jit_ir.c:1386: zend_jit_use_reg: Assertion `jit->ra[var].flags & (1<<0)' failed.

Config is in #12406, reproducer command is:

php --repeat 2 -f .github/jit_check.php /tmp/psalm/vendor/bin/phpunit /tmp/psalm/tests/LanguageServer/FileMapTest.php

PHP Version

nightly

Operating System

No response

Activity

  1. iluuu1994 commented on Nov 18, 2024

    @iluuu1994
    Member
  2. dstogov commented on Nov 19, 2024

    @dstogov
    Member

    This may be fixed via ef5844a

    I wasn't able to reproduce the reported assertion, but got a crash instead.
    The commit above fixed the crash. Assertion is not reproducible.

  3. danog commented on Nov 20, 2024

    @danog
    ContributorAuthor

    @dstogov Thanks! Seems okay, but still getting some segfaults on tests/AnnotationTest.php and several others (currently testing on arm64).

    Reproduce by cloning and running php .github/nightly.php with the following ini:

    memory_limit = -1
    zend.assertions = 1
    display_errors = On
    display_startup_errors = On
    
    [opcache]
    zend_extension=opcache.so
    
    opcache.memory_consumption=4096M
    opcache.enable=1
    opcache.enable_cli=1
    opcache.jit=tracing
    opcache.validate_timestamps=0
    opcache.jit_buffer_size=128M
    opcache.file_update_protection=0
    opcache.max_accelerated_files=1000000
    opcache.interned_strings_buffer=64
    
    opcache.jit_prof_threshold=0.000000001
    opcache.jit_max_root_traces=  100000
    opcache.jit_max_side_traces=  100000
    opcache.jit_max_exit_counters=100000
    opcache.jit_hot_loop=1
    opcache.jit_hot_func=1
    opcache.jit_hot_return=1
    opcache.jit_hot_side_exit=1
    
    opcache.jit_blacklist_root_trace=255
    opcache.jit_blacklist_side_trace=255
    
    opcache.protect_memory=1
    
    
  4. danog commented on Nov 21, 2024

    @danog
    ContributorAuthor

    @dstogov Sorry, I meant to link the repo https://github.com/danog/php-src for the reproducer :)

    Reproduce by cloning https://github.com/danog/php-src and running php .github/nightly.php with the following ini:

    memory_limit = -1
    zend.assertions = 1
    display_errors = On
    display_startup_errors = On
    
    [opcache]
    zend_extension=opcache.so
    
    opcache.memory_consumption=4096M
    opcache.enable=1
    opcache.enable_cli=1
    opcache.jit=tracing
    opcache.validate_timestamps=0
    opcache.jit_buffer_size=128M
    opcache.file_update_protection=0
    opcache.max_accelerated_files=1000000
    opcache.interned_strings_buffer=64
    
    opcache.jit_prof_threshold=0.000000001
    opcache.jit_max_root_traces=  100000
    opcache.jit_max_side_traces=  100000
    opcache.jit_max_exit_counters=100000
    opcache.jit_hot_loop=1
    opcache.jit_hot_func=1
    opcache.jit_hot_return=1
    opcache.jit_hot_side_exit=1
    
    opcache.jit_blacklist_root_trace=255
    opcache.jit_blacklist_side_trace=255
    
    opcache.protect_memory=1
    
    
  5. dstogov commented on Nov 25, 2024

    @dstogov
    Member

    I don't have ARM and I can't reproduce this on x86_64 running php --repeat 2 vendor/bin/phpunit tests/AnnotationTest.php. Running this under QEMU would take hours. I need a reduced teat case.

  6. danog commented on Nov 25, 2024

    @danog
    ContributorAuthor

    @dstogov Okay, will try whipping up something once I have some time!

    In the meantime, could you also take a look at the some JIT-related issues I recently created?

    #16913 #16856 #16821

  7. self-assigned this
    on Nov 25, 2024
  8. dstogov commented on Nov 26, 2024

    @dstogov
    Member

    This one is fixed. Please open a new issue for AnnotationTest.php (reproducible jit_bugs scenario would help).

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