Skip to content

segfault when calling a function defined in global scope #317

Description

@rcmcdonald91

Reproducer:

use parallel\Runtime;
function a() { return; }
(new Runtime)->run(function() { a(); });
ZEND_INIT_FCALL_SPEC_CONST_HANDLER () at /home/rcm/Projects/thing/php-src/Zend/zend_vm_execute.h:4044
4044                    fbc = Z_FUNC_P(func);
(gdb) bt 
#0  ZEND_INIT_FCALL_SPEC_CONST_HANDLER () at /home/rcm/Projects/thing/php-src/Zend/zend_vm_execute.h:4044
#1  execute_ex (ex=0x7fffec004ef0) at /home/rcm/Projects/thing/php-src/Zend/zend_vm_execute.h:58907
#2  0x00007ffff7fab0eb in php_parallel_scheduler_run (frame=frame@entry=0x7ffff3a14020, runtime=0x7ffff545b280)
    at /home/rcm/Projects/thing/parallel/src/scheduler.c:331
#3  0x00007ffff7fab63f in php_parallel_thread (arg=0x7ffff545b280) at /home/rcm/Projects/thing/parallel/src/scheduler.c:501
#4  0x00007ffff7a98ded in ?? () from /usr/lib/libc.so.6
#5  0x00007ffff7b1c0dc in ?? () from /usr/lib/libc.so.6
PHP 8.4.0-dev (cli) (built: Jul 21 2024 23:21:30) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.4.0-dev, Copyright (c) Zend Technologies

This probably shouldn't segfault.

Metadata

Metadata

Labels

help wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions