Bug #79179 [NEW]: Segfault with autoloading interface
| From: | arne at arne-groskurth dot eu | Date: | Mon, 27 Jan 2020 21:02:31 +0000 |
| Subject: | Bug #79179 [NEW]: Segfault with autoloading interface | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225170@lists.php.net to get a copy of this message | ||
From: arne at arne-groskurth dot eu
Operating system: Ubuntu 19.10
PHP version: 7.4.2
Package: Reproducible crash
Bug Type: Bug
Bug description:Segfault with autoloading interface
Description:
------------
(gdb) run test.php
Starting program: /home/arne/Downloads/php-7.4.2/sapi/cli/php test.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
65 ../sysdeps/x86_64/multiarch/strlen-avx2.S: File or directory not
found.
(gdb) bt
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
#1 0x0000555555bd57fa in zend_get_function_declaration
(fptr=0x7fffffffa1c0) at
/home/arne/Downloads/php-7.4.2/Zend/zend_inheritance.c:568
#2 0x0000555555bd5e2d in emit_incompatible_method_error
(error_level=64, error_verb=0x55555640d06b "must", child=0x7ffff5802908,
parent=0x7fffffffa1c0, status=INHERITANCE_ERROR,
unresolved_class=0x7ffff58029f0)
at /home/arne/Downloads/php-7.4.2/Zend/zend_inheritance.c:691
#3 0x0000555555bd5ff2 in emit_incompatible_method_error_or_warning
(child=0x7ffff5802908, parent=0x7fffffffa1c0, status=INHERITANCE_ERROR,
unresolved_class=0x7ffff58029f0, always_error=1 '\001')
at /home/arne/Downloads/php-7.4.2/Zend/zend_inheritance.c:724
#4 0x0000555555bdc283 in check_variance_obligation (zv=0x7ffff585c288)
at /home/arne/Downloads/php-7.4.2/Zend/zend_inheritance.c:2334
#5 0x0000555555b938b4 in zend_hash_apply (ht=0x7ffff5858900,
apply_func=0x555555bdc15c <check_variance_obligation>) at
/home/arne/Downloads/php-7.4.2/Zend/zend_hash.c:1812
#6 0x0000555555bdc4c9 in resolve_delayed_variance_obligations
(ce=0x7ffff58029f0) at
/home/arne/Downloads/php-7.4.2/Zend/zend_inheritance.c:2381
#7 0x0000555555bdcafd in zend_do_link_class (ce=0x7ffff58029f0,
lc_parent_name=0x7ffff586cb80) at
/home/arne/Downloads/php-7.4.2/Zend/zend_inheritance.c:2509
#8 0x0000555555b43e3f in do_bind_class (lcname=0x7ffff585c4b0,
lc_parent_name=0x7ffff586cb80) at
/home/arne/Downloads/php-7.4.2/Zend/zend_compile.c:1090
#9 0x0000555555bf66d5 in ZEND_DECLARE_CLASS_SPEC_CONST_HANDLER () at
/home/arne/Downloads/php-7.4.2/Zend/zend_vm_execute.h:4381
#10 0x0000555555c55da5 in execute_ex (ex=0x7ffff5813020) at
/home/arne/Downloads/php-7.4.2/Zend/zend_vm_execute.h:54131
#11 0x0000555555c5a7fa in zend_execute (op_array=0x7ffff5882300,
return_value=0x0) at
/home/arne/Downloads/php-7.4.2/Zend/zend_vm_execute.h:57913
#12 0x0000555555b7a8fe in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/arne/Downloads/php-7.4.2/Zend/zend.c:1665
#13 0x0000555555ad8241 in php_execute_script
(primary_file=0x7fffffffcbf0) at
/home/arne/Downloads/php-7.4.2/main/main.c:2617
#14 0x0000555555c5d3c3 in do_cli (argc=2, argv=0x55555698b290) at
/home/arne/Downloads/php-7.4.2/sapi/cli/php_cli.c:961
#15 0x0000555555c5e544 in main (argc=2, argv=0x55555698b290) at
/home/arne/Downloads/php-7.4.2/sapi/cli/php_cli.c:1352
(gdb)
Test script:
---------------
<?php
spl_autoload_register(function() {
interface InterfaceB extends InterfaceA {}
});
interface InterfaceA {}
trait SomeTrait
{
abstract public function func(): ?InterfaceA;
}
class Foo
{
public function func(): ?InterfaceB {}
}
class Bar extends Foo
{
use SomeTrait;
}
--
Edit bug report at https://bugs.php.net/bug.php?id=79179&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79179&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79179&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79179&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79179&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79179&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79179&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79179&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79179&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79179&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79179&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79179&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79179&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79179&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79179&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79179&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79179&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79179&r=mysqlcfg