php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81363 Segfault running PHPStan tests with JIT triggers assertion
Submitted: 2021-08-16 00:52 UTC Modified: 2021-08-16 08:49 UTC
From: smokey101stair at gmail dot com Assigned:
Status: Open Package: JIT
PHP Version: 8.0.9 OS: Ubuntu 20.04/WSL2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: smokey101stair at gmail dot com
New email:
PHP Version: OS:

 

 [2021-08-16 00:52 UTC] smokey101stair at gmail dot com
Description:
------------
PHP segfaults while running the PHPStan testsuite with the JIT enabled.

PHP 8.0.9 (cli) (built: Aug 14 2021 16:31:22) ( NTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.9, Copyright (c), by Zend Technologies


opcache.enable_cli=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.jit=1255
opcache.jit_buffer_size=256M
memory_limit=-1

Steps to reproduce:
1) git clone https://github.com/phpstan/phpstan-src.git
2) cd phpstan-src
3) composer install
4) make tests


Actual result:
--------------
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fcf9c21f859 in __GI_abort () at abort.c:79
#2  0x00007fcf9c21f729 in __assert_fail_base (fmt=0x7fcf9c3b5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x7fcf993cc6fc "info & (1 << type)", file=0x7fcf993cc3d0 "ext/opcache/jit/zend_jit_trace.c", line=340,
    function=<optimized out>) at assert.c:92
#3  0x00007fcf9c230f36 in __GI___assert_fail (assertion=0x7fcf993cc6fc "info & (1 << type)",
    file=0x7fcf993cc3d0 "ext/opcache/jit/zend_jit_trace.c", line=340,
    function=0x7fcf993cedd0 <__PRETTY_FUNCTION__.29615> "zend_jit_trace_type_to_info_ex") at assert.c:101
#4  0x00007fcf99376e18 in zend_jit_trace_type_to_info_ex (type=0 '\000', info=2164258944)
    at ext/opcache/jit/zend_jit_trace.c:340
#5  0x00007fcf99377012 in zend_jit_trace_add_op_guard (tssa=0x7fcf9739e0d0, ssa_var=2, op_type=0 '\000')
    at ext/opcache/jit/zend_jit_trace.c:379
#6  0x00007fcf9937c186 in zend_jit_trace_build_tssa (trace_buffer=0x7ffc7ea4c460, parent_trace=0, exit_num=0,
    script=0x0, op_arrays=0x7ffc7ea48240, num_op_arrays_ptr=0x7ffc7ea47fb0) at ext/opcache/jit/zend_jit_trace.c:1677
#7  0x00007fcf99385835 in zend_jit_trace (trace_buffer=0x7ffc7ea4c460, parent_trace=0, exit_num=0)
    at ext/opcache/jit/zend_jit_trace.c:3563
#8  0x00007fcf9939f56b in zend_jit_compile_root_trace (trace_buffer=0x7ffc7ea4c460, opline=0x4349a2d8, offset=5280)
    at ext/opcache/jit/zend_jit_trace.c:6510
#9  0x00007fcf993a1575 in zend_jit_trace_hot_root (execute_data=0x7fcf99417780, opline=0x4349a2d8)
    at ext/opcache/jit/zend_jit_trace.c:7003
#10 0x00000000517755c7 in ?? ()
#11 0x0000000000000000 in ?? ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-16 08:49 UTC] nikic@php.net
When using vendor/bin/phpunit, I'm not seeing an assertion failure, but see a lot of "Error: Class "PHPStan\Analyser\Analyser" not found" errors when running with opcache (without jit).

Is it possible to reproduce this without paratest?
 [2021-08-16 16:25 UTC] smokey101stair at gmail dot com
I am unable to reproduce when only using vendor/bin/phpunit.

As for the "Error: Class "PHPStan\Analyser\Analyser" problem, I got that too after a second run. I had to clear out the test cache to fix it:

rm -rf /tmp/phpstan-tests/cache/nette.configurator/*
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 18:03:35 2021 UTC