mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
When observer is enabled, we normally add an extra temporary to all functions, to store the previously observed frame. However, this is done in zend_observer_post_startup() so it doesn't happen to dl'ed() functions. One possible fix would be to move that from zend_observer_post_startup() to zend_register_functions(), but this would be too early: Observer may not be enabled when zend_register_functions() is called, and may still be enabled later. However, when zend_register_functions() is called at run-time (during dl()), we know definitively whether observer is enabled. Here I update zend_register_functions() to add a temporary to dl'ed() functions when observer is enabled. Fixes: GH-17211 Closes: GH-17220
43 lines
789 B
PHP
43 lines
789 B
PHP
--TEST--
|
|
dl() / observer segfault
|
|
--EXTENSIONS--
|
|
zend_test
|
|
--SKIPIF--
|
|
<?php include dirname(__DIR__, 3) . "/dl_test/tests/skip.inc"; ?>
|
|
--INI--
|
|
zend_test.observer.enabled=1
|
|
zend_test.observer.observe_functions=1
|
|
zend_test.observer.show_output=1
|
|
--FILE--
|
|
<?php
|
|
|
|
if (PHP_OS_FAMILY === 'Windows') {
|
|
$loaded = dl('php_dl_test.dll');
|
|
} else {
|
|
$loaded = dl('dl_test.so');
|
|
}
|
|
|
|
var_dump(dl_test_test2("World!"));
|
|
|
|
$test = new DlTest();
|
|
var_dump($test->test("World!"));
|
|
?>
|
|
--EXPECTF--
|
|
<!-- init '%sgh17211.php' -->
|
|
<!-- init dl() -->
|
|
<dl>
|
|
</dl>
|
|
<!-- init dl_test_test2() -->
|
|
<dl_test_test2>
|
|
</dl_test_test2>
|
|
<!-- init var_dump() -->
|
|
<var_dump>
|
|
string(12) "Hello World!"
|
|
</var_dump>
|
|
<!-- init DlTest::test() -->
|
|
<DlTest::test>
|
|
</DlTest::test>
|
|
<var_dump>
|
|
string(12) "Hello World!"
|
|
</var_dump>
|