php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80045 memleak after two set_exception_handler calls with __call
Submitted: 2020-09-03 07:10 UTC Modified: -
From: sjon@php.net Assigned:
Status: Closed Package: *General Issues
PHP Version: 8.0.0beta2 OS: archLinux
Private report: No CVE-ID: None
 [2020-09-03 07:10 UTC] sjon@php.net
Description:
------------
php8 reports a memleak after two set_exception_handler calls combined with an __call

Test script:
---------------
class x {
	public function __construct(){
		$h = set_exception_handler([$this, 'dummyExceptionHandler']);
		$h = set_exception_handler([$this, 'dummyExceptionHandler']);
	}

	public function __call($m, $p) {}
}

new x;

Actual result:
--------------
php-8.0.0beta2/Zend/zend_object_handlers.c(1120) :  Freeing 0x00007fd2ab25d780 (232 bytes), script=/tmp/memleak.php
=== Total 1 memory leaks detected ===


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-03 08:31 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b853c97f3e74d4bb3dbdcfe847e1441a2e9dcb5
Log: Fixed bug #80045
 [2020-09-03 08:31 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC