mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Fixed bug #78175 (Preloading segfaults at preload time and at runtime)
This commit is contained in:
parent
04a6aac59b
commit
148eb20226
2
NEWS
2
NEWS
@ -10,6 +10,8 @@ PHP NEWS
|
||||
- Opcache:
|
||||
. Fixed bug #78106 (Path resolution fails if opcache disabled during request).
|
||||
(Nikita)
|
||||
. Fixed bug #78175 (Preloading segfaults at preload time and at runtime).
|
||||
(Dmitry)
|
||||
|
||||
- SQLite3:
|
||||
. Implement FR ##70950 (Make SQLite3 Online Backup API available). (BohwaZ)
|
||||
|
@ -4081,10 +4081,25 @@ static int accel_preload(const char *config)
|
||||
ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit();
|
||||
}
|
||||
|
||||
/* Cleanup executor */
|
||||
EG(flags) |= EG_FLAGS_IN_SHUTDOWN;
|
||||
|
||||
php_call_shutdown_functions();
|
||||
zend_call_destructors();
|
||||
php_free_shutdown_functions();
|
||||
|
||||
/* Release stored values to avoid dangling pointers */
|
||||
zend_hash_graceful_reverse_destroy(&EG(symbol_table));
|
||||
zend_hash_init(&EG(symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
|
||||
#if ZEND_DEBUG
|
||||
if (gc_enabled() && !CG(unclean_shutdown)) {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
#endif
|
||||
|
||||
zend_objects_store_free_object_storage(&EG(objects_store), 1);
|
||||
|
||||
/* Inheritance errors may be thrown during linking */
|
||||
zend_try {
|
||||
preload_link();
|
||||
|
14
ext/opcache/tests/bug78175.phpt
Normal file
14
ext/opcache/tests/bug78175.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #78175 (Preloading segfaults at preload time and at runtime)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.preload={PWD}/preload_bug78175.inc
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
OK
|
||||
--EXPECT--
|
||||
Shutdown
|
||||
OK
|
4
ext/opcache/tests/preload_bug78175.inc
Normal file
4
ext/opcache/tests/preload_bug78175.inc
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
register_shutdown_function(function() {
|
||||
echo "Shutdown\n";
|
||||
});
|
Loading…
Reference in New Issue
Block a user