Skip to content

Segfault when using ReflectionFiber #11121

Closed
@danog

Description

@danog

Description

The following code: https://paste.daniil.it/segfault_reflectionfiber_v2.tar.xz (all dependencies are exactly the ones specified in composer.lock, with a few manual patches made to vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php, vendor/danog/madelineproto/src/GarbageCollector.php to enable ReflectionFiber logging; use API ID and API hash 1, 1 to test)

Resulted in a segfault with this gdb backtrace:

(gdb) back
#0  zend_fetch_debug_backtrace (return_value=0x7fffe727d2e0, skip_last=<optimized out>, options=1, limit=0) at /usr/src/debug/php/php-8.2.5/Zend/zend_builtin_functions.c:1748
#1  0x00005555557713d4 in zim_ReflectionFiber_getTrace (execute_data=0x7fffe727d310, return_value=0x7fffe727d2e0) at /usr/src/debug/php/php-8.2.5/ext/reflection/php_reflection.c:7066
#2  0x00005555558f034c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (execute_data=0x7fffe727d1e0) at /usr/src/debug/php/php-8.2.5/Zend/zend_vm_execute.h:1951
#3  0x0000555555939438 in execute_ex (ex=<optimized out>) at /usr/src/debug/php/php-8.2.5/Zend/zend_vm_execute.h:55823
#4  0x00005555558b57fe in zend_call_function (fci=<optimized out>, fci_cache=<optimized out>) at /usr/src/debug/php/php-8.2.5/Zend/zend_execute_API.c:947
#5  0x000055555596ba5f in zend_fiber_execute (transfer=0x7fffe63fbfb0) at /usr/src/debug/php/php-8.2.5/Zend/zend_fibers.c:504
#6  0x000055555596b7e2 in zend_fiber_trampoline (data=...) at /usr/src/debug/php/php-8.2.5/Zend/zend_fibers.c:299
#7  0x0000555555a05e97 in make_fcontext () at /usr/src/debug/php/php-8.2.5/Zend/asm/make_x86_64_sysv_elf_gas.S:135
#8  0x0000000000000000 in ?? ()

zbacktrace doesn't work.

But I expected this output instead: No segfault

PHP Version

8.2.5

Operating System

Arch linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions