Skip to content

FPM: segfault dynamically loading extension without opache #12232

Closed
@bukka

Description

@bukka

Description

If PHP-FPM loads extension from fpm config and opcache is not loaded, it crashes with the following back trace:

#0  zend_interned_string_ht_lookup (str=0x5555570c0ea0, interned_strings=0x555556e3b240) at /home/jakub/prog/php/83/Zend/zend_string.c:160
#1  0x0000555555dd4a7f in zend_new_interned_string_request (str=0x5555570c0ea0) at /home/jakub/prog/php/83/Zend/zend_string.c:245
#2  0x0000555555cecda7 in zend_register_module_ex (module=0x7ffff5555340 <jsond_module_entry>) at /home/jakub/prog/php/83/Zend/zend_API.c:2489
#3  0x0000555555a9c026 in php_load_extension (filename=0x5555570be4c0 "jsond", type=1, start_now=1) at /home/jakub/prog/php/83/ext/standard/dl.c:237
#4  0x0000555555a9c132 in php_dl (file=0x5555570be4c0 "jsond", type=1, return_value=0x7fffffffd4a0, start_now=1) at /home/jakub/prog/php/83/ext/standard/dl.c:285
#5  0x0000555555e89705 in fpm_php_apply_defines_ex (kv=0x5555570be480, mode=4) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_php.c:90
#6  0x0000555555e898ae in fpm_php_apply_defines (wp=0x555556febe80) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_php.c:125
#7  0x0000555555e89a99 in fpm_php_init_child (wp=0x555556febe80) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_php.c:213
#8  0x0000555555e7943b in fpm_child_init (wp=0x555556febe80) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_children.c:199
#9  0x0000555555e79e0b in fpm_children_make (wp=0x555556febe80, in_event_loop=0, nb_to_spawn=0, is_debug=1) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_children.c:461
#10 0x0000555555e7a0be in fpm_children_create_initial (wp=0x555556febe80) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_children.c:513
#11 0x0000555555e78e8e in fpm_run (max_requests=0x7fffffffd5e8) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm.c:99
#12 0x0000555555e88825 in main (argc=6, argv=0x7fffffffdb68) at /home/jakub/prog/php/83/sapi/fpm/fpm/fpm_main.c:1834

Example FPM config is following:

[global]
error_log = /dev/stderr
[unconfined]
listen = 127.0.0.1:9012
pm = static
pm.max_children = 1
pm.status_path = /status
catch_workers_output = yes
php_admin_value[extension] = jsond

PHP Version

PHP 8.0+

Operating System

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