From d1057cc13971e90ea3e7720dc5c82bbc92c4ad23 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 24 Feb 2016 14:07:06 +0100 Subject: [PATCH] Fixed bug #71470 Don't report hashtable iterator leaks on unclean shutdown, those are expected. --- NEWS | 1 + Zend/tests/bug71470.phpt | 13 +++++++++++++ Zend/zend_execute_API.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug71470.phpt diff --git a/NEWS b/NEWS index abc1f6f480..27dfe73832 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PHP NEWS . Fixed bug #71596 (Segmentation fault on ZTS with date function (setlocale)). (Anatol) . Fixed bug #71535 (Integer overflow in zend_mm_alloc_heap()). (Dmitry) + . Fixed bug #71470 (Leaked 1 hashtable iterators). (Nikita) - ODBC: . Fixed bug #47803, #69526 (Executing prepared statements is succesfull only diff --git a/Zend/tests/bug71470.phpt b/Zend/tests/bug71470.phpt new file mode 100644 index 0000000000..6f8b4f0103 --- /dev/null +++ b/Zend/tests/bug71470.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #71470: Leaked 1 hashtable iterators +--FILE-- + +--EXPECT-- +foo diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 0c6f0377da..56ad4366ff 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -398,7 +398,7 @@ void shutdown_executor(void) /* {{{ */ zend_shutdown_fpu(); #ifdef ZEND_DEBUG - if (EG(ht_iterators_used)) { + if (EG(ht_iterators_used) && !CG(unclean_shutdown)) { zend_error(E_WARNING, "Leaked %" PRIu32 " hashtable iterators", EG(ht_iterators_used)); } #endif -- 2.50.1