diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-09-28 12:56:47 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-09-28 12:56:47 +0200 |
commit | 45cdcb2d0be89fe7bc404dd150240ec83f5de401 (patch) | |
tree | 55b01bfa963376a7942d824c723ae5e3202ee1a6 /Zend/tests/bug76846.phpt | |
parent | b5d0eb44c0c1a452a82054e860e8c6a9420ac5df (diff) | |
download | php-git-45cdcb2d0be89fe7bc404dd150240ec83f5de401.tar.gz |
Fixed bug #76846
Diffstat (limited to 'Zend/tests/bug76846.phpt')
-rw-r--r-- | Zend/tests/bug76846.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Zend/tests/bug76846.phpt b/Zend/tests/bug76846.phpt new file mode 100644 index 0000000000..c167a8bb78 --- /dev/null +++ b/Zend/tests/bug76846.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #76846: Segfault in shutdown function after memory limit error +--INI-- +memory_limit=33M +--SKIPIF-- +<?php +$zend_mm_enabled = getenv("USE_ZEND_ALLOC"); +if ($zend_mm_enabled === "0") { + die("skip Zend MM disabled"); +} +?> +--FILE-- +<?php + +register_shutdown_function(function() { + new stdClass; +}); + +$ary = []; +while (true) { + $ary[] = new stdClass; +} + +?> +--EXPECTF-- +Fatal error: Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes) in %s on line %d +%A |