|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-08-16 00:52 UTC] smokey101stair at gmail dot com
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


Steps to reproduce:
1) git clone
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 ?? ()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-16 08:49 UTC]
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-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 08 13:05:46 2022 UTC