Bug #79959 [Opn->Fbk]: Memory leak in zend_string

From: Date: Thu, 15 Oct 2020 12:33:23 +0000
Subject: Bug #79959 [Opn->Fbk]: Memory leak in zend_string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229638@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79959&edit=1

 ID:                 79959
 Updated by:         nikic@php.net
 Reported by:        changochen1 at gmail dot com
 Summary:            Memory leak in zend_string
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Scripting Engine problem
 PHP Version:        8.0Git-2020-08-12 (Git)
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2020-08-13 07:35:44] nikic@php.net

> How should I provide more details?

Running under "USE_ZEND_ALLOC=0 valgrind --leak-check=full php test.php" should produce a
back trace for the leak. (If you are using leak sanitizer, just the USE_ZEND_ALLOC=0 part is
enough.)

------------------------------------------------------------------------
[2020-08-13 07:20:40] cmb@php.net

I cannot reproduce the memory leak on Windows either.

------------------------------------------------------------------------
[2020-08-12 15:06:13] changochen1 at gmail dot com

It doesn't crash so I am not sure how to get a stacktrace.
The log is:
---
Fatal error: Uncaught TypeError: fopen(): supplied resource is not a valid Stream-Context resource
in /home/yongheng/php_commit/php_poc44.php:4
Stack trace:
#0 /home/yongheng/php_commit/php_poc44.php(4): fopen('20', '10', 3409, Resource
id #7)
#1 {main}
  thrown in /home/yongheng/php_commit/php_poc44.php on line 4
[Wed Aug 12 11:04:12 2020]  Script:  '/home/yongheng/php_commit/php_poc44.php'
/home/yongheng/php_clean/Zend/zend_string.h(141) :  Freeing 0x00007ffff2c58780 (56 bytes),
script=/home/yongheng/php_commit/php_poc44.php
=== Total 1 memory leaks detected ===
---

How should I provide more details?

------------------------------------------------------------------------
[2020-08-12 07:52:53] nikic@php.net

I can't reproduce this leak. Not seeing a message from ZMM or anything under USE_ZEND_ALLOC=0
valgrind --leak-check=full.

Do you have a stack trace for the leak?

------------------------------------------------------------------------
[2020-08-12 05:45:51] changochen1 at gmail dot com

Description:
------------
We found a memory leak in PHP. Please refer to the POC.

Test script:
---------------
<?php
 $f1 = fopen ( "php://input" , "r" ) ;
 $f2 = fopen ( 20, 10 , $a [ 1 ] [ 1 ] = 3409 , $f1 ) ;



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79959&edit=1


Thread (7 messages)

« previous php.bugs (#229638) next »