Bug #81256 [NEW]: Assertion `zv != ((void *)0)' failed for "preload" with JIT

From: Date: Wed, 14 Jul 2021 03:49:15 +0000
Subject: Bug #81256 [NEW]: Assertion `zv != ((void *)0)' failed for "preload" with JIT
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235013@lists.php.net to get a copy of this message
From:             hao dot sun at arm dot com
Operating system: Ubuntu 20.04
PHP version:      8.1.0alpha3
Package:          JIT
Bug Type:         Bug
Bug description:Assertion `zv != ((void *)0)' failed for "preload" with JIT

Description:
------------
I suppose tracing JIT is tested by the "community_job.yml" in Azure
pipeline in upstream. I further tested with functional JIT.

This bug was found when running the "Symfony demo" with functional JIT,
i.e. opcache.jit=1205, in NTS+DEBUG+HYBRID+ASAN.

Note: this bug only occurred in HYBRID VM mode, not CALL VM mode.
Note: this bug occurred in both JIT/arm64 and JIT/x86.
Note: this bug occurred with ZEND_JIT_LEVEL_OPT_SCRIPT optimization
level. If we run the test with "opcache.jit=1255", this bug showed up as
well.

Here is the error msg:
# php -d
opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php
public/index.php
php: /opt/php-8.1.0alpha3/Zend/zend_vm_execute.h:62757:
zend_get_opcode_handler_func: Assertion `zv != ((void *)0)' failed.


One child process would be created to preload the scripts (See function
accel_finish_startup()) and zend_jit_script() would be invoked under
ZEND_JIT_LEVEL_OPT_SCRIPT.
The assertion occurs when generating the JIT code.

Here the backtrace info for this child process.

(gdb) bt
#0  0x00007ffff568a18b in raise () from
/usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff5669859 in abort () from
/usr/lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff5669729 in ?? () from
/usr/lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff567af36 in __assert_fail () from
/usr/lib/x86_64-linux-gnu/libc.so.6
#4  0x0000555556f9b22e in zend_get_opcode_handler_func (op=0x41af3f48)
at /opt/php-8.1.0alpha3/Zend/zend_vm_execute.h:62757
#5  0x00007fffefcd55eb in zend_jit_handler (Dst=0x7fffffffdc60,
opline=0x41af3f48, may_throw=1) at
/opt/php-8.1.0alpha3/ext/opcache/jit/zend_jit_x86.dasc:3649
#6  0x00007fffefda686d in zend_jit (op_array=0x41af3d78,
ssa=0x6120001659e8, rt_opline=0x0) at
/opt/php-8.1.0alpha3/ext/opcache/jit/zend_jit.c:4040
#7  0x00007fffefe1d8c5 in zend_jit_script (script=0x41b01e40) at
/opt/php-8.1.0alpha3/ext/opcache/jit/zend_jit.c:4511
#8  0x00007fffefc5d4c2 in zend_accel_script_persist (script=0x41b01e40,
for_shm=1) at /opt/php-8.1.0alpha3/ext/opcache/zend_persist.c:1379
#9  0x00007fffefc34619 in preload_script_in_shared_memory
(new_persistent_script=0x615000069800) at
/opt/php-8.1.0alpha3/ext/opcache/ZendAccelerator.c:4423
#10 0x00007fffefc38442 in accel_preload (config=0x607000000b98
"var/cache/dev/App_KernelDevDebugContainer.preload.php", in_child=true)
    at /opt/php-8.1.0alpha3/ext/opcache/ZendAccelerator.c:4840
#11 0x00007fffefc395c1 in accel_finish_startup () at
/opt/php-8.1.0alpha3/ext/opcache/ZendAccelerator.c:5038
#12 0x00007fffefc2b39b in accel_post_startup () at
/opt/php-8.1.0alpha3/ext/opcache/ZendAccelerator.c:3309
#13 0x0000555556dae1d3 in zend_post_startup () at
/opt/php-8.1.0alpha3/Zend/zend.c:1078
#14 0x0000555556c46c9c in php_module_startup (sf=0x5555588bd720
<cli_sapi_module>, additional_modules=0x0, num_additional_modules=0) at
/opt/php-8.1.0alpha3/main/main.c:2277
#15 0x0000555557166405 in php_cli_startup (sapi_module=0x5555588bd720
<cli_sapi_module>) at /opt/php-8.1.0alpha3/sapi/cli/php_cli.c:409
#16 0x000055555716aa36 in main (argc=4, argv=0x604000000250) at
/opt/php-8.1.0alpha3/sapi/cli/php_cli.c:1333



Test script:
---------------
Following the "community_job.xml", download "Symfony" test case, prepare
the "Symfony_demo" and 

run "php -d
opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php
public/index.php"

The version of Symfony I used is 

commit 39e9d75c95598d6e09428f201f6f1921a40503f5
Author: Nicolas Grekas <nicolas.grekas@gmail.com>
Date:   Mon Jul 12 16:15:46 2021 +0200

    Merge branch '5.3' into 5.4
    
    * 5.3:
      skip Bootstrap 4 tests that do not apply to the Bootstrap 5 form
theme


-- 
Edit bug report at https://bugs.php.net/bug.php?id=81256&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81256&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81256&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81256&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81256&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81256&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81256&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81256&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81256&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81256&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81256&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81256&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81256&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81256&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81256&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81256&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81256&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81256&r=mysqlcfg


Thread (5 messages)

« previous php.bugs (#235013) next »