php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81419 A memory leak in accel_preload()
Submitted: 2021-09-06 08:23 UTC Modified: 2021-10-17 12:38 UTC
From: dinghao dot liu at zju dot edu dot cn Assigned:
Status: Open Package: opcache
PHP Version: 8.0.10 OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-09-06 08:23 UTC] dinghao dot liu at zju dot edu dot cn
Description:
------------
There is a suspected memleak issue in ext/opcache/ZendAccelerator.c. In function accel_preload(), variable 'preload_scripts' is allocated at line 4453 through emalloc(). All paths after this allocation will execute the cleanup against this variable at 'finish' label, except for one error handling path on failure of preload_optimize() at line 4687, which may cause a memleak.

This bug is suggested by a static analysis tool, please advise.


Patches

fix_memleak.patch (last revision 2021-09-06 08:23 UTC by dinghao dot liu at zju dot edu dot cn)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-16 21:32 UTC] cmb@php.net
-Package: *Extensibility Functions +Package: opcache
 [2021-10-15 15:20 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2021-10-15 15:20 UTC] felipe@php.net
Hello,
Can you provide a proper .php test case?
 [2021-10-17 12:38 UTC] dinghao dot liu at zju dot edu dot cn
-Status: Feedback +Status: Open
 [2021-10-17 12:38 UTC] dinghao dot liu at zju dot edu dot cn
Sorry, currently I have no PoC for this bug.
The memleak is mainly analyzed theoretically.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 18:03:40 2021 UTC