]> granicus.if.org Git - php/commitdiff
Bug #74815 crash with a combination of INI entries at startup
authorAnatol Belski <ab@php.net>
Tue, 27 Jun 2017 14:26:54 +0000 (16:26 +0200)
committerAnatol Belski <ab@php.net>
Tue, 27 Jun 2017 14:30:10 +0000 (16:30 +0200)
TS related VCWD routines depend on CWD. Thus, a premature CWD
deactivation renders the VCWD layer unusable. Same issue seems to
persist in versions < 7.2, just that the code path is actually unused so
the issue didn't show up. Still might make sense to backport this into
lower branches.

Zend/zend.c
main/main.c
tests/output/bug74815.phpt [new file with mode: 0644]

index 0cb0cc7d4138ebc49e13221491a9e006ea2814cc..376e792eca2af7e51a734f02239030df2432b3dc 100644 (file)
@@ -888,13 +888,9 @@ void zend_post_startup(void) /* {{{ */
        }
        free(EG(zend_constants));
 
-       virtual_cwd_deactivate();
-
        executor_globals_ctor(executor_globals);
        global_persistent_list = &EG(persistent_list);
        zend_copy_ini_directives();
-#else
-       virtual_cwd_deactivate();
 #endif
 }
 /* }}} */
index 90dc78d8b416bc3295d0d606e8f38f35c27fc2b4..4ef2b416396817956d7476f0bb851cec95b33df9 100644 (file)
@@ -2359,6 +2359,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
                } zend_end_try();
        }
 
+       virtual_cwd_deactivate();
+
        sapi_deactivate();
        module_startup = 0;
 
diff --git a/tests/output/bug74815.phpt b/tests/output/bug74815.phpt
new file mode 100644 (file)
index 0000000..be4fa1b
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+Bug #74815 crash with a combination of INI entries at startup
+--FILE--
+<?php
+
+$php = getenv("TEST_PHP_EXECUTABLE");
+
+echo shell_exec("$php -n -d error_log=errors.log -d error_reporting=E_ALL -d log_errors=On -d track_errors=On -v");
+
+?>
+==DONE==
+--EXPECTF--
+Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
+%A
+==DONE==