Skip to content

php_admin_value[extension]= in FPM pool configuration unsafely runs RINIT #19520

Open

Description

@TimWolla

Description

With the following configuration:

[global]
log_level = debug
error_log = /dev/stderr

[www]
listen = 9999
pm = ondemand
pm.max_children = 3
php_admin_value[extension]=session.so
catch_workers_output=true

and a small patch to session.c to enable session auto start by default (custom INI flags are not loaded in time, other in-tree extensions do not crash):

diff --git i/ext/session/session.c w/ext/session/session.c
index 70e1673d87f..fd6c6cef77d 100644
--- i/ext/session/session.c
+++ w/ext/session/session.c
@@ -900,7 +900,7 @@ PHP_INI_BEGIN()
        STD_PHP_INI_ENTRY("session.save_path",          "",          PHP_INI_ALL, OnUpdateSaveDir,       save_path,          php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.name",               "PHPSESSID", PHP_INI_ALL, OnUpdateName,          session_name,       php_ps_globals,    ps_globals)
        PHP_INI_ENTRY("session.save_handler",           "files",     PHP_INI_ALL, OnUpdateSaveHandler)
-       STD_PHP_INI_BOOLEAN("session.auto_start",       "0",         PHP_INI_PERDIR, OnUpdateBool,       auto_start,         php_ps_globals,    ps_globals)
+       STD_PHP_INI_BOOLEAN("session.auto_start",       "1",         PHP_INI_PERDIR, OnUpdateBool,       auto_start,         php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.gc_probability",     "1",         PHP_INI_ALL, OnUpdateSessionGcProbability,    gc_probability,     php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.gc_divisor",         "100",       PHP_INI_ALL, OnUpdateSessionDivisor,gc_divisor,         php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.gc_maxlifetime",     "1440",      PHP_INI_ALL, OnUpdateSessionLong,          gc_maxlifetime,     php_ps_globals,    ps_globals)

and then running:

sapi/fpm/php-fpm -y fpm.conf -F

and sending a request results in this output:

[19-Aug-2025 12:48:16.712084] DEBUG: pid 700863, fpm_pctl_on_socket_accept(), line 553: [pool www] got accept without idle child available .... I forked
[19-Aug-2025 12:48:16.712117] DEBUG: pid 700863, fpm_event_loop(), line 426: event module triggered 1 events
[19-Aug-2025 12:48:16.715649] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "php-src/Zend/zend_hash.c:783:8: runtime error: applying non-zero offset 3667908216 to null pointer"
[19-Aug-2025 12:48:16.715734] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior php-src/Zend/zend_hash.c:783:8 in "
[19-Aug-2025 12:48:16.715807] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "AddressSanitizer:DEADLYSIGNAL"
[19-Aug-2025 12:48:16.715850] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "================================================================="
[19-Aug-2025 12:48:16.715884] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "==700924==ERROR: AddressSanitizer: SEGV on unknown address 0x00009b537acf (pc 0x591d64517a26 bp 0x7ffd030695a0 sp 0x7ffd03069480 T0)"
[19-Aug-2025 12:48:16.715929] DEBUG: pid 700863, fpm_event_loop(), line 426: event module triggered 1 events
[19-Aug-2025 12:48:16.715997] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "==700924==The signal is caused by a READ memory access."
[19-Aug-2025 12:48:16.716042] DEBUG: pid 700863, fpm_event_loop(), line 426: event module triggered 1 events
[19-Aug-2025 12:48:16.966689] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #0 0x591d64517a26 in zend_hash_str_find_bucket php-src/Zend/zend_hash.c:783:8"
[19-Aug-2025 12:48:16.966738] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #1 0x591d6451776e in zend_hash_str_find php-src/Zend/zend_hash.c:2697:6"
[19-Aug-2025 12:48:16.966753] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #2 0x74debef243e8 in php_session_start php-src/ext/session/session.c:1669:34"
[19-Aug-2025 12:48:16.966771] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #3 0x74debef60478 in php_rinit_session php-src/ext/session/session.c:2906:3"
[19-Aug-2025 12:48:16.966784] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #4 0x74debef4b0de in zm_activate_session php-src/ext/session/session.c:2914:9"
[19-Aug-2025 12:48:16.966804] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #5 0x591d62ee3f62 in php_load_extension php-src/ext/standard/dl.c:247:7"
[19-Aug-2025 12:48:16.966820] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #6 0x591d62ee2294 in php_dl php-src/ext/standard/dl.c:284:6"
[19-Aug-2025 12:48:16.966838] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #7 0x591d64939582 in fpm_php_apply_defines_ex php-src/sapi/fpm/fpm/fpm_php.c:105:3"
[19-Aug-2025 12:48:16.966851] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #8 0x591d6493ae66 in fpm_php_apply_defines php-src/sapi/fpm/fpm/fpm_php.c:151:18"
[19-Aug-2025 12:48:16.966871] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #9 0x591d6493a7c4 in fpm_php_init_child php-src/sapi/fpm/fpm/fpm_php.c:246:10"
[19-Aug-2025 12:48:16.966886] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #10 0x591d648da060 in fpm_child_init php-src/sapi/fpm/fpm/fpm_children.c:199:10"
[19-Aug-2025 12:48:16.966906] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #11 0x591d648d8fa0 in fpm_children_make php-src/sapi/fpm/fpm/fpm_children.c:461:5"
[19-Aug-2025 12:48:16.966922] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #12 0x591d64946be4 in fpm_pctl_on_socket_accept php-src/sapi/fpm/fpm/fpm_process_ctl.c:547:2"
[19-Aug-2025 12:48:16.966939] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #13 0x591d64918192 in fpm_event_fire php-src/sapi/fpm/fpm/fpm_events.c:478:2"
[19-Aug-2025 12:48:16.966953] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #14 0x591d6498fc67 in fpm_event_epoll_wait php-src/sapi/fpm/fpm/events/epoll.c:141:3"
[19-Aug-2025 12:48:16.966973] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #15 0x591d6491447a in fpm_event_loop php-src/sapi/fpm/fpm/fpm_events.c:418:9"
[19-Aug-2025 12:48:16.966988] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #16 0x591d648d4c33 in fpm_run php-src/sapi/fpm/fpm/fpm.c:113:2"
[19-Aug-2025 12:48:16.967005] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #17 0x591d64923f22 in main php-src/sapi/fpm/fpm/fpm_main.c:1845:12"
[19-Aug-2025 12:48:16.967018] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #18 0x74dec122a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16"
[19-Aug-2025 12:48:16.967036] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #19 0x74dec122a28a in __libc_start_main csu/../csu/libc-start.c:360:3"
[19-Aug-2025 12:48:16.967052] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "    #20 0x591d61603434 in _start (php-src/sapi/fpm/php-fpm+0x1c03434) (BuildId: 7efba1981fd9239610ec7542417a9d447b071b1b)"
[19-Aug-2025 12:48:16.967070] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "AddressSanitizer can not provide additional info."
[19-Aug-2025 12:48:16.967087] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "SUMMARY: AddressSanitizer: SEGV php-src/Zend/zend_hash.c:783:8 in zend_hash_str_find_bucket"
[19-Aug-2025 12:48:16.967106] WARNING: pid 700863, (null)(), line 0: [pool www] child 700924 said into stderr: "==700924==ABORTING"

But I expected this output instead: No crash.

PHP Version

PHP 8.4.13-dev (fpm-fcgi) (built: Aug 19 2025 12:40:44) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.4.13-dev, Copyright (c) Zend Technologies

Operating System

No response

Activity

  1. TimWolla commented on Aug 19, 2025

    @TimWolla
    MemberAuthor

    It would probably be best to disable php_admin_value[extension] entirely, it already requires zend_rc_debug = false:

    #if ZEND_RC_DEBUG
    bool orig_rc_debug = zend_rc_debug;
    /* Loading extensions after php_module_startup() breaks some invariants.
    * For instance, it will update the refcount of persistent strings,
    * which is normally not allowed at this stage. */
    zend_rc_debug = false;
    #endif
    php_dl(value, MODULE_PERSISTENT, &zv, 1);
    #if ZEND_RC_DEBUG
    zend_rc_debug = orig_rc_debug;
    #endif

    Alternatively, since the extension is loaded as MODULE_PERSISTENT rather than MODULE_TEMPORARY, it should just run MINIT + GINIT, but not RINIT? It should also be noted, that for the RINIT during loading there is no matching RSHUTDOWN, which might also result in memory leaks.

  2. TimWolla commented on Aug 19, 2025

    @TimWolla
    MemberAuthor

    Related #9921.

  3. TimWolla commented on Aug 19, 2025

    @TimWolla
    MemberAuthor

    It should also be noted, that for the RINIT during loading there is no matching RSHUTDOWN, which might also result in memory leaks.

    Indeed. mbstring triggers:

    [19-Aug-2025 13:01:12.049100] WARNING: pid 830241, (null)(), line 0: [pool www] child 830243 said into stderr: "[Tue Aug 19 13:01:12 2025]  Script:  '-'"
    [19-Aug-2025 13:01:12.049141] WARNING: pid 830241, (null)(), line 0: [pool www] child 830243 said into stderr: "php-src/ext/mbstring/mbstring.c(5977) :  Freeing 0x000073ff08e04000 (16 bytes), script=-"
    [19-Aug-2025 13:01:12.049160] WARNING: pid 830241, (null)(), line 0: [pool www] child 830243 said into stderr: "=== Total 1 memory leaks detected ==="
    

    or

    [19-Aug-2025 13:01:48.410485] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "================================================================="
    [19-Aug-2025 13:01:48.410516] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "==830660==ERROR: LeakSanitizer: detected memory leaks"
    [19-Aug-2025 13:01:48.410527] DEBUG: pid 830600, fpm_event_loop(), line 426: event module triggered 1 events
    [19-Aug-2025 13:01:48.410549] DEBUG: pid 830600, fpm_event_loop(), line 426: event module triggered 1 events
    [19-Aug-2025 13:01:48.410560] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "Direct leak of 480 byte(s) in 1 object(s) allocated from:"
    [19-Aug-2025 13:01:48.410570] DEBUG: pid 830600, fpm_event_loop(), line 426: event module triggered 1 events
    [19-Aug-2025 13:01:48.411282] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #0 0x645bad49e082 in malloc (php-src/sapi/fpm/php-fpm+0x1c9e082) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.411341] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #1 0x645bb07108af in fpm_env_init_main php-src/sapi/fpm/fpm/fpm_env.c:283:22"
    [19-Aug-2025 13:01:48.411363] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #2 0x645bb06d4984 in fpm_init php-src/sapi/fpm/fpm/fpm.c:62:10"
    [19-Aug-2025 13:01:48.411400] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #3 0x645bb07236af in main php-src/sapi/fpm/fpm/fpm_main.c:1817:36"
    [19-Aug-2025 13:01:48.411416] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #4 0x7598f3a2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16"
    [19-Aug-2025 13:01:48.411431] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #5 0x7598f3a2a28a in __libc_start_main csu/../csu/libc-start.c:360:3"
    [19-Aug-2025 13:01:48.411447] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #6 0x645bad403434 in _start (php-src/sapi/fpm/php-fpm+0x1c03434) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.411463] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "Direct leak of 72 byte(s) in 1 object(s) allocated from:"
    [19-Aug-2025 13:01:48.411479] DEBUG: pid 830600, fpm_event_loop(), line 426: event module triggered 1 events
    [19-Aug-2025 13:01:48.411795] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #0 0x645bad49e082 in malloc (php-src/sapi/fpm/php-fpm+0x1c9e082) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.411817] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #1 0x645bb06da397 in fpm_children_create_initial php-src/sapi/fpm/fpm/fpm_children.c:498:46"
    [19-Aug-2025 13:01:48.411834] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #2 0x645bb06d4b31 in fpm_run php-src/sapi/fpm/fpm/fpm.c:99:15"
    [19-Aug-2025 13:01:48.411851] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #3 0x645bb0723f22 in main php-src/sapi/fpm/fpm/fpm_main.c:1845:12"
    [19-Aug-2025 13:01:48.411864] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #4 0x7598f3a2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16"
    [19-Aug-2025 13:01:48.411883] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #5 0x7598f3a2a28a in __libc_start_main csu/../csu/libc-start.c:360:3"
    [19-Aug-2025 13:01:48.411898] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #6 0x645bad403434 in _start (php-src/sapi/fpm/php-fpm+0x1c03434) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.411916] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "Direct leak of 16 byte(s) in 1 object(s) allocated from:"
    [19-Aug-2025 13:01:48.411952] DEBUG: pid 830600, fpm_event_loop(), line 426: event module triggered 1 events
    [19-Aug-2025 13:01:48.414158] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #0 0x645bad49e082 in malloc (php-src/sapi/fpm/php-fpm+0x1c9e082) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.414179] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #1 0x645baf82a323 in __zend_malloc php-src/Zend/zend_alloc.c:3294:14"
    [19-Aug-2025 13:01:48.414197] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #2 0x645baf829935 in _emalloc php-src/Zend/zend_alloc.c:2740:10"
    [19-Aug-2025 13:01:48.414217] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #3 0x645baf82a02a in _safe_emalloc php-src/Zend/zend_alloc.c:2784:9"
    [19-Aug-2025 13:01:48.414236] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #4 0x7598ed978e34  (<unknown module>)"
    [19-Aug-2025 13:01:48.414252] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #5 0x7598ed974508  (<unknown module>)"
    [19-Aug-2025 13:01:48.414277] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #6 0x645baece3f62 in php_load_extension php-src/ext/standard/dl.c:247:7"
    [19-Aug-2025 13:01:48.414295] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #7 0x645baece2294 in php_dl php-src/ext/standard/dl.c:284:6"
    [19-Aug-2025 13:01:48.414319] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #8 0x645bb0739582 in fpm_php_apply_defines_ex php-src/sapi/fpm/fpm/fpm_php.c:105:3"
    [19-Aug-2025 13:01:48.414338] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #9 0x645bb073ae66 in fpm_php_apply_defines php-src/sapi/fpm/fpm/fpm_php.c:151:18"
    [19-Aug-2025 13:01:48.414365] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #10 0x645bb073a7c4 in fpm_php_init_child php-src/sapi/fpm/fpm/fpm_php.c:246:10"
    [19-Aug-2025 13:01:48.414393] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #11 0x645bb06da060 in fpm_child_init php-src/sapi/fpm/fpm/fpm_children.c:199:10"
    [19-Aug-2025 13:01:48.414413] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #12 0x645bb06d8fa0 in fpm_children_make php-src/sapi/fpm/fpm/fpm_children.c:461:5"
    [19-Aug-2025 13:01:48.414430] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #13 0x645bb0746be4 in fpm_pctl_on_socket_accept php-src/sapi/fpm/fpm/fpm_process_ctl.c:547:2"
    [19-Aug-2025 13:01:48.414454] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #14 0x645bb0718192 in fpm_event_fire php-src/sapi/fpm/fpm/fpm_events.c:478:2"
    [19-Aug-2025 13:01:48.414475] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #15 0x645bb078fc67 in fpm_event_epoll_wait php-src/sapi/fpm/fpm/events/epoll.c:141:3"
    [19-Aug-2025 13:01:48.414503] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #16 0x645bb071447a in fpm_event_loop php-src/sapi/fpm/fpm/fpm_events.c:418:9"
    [19-Aug-2025 13:01:48.414520] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #17 0x645bb06d4c33 in fpm_run php-src/sapi/fpm/fpm/fpm.c:113:2"
    [19-Aug-2025 13:01:48.414539] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #18 0x645bb0723f22 in main php-src/sapi/fpm/fpm/fpm_main.c:1845:12"
    [19-Aug-2025 13:01:48.414560] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #19 0x7598f3a2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16"
    [19-Aug-2025 13:01:48.414581] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #20 0x7598f3a2a28a in __libc_start_main csu/../csu/libc-start.c:360:3"
    [19-Aug-2025 13:01:48.414600] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #21 0x645bad403434 in _start (php-src/sapi/fpm/php-fpm+0x1c03434) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.414621] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "Indirect leak of 2017 byte(s) in 59 object(s) allocated from:"
    [19-Aug-2025 13:01:48.414645] DEBUG: pid 830600, fpm_event_loop(), line 426: event module triggered 1 events
    [19-Aug-2025 13:01:48.414751] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #0 0x645bad487e61 in strdup (php-src/sapi/fpm/php-fpm+0x1c87e61) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.414770] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #1 0x645bb0710ad9 in fpm_env_init_main php-src/sapi/fpm/fpm/fpm_env.c:289:26"
    [19-Aug-2025 13:01:48.414788] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #2 0x645bb06d4984 in fpm_init php-src/sapi/fpm/fpm/fpm.c:62:10"
    [19-Aug-2025 13:01:48.414797] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #3 0x645bb07236af in main php-src/sapi/fpm/fpm/fpm_main.c:1817:36"
    [19-Aug-2025 13:01:48.414808] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #4 0x7598f3a2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16"
    [19-Aug-2025 13:01:48.414817] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #5 0x7598f3a2a28a in __libc_start_main csu/../csu/libc-start.c:360:3"
    [19-Aug-2025 13:01:48.414830] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "    #6 0x645bad403434 in _start (php-src/sapi/fpm/php-fpm+0x1c03434) (BuildId: 4ae3af589d151c0932a4441ed237cebd156d9327)"
    [19-Aug-2025 13:01:48.414841] WARNING: pid 830600, (null)(), line 0: [pool www] child 830660 said into stderr: "SUMMARY: AddressSanitizer: 2585 byte(s) leaked in 62 allocation(s)."
    
  4. bukka commented on Sep 4, 2025

    @bukka
    Member

    Oh no, I was hoping to never look into this again... 😄

  5. bukka commented on Sep 5, 2025

    @bukka
    Member

    There are likely users of this feature so disabling would be a BC break. I think this was actually introduced before some other changes but this RINIT issue might have been there. In any case we should find a fix for the stable version first which cannot be not allowing extensions to be set.

    I agree that doing RINIT in this context does not make much sense. I think it's just side effect of using php_dl. I guess we can't easily fix it without breaking ABI in php_load_extension so we might need some extra wrapper that would allow passing some parameter to skip RINIT.

  6. TimWolla commented on Sep 5, 2025

    @TimWolla
    MemberAuthor

    In any case we should find a fix for the stable version first which cannot be not allowing extensions to be set.

    I'm not sure if it is necessary to fix this for stable versions. From the bundled extensions, only mbstring is affected and for that one it seems unlikely to be loaded dynamically. And for external extensions, the workaround is simple. I would just fix this for master, as this allows much greater flexibility in fixing the issue. And as suggested above, I think removing the “feature” entirely is reasonable, given the existing workarounds (e.g. the RC check).

  7. bukka commented on Oct 10, 2025

    @bukka
    Member

    I thought about this and I don't think we should remove it just because of the RC check because then we would need to remove PHP dl function as well (it does the same). And mainly there are users of that feature and in some setups everything is even configured through the fcgi envs - using PHP_ADMIN_VALUE so some users don't even use or have option to use php.ini (there are really such users) so this would no longer be possible (even though configuring extension in that way seems a bit strange but it might still cause break for some users). The thing is that this mostly works for them so I don't think we should be changing it.

    I agree that master only fix should be fine. That will make that RINIT fix easier. Do you want to tackle it or should I?

  8. TimWolla commented on Oct 10, 2025

    @TimWolla
    MemberAuthor

    @bukka since you seem to have a specific solution in mind, please look into this.

  9. added a commit that references this issue on Dec 3, 2025
    446ea62
  10. bukka commented on Dec 3, 2025

    @bukka
    Member

    I just created and initial draft PR: #20636 . It needs testing and I would like to add a test for this. I think it should be possible to tweak dl_test for that purpose so will look into it later.

  11. added a commit that references this issue on Oct 27, 2026
    7783a8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions