php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79179 Segfault with autoloading interface
Submitted: 2020-01-27 21:02 UTC Modified: 2020-01-27 21:06 UTC
From: arne at arne-groskurth dot eu Assigned:
Status: Duplicate Package: Reproducible crash
PHP Version: 7.4.2 OS: Ubuntu 19.10
Private report: No CVE-ID: None
 [2020-01-27 21:02 UTC] arne at arne-groskurth dot eu
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;
}



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-27 21:06 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2020-01-27 21:06 UTC] nikic@php.net
This is a duplicate of bug #78989 (not fixed yet).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 08 00:01:29 2024 UTC